Solution46
LibCommon::CDebug クラスfinal

デバッグクラス [詳解]

#include "CDebug.h"

LibCommon::CDebug の継承関係図
Inheritance graph
LibCommon::CDebug 連携図
Collaboration graph

公開メンバ関数

virtual bool OutputString (wchar_t const *pszString) noexcept override
 文字列出力関数 [詳解]
 
- 基底クラス LibCommon::CStreamOut に属する継承公開メンバ関数
virtual bool OutputChar (wchar_t ch) noexcept
 1文字出力関数 [詳解]
 
virtual bool OutputFormat (wchar_t const *pszFormat,...) noexcept
 書式設定文字列出力関数 [詳解]
 
virtual bool OutputArgs (wchar_t const *pszFormat, va_list vaArgs) noexcept
 引数リスト文字列出力関数 [詳解]
 
virtual bool OutputNewLine () noexcept
 改行出力関数 [詳解]
 
virtual bool OutputLineHeader () noexcept
 行ヘッダー出力関数 [詳解]
 
virtual bool UpdateLineNumber () noexcept
 行番号更新関数 [詳解]
 
virtual int GetLineNumber () noexcept
 行番号取得関数 [詳解]
 
virtual int GetIndentCount () noexcept
 インデントカウント取得関数 [詳解]
 
virtual bool OutputIndent () noexcept
 インデント出力関数 [詳解]
 
virtual bool Indent () noexcept
 インデント関数 [詳解]
 
virtual bool Unindent () noexcept
 アンインデント関数 [詳解]
 
virtual bool OutputLineString (wchar_t const *pszString, bool bHeader=true, bool bIndent=true) noexcept
 文字列行出力関数 [詳解]
 
virtual bool OutputLineFormat (wchar_t const *pszFormat,...) noexcept
 書式設定文字列行出力関数 [詳解]
 
virtual bool OutputLineArgs (wchar_t const *pszFormat, va_list vaArgs) noexcept
 引数リスト文字列行出力関数 [詳解]
 
virtual bool ExOutputLineFormat (bool bHeader, bool bIndent, wchar_t const *pszFormat,...) noexcept
 拡張書式設定文字列行出力関数 [詳解]
 
virtual bool ExOutputLineArgs (bool bHeader, bool bIndent, wchar_t const *pszFormat, va_list vaArgs) noexcept
 拡張引数リスト文字列行出力関数 [詳解]
 

静的公開メンバ関数

static CDebugGetInstance () noexcept
 インスタンス取得関数 [詳解]
 

限定公開メンバ関数

 CDebug () noexcept
 コンストラクタ [詳解]
 
virtual ~CDebug () noexcept
 デストラクタ [詳解]
 
- 基底クラス LibCommon::CStreamOut に属する継承限定公開メンバ関数
 CStreamOut () noexcept
 コンストラクタ [詳解]
 
virtual ~CStreamOut () noexcept
 デストラクタ [詳解]
 

限定公開変数類

wchar_t m_szString [BUFFER_SIZE+1]
 文字列バッファ [詳解]
 
- 基底クラス LibCommon::CStreamOut に属する継承限定公開変数類
int m_nLine
 行番号 [詳解]
 
int m_nIndent
 インデントカウント [詳解]
 

静的限定公開変数類

static int const BUFFER_SIZE = ( 2048 - 1 )
 文字列バッファサイズ [詳解]
 
static CDebug s_cInstance
 静的インスタンス [詳解]
 
- 基底クラス LibCommon::CStreamOut に属する継承静的限定公開変数類
static int const FORMAT_BUFFER_SIZE = ( 2048 - 1 )
 書式設定文字列バッファサイズ [詳解]
 

非公開メンバ関数

 CDebug (CDebug const &)=delete
 
CDebugoperator= (CDebug const &)=delete
 

詳解

デバッグクラス

デバッグクラスです。

注意
シングルトンクラスです。

CDebug.h50 行目に定義があります。

構築子と解体子

LibCommon::CDebug::CDebug ( )
explicitprotectednoexcept

コンストラクタ

コンストラクタです。

引数
なし
戻り値
なし
注意
なし

CDebug.cpp30 行目に定義があります。

参照先 NotifyConstructor.

32  : CStreamOut()
33  // メンバ変数初期化
34  , m_szString()
35  {
36  // コンストラクタ実行通知
38  }
#define NotifyConstructor()
コンストラクタ実行通知マクロ
Definition: LibUtility.h:24
wchar_t m_szString[BUFFER_SIZE+1]
文字列バッファ
Definition: CDebug.h:114
CStreamOut() noexcept
コンストラクタ
Definition: CStreamOut.cpp:30
LibCommon::CDebug::~CDebug ( )
protectedvirtualnoexcept

デストラクタ

デストラクタです。

引数
なし
戻り値
なし
注意
なし

CDebug.cpp42 行目に定義があります。

参照先 NotifyDestructor.

42  {
43  // デストラクタ実行通知
45  }
#define NotifyDestructor()
デストラクタ実行通知マクロ
Definition: LibUtility.h:25
LibCommon::CDebug::CDebug ( CDebug const &  )
privatedelete

関数詳解

bool LibCommon::CDebug::OutputString ( wchar_t const *  pszString)
overridevirtualnoexcept

文字列出力関数

文字列出力関数です。

引数
[in]pszString文字列ポインタ
戻り値
実行結果
  • true 成功
  • false 失敗
注意
オーバーライド関数です。

LibCommon::CStreamOutを実装しています。

CDebug.cpp51 行目に定義があります。

参照先 BUFFER_SIZE, m_szString.

51  {
52  // 処理ブロック
53  bool result = false;
54  do {
55  // 文字列ポインタを調べる
56  if ( nullptr == pszString ) {
57  // 失敗!
58  break;
59  }
60 
61  // 文字列長を取得する
62  int nCount = static_cast< int >( ::wcslen( pszString ) );
63  if ( BUFFER_SIZE >= nCount ) {
64  // デバッグコンソールに文字列出力する
65  ::OutputDebugStringW( pszString );
66  }
67  // 巡回する
68  else for ( int nIndex = 0, nSize = 0; nCount > nIndex; nIndex += nSize, nCount -= nSize ) {
69  // 1回に出力する文字数を取得する
70  if ( BUFFER_SIZE > nCount ) {
71  nSize = nCount;
72  }
73  else {
74  nSize = BUFFER_SIZE;
75  }
76 
77  // 文字列バッファにコピーする
78  ::wcsncpy_s( m_szString, &pszString[ nIndex ], nSize );
79 
80  // 終端文字コードを設定する
81  m_szString[ nSize ] = L'\0';
82 
83  // デバッグコンソールに文字列出力する
84  ::OutputDebugStringW( m_szString );
85  }
86 
87  // 成功!
88  result = true;
89  } while ( false );
90 
91  // 実行結果を返す
92  return result;
93  }
wchar_t m_szString[BUFFER_SIZE+1]
文字列バッファ
Definition: CDebug.h:114
static int const BUFFER_SIZE
文字列バッファサイズ
Definition: CDebug.h:109
static CDebug& LibCommon::CDebug::GetInstance ( )
inlinestaticnoexcept

インスタンス取得関数

インスタンス取得関数です。

引数
なし
戻り値
インスタンス参照
注意
なし

CDebug.h104 行目に定義があります。

104 { return s_cInstance; }
static CDebug s_cInstance
静的インスタンス
Definition: CDebug.h:119
CDebug& LibCommon::CDebug::operator= ( CDebug const &  )
privatedelete

メンバ詳解

int const LibCommon::CDebug::BUFFER_SIZE = ( 2048 - 1 )
staticprotected

文字列バッファサイズ

CDebug.h109 行目に定義があります。

参照元 OutputString().

wchar_t LibCommon::CDebug::m_szString[BUFFER_SIZE+1]
protected

文字列バッファ

CDebug.h114 行目に定義があります。

参照元 OutputString().

CDebug LibCommon::CDebug::s_cInstance
staticprotected

静的インスタンス

CDebug.h119 行目に定義があります。

参照元 LibCommon::CLibCommon::GetInstanceHandle().


このクラス詳解は次のファイルから抽出されました: