<commit_before>//
// RemotePhotoTool - remote camera control software
// Copyright (C) 2008-2014 <NAME>
//
/// \file CdsdkSourceInfoImpl.hpp CDSDK - SourceInfo impl
//
#pragma once

// includes
#include "SourceInfo.hpp"
#include "SourceDevice.hpp"
#include "CdsdkCommon.hpp"
#include "CdsdkSourceDeviceImpl.hpp"

namespace CDSDK
{

/// source info impl for CDSDK
class SourceInfoImpl: public SourceInfo
{
public:
   /// ctor
   SourceInfoImpl(RefSp spRef)
      :m_spRef(spRef)
   {
      ZeroMemory(&m_sourceInfo, sizeof(m_sourceInfo));
   }

   /// dtor
   virtual ~SourceInfoImpl() throw() {}

   virtual CString Name() const override
   {
      return m_sourceInfo.Name;
   }

   virtual std::shared_ptr<SourceDevice> Open() override
   {
      cdHSource hSource = 0;

      LOG_TRACE(_T("about to call CDOpenSource...\n"));

      // may return cdINVALID_PARAMETER, cdMEM_ALLOC_FAILED, cdDEVICE_NOT_FOUND, cdDEVICE_NOT_INSTALLED
      cdError err = CDOpenSource(&m_sourceInfo, &hSource);
      LOG_TRACE(_T("CDOpenSource(&si = \"%hs\") returned %08x\n"), m_sourceInfo.Name, err);
      CheckError(_T("CDOpenSource"), err, __FILE__, __LINE__);

      return std::shared_ptr<SourceDevice>(new SourceDeviceImpl(m_spRef, hSource));
   }

   /// returns source info
   cdSourceInfo& GetSourceInfo() throw() { return m_sourceInfo; }

private:
   /// source info
   cdSourceInfo m_sourceInfo;

   /// SDK ref
   RefSp m_spRef;
};

} // namespace EDSDK
<commit_msg>added more logging infos for CDOpenSource<commit_after>//
// RemotePhotoTool - remote camera control software
// Copyright (C) 2008-2014 <NAME>
//
/// \file CdsdkSourceInfoImpl.hpp CDSDK - SourceInfo impl
//
#pragma once

// includes
#include "SourceInfo.hpp"
#include "SourceDevice.hpp"
#include "CdsdkCommon.hpp"
#include "CdsdkSourceDeviceImpl.hpp"

namespace CDSDK
{

/// source info impl for CDSDK
class SourceInfoImpl: public SourceInfo
{
public:
   /// ctor
   SourceInfoImpl(RefSp spRef)
      :m_spRef(spRef)
   {
      ZeroMemory(&m_sourceInfo, sizeof(m_sourceInfo));
   }

   /// dtor
   virtual ~SourceInfoImpl() throw() {}

   virtual CString Name() const override
   {
      return m_sourceInfo.Name;
   }

   virtual std::shared_ptr<SourceDevice> Open() override
   {
      cdHSource hSource = 0;

      LOG_TRACE(_T("about to call CDOpenSource...\n"));

      // may return cdINVALID_PARAMETER, cdMEM_ALLOC_FAILED, cdDEVICE_NOT_FOUND, cdDEVICE_NOT_INSTALLED
      cdError err = CDOpenSource(&m_sourceInfo, &hSource);
      LOG_TRACE(_T("CDOpenSource(&si = \"%hs\", hSource=%08x) returned %08x\n"),
         m_sourceInfo.Name, hSource, err);
      CheckError(_T("CDOpenSource"), err, __FILE__, __LINE__);

      return std::shared_ptr<SourceDevice>(new SourceDeviceImpl(m_spRef, hSource));
   }

   /// returns source info
   cdSourceInfo& GetSourceInfo() throw() { return m_sourceInfo; }

private:
   /// source info
   cdSourceInfo m_sourceInfo;

   /// SDK ref
   RefSp m_spRef;
};

} // namespace EDSDK

{'fraction_non_alphanumeric': 0.1239946380697051, 'fraction_numerical': 0.00804289544235925, 'mean_word_length': 3.502262443438914, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5437764', 'n_tokens_mistral': 1015, 'n_tokens_neox': 968, 'n_words': 225}