Solution46
LibCommon 名前空間

共通ライブラリ名前空間 [詳解]

クラス

class  CArray
 配列クラス [詳解]
 
class  CConsole
 コンソール入出力クラス [詳解]
 
class  CConsoleMenu
 コンソールメニュークラス [詳解]
 
class  CDebug
 デバッグクラス [詳解]
 
class  CEvent
 イベントクラス [詳解]
 
class  CFile
 ファイル入出力クラス [詳解]
 
class  CFileStream
 ファイルストリームクラス [詳解]
 
class  CLibCommon
 共通ライブラリクラス [詳解]
 
class  CMapping
 マッピングクラス [詳解]
 
class  CMonitor
 モニタクラス [詳解]
 
class  CMutex
 ミューテックスクラス [詳解]
 
class  CProcess
 プロセスクラス [詳解]
 
class  CSemaphore
 セマフォクラス [詳解]
 
class  CStream
 ストリームクラス [詳解]
 
class  CStreamOut
 ストリーム出力クラス [詳解]
 
class  CString
 文字列クラス [詳解]
 
class  CStringStream
 文字列ストリームクラス [詳解]
 
class  CSync
 同期クラス [詳解]
 
class  CSyncAuto
 自動同期クラス [詳解]
 
class  CThread
 スレッドクラス [詳解]
 
class  CTimer
 タイマクラス [詳解]
 

列挙型

enum  EWindowPosition {
  EWindowPosition::Left, EWindowPosition::Top, EWindowPosition::Right, EWindowPosition::Bottom,
  EWindowPosition::Full, EWindowPosition::Size
}
 ウィンドウ表示位置種別列挙体 [詳解]
 

関数

LIB_COMMON_API void UtilNotifyFatalError (wchar_t const *pszFileName, wchar_t const *pszFuncName, UINT uLineNumber) noexcept
 致命的エラー発生通知関数 [詳解]
 
LIB_COMMON_API void UtilNotifyDllMain (HINSTANCE hInstance, DWORD dwReason) noexcept
 DLLメイン関数実行通知関数 [詳解]
 
LIB_COMMON_API void UtilNotifyConstructor (wchar_t const *pszFuncName) noexcept
 コンストラクタ実行通知関数 [詳解]
 
LIB_COMMON_API void UtilNotifyDestructor (wchar_t const *pszFuncName) noexcept
 デストラクタ実行通知関数 [詳解]
 
LIB_COMMON_API int ShowMessage (wchar_t const *pszMessage, HWND hWnd=nullptr, UINT uType=(MB_OK|MB_ICONEXCLAMATION)) noexcept
 メッセージ表示関数 [詳解]
 
LIB_COMMON_API void OutputDebugFormat (wchar_t const *pszFormat,...) noexcept
 デバッグ出力関数 [詳解]
 
LIB_COMMON_API bool ExpandFormatArgs (wchar_t *pszBuffer, size_t uSize, wchar_t const *pszFormat, va_list vaArgs) noexcept
 書式設定文字列展開関数 [詳解]
 
LIB_COMMON_API wchar_t const * GetExeFilePath (wchar_t *pszBuffer, size_t uSize) noexcept
 実行ファイルパス取得関数 [詳解]
 
LIB_COMMON_API wchar_t const * GetExeFileDir (wchar_t *pszBuffer, size_t uSize) noexcept
 実行ファイルディレクトリパス取得関数 [詳解]
 
LIB_COMMON_API wchar_t const * GetExeFileName (wchar_t *pszBuffer, size_t uSize) noexcept
 実行ファイル名取得関数 [詳解]
 
LIB_COMMON_API wchar_t const * GetDirPath (wchar_t *pszBuffer, size_t uSize, wchar_t const *pszPath) noexcept
 ディレクトリパス取得関数 [詳解]
 
LIB_COMMON_API wchar_t const * GetFileName (wchar_t *pszBuffer, size_t uSize, wchar_t const *pszPath) noexcept
 ファイル名取得関数 [詳解]
 
LIB_COMMON_API wchar_t const * GetModuleName (HINSTANCE hInstance, wchar_t *pszBuffer=nullptr, size_t uSize=0) noexcept
 モジュール名取得関数 [詳解]
 
LIB_COMMON_API bool CompareCharCode (wchar_t ch1, wchar_t ch2, bool bIgnore) noexcept
 文字コード比較関数 [詳解]
 
LIB_COMMON_API bool CompareCharCode (wchar_t ch, wchar_t const *pszString, bool bIgnore) noexcept
 文字コード比較関数 [詳解]
 
LIB_COMMON_API bool SetWindowPosition (HWND hWnd, EWindowPosition ePos) noexcept
 ウィンドウ表示位置設定関数 [詳解]
 
LIB_COMMON_API DWORD SearchProcess (wchar_t const *pszPath)
 プロセス検索関数 [詳解]
 

変数

template class LIB_COMMON_API CArray< int >
 
template class LIB_COMMON_API CArray< wchar_t >
 

詳解

共通ライブラリ名前空間

共通ライブラリ名前空間です。

注意
なし

列挙型詳解

ウィンドウ表示位置種別列挙体

ウィンドウ表示位置種別列挙体です。

注意
なし
列挙値
Left 

Top 

Right 

Bottom 

Full 

フルサイズ

Size 

列挙体サイズ

LibUtility.h39 行目に定義があります。

39  {
40  Left, ///< 左
41  Top, ///< 上
42  Right, ///< 右
43  Bottom, ///< 下
44  Full, ///< フルサイズ
45  Size ///< 列挙体サイズ
46  };

関数詳解

void LibCommon::UtilNotifyFatalError ( wchar_t const *  pszFileName,
wchar_t const *  pszFuncName,
UINT  uLineNumber 
)
noexcept

致命的エラー発生通知関数

致命的エラー発生通知関数です。

引数
[in]pszFileNameファイル名
[in]pszFuncName関数名
[in]uLineNumber行番号
戻り値
なし
注意
なし

LibUtility.cpp28 行目に定義があります。

参照先 GetExeFileName(), GetFileName(), OutputDebugFormat().

28  {
29  // 実行ファイル名を取得する
30  wchar_t szExeName[ MAX_PATH ];
31  GetExeFileName( szExeName, MAX_PATH );
32 
33  // ソースファイル名を取得する
34  wchar_t szFileName[ MAX_PATH ];
35  GetFileName( szFileName, MAX_PATH, pszFileName );
36 
37  // カレントプロセスIDを取得する
38  DWORD dwProcessId = ::GetCurrentProcessId();
39 
40  // カレントスレッドIDを取得する
41  DWORD dwThreadId = ::GetCurrentThreadId();
42 
43  // デバッグ出力する
44  wchar_t szBuffer[ 2048 ];
45  ::swprintf_s( szBuffer, L"★以下の場所で致命的エラーが発生したためプログラムを終了します。\n"
46  "実行ファイル名:%s\n"
47  "ファイル名:%s\n"
48  "関数名:%s\n"
49  "行番号:%u\n"
50  "プロセスID:0x%04X\n"
51  "スレッドID:0x%04X\n"
52  , szExeName
53  , szFileName
54  , pszFuncName
55  , uLineNumber
56  , dwProcessId
57  , dwThreadId );
58  OutputDebugFormat( szBuffer );
59 
60  // メッセージボックスを表示する
61  int nResult = ::MessageBoxW( nullptr, szBuffer, L"★致命的エラー", MB_OKCANCEL | MB_ICONHAND );
62  if ( IDOK == nResult ) {
63  // アプリケーションを終了する
64  // ::abort();
65  ::exit( -1 );
66  }
67  }
LIB_COMMON_API void OutputDebugFormat(wchar_t const *pszFormat,...) noexcept
デバッグ出力関数
Definition: LibUtility.cpp:165
LIB_COMMON_API wchar_t const * GetExeFileName(wchar_t *pszBuffer, size_t uSize) noexcept
実行ファイル名取得関数
Definition: LibUtility.cpp:272
LIB_COMMON_API wchar_t const * GetFileName(wchar_t *pszBuffer, size_t uSize, wchar_t const *pszPath) noexcept
ファイル名取得関数
Definition: LibUtility.cpp:331

呼び出し関係図:

void LibCommon::UtilNotifyDllMain ( HINSTANCE  hInstance,
DWORD  dwReason 
)
noexcept

DLLメイン関数実行通知関数

DLLメイン関数実行通知関数です。

引数
[in]hInstanceDLLモジュールハンドル
[in]dwReason関数を呼び出す理由
戻り値
なし
注意
なし

LibUtility.cpp71 行目に定義があります。

参照先 GetExeFileName(), OutputDebugFormat().

71  {
72  // 処理ブロック
73  do {
74  // 関数を呼び出す理由を調べる
75  wchar_t const* pszReason = nullptr;
76  switch ( dwReason ) {
77  case DLL_PROCESS_ATTACH: pszReason = L"プロセスアタッチ"; break;
78  case DLL_THREAD_ATTACH: pszReason = L"スレッドアタッチ"; break;
79  case DLL_THREAD_DETACH: pszReason = L"スレッドデタッチ"; break;
80  case DLL_PROCESS_DETACH: pszReason = L"プロセスデタッチ"; break;
81  }
82 
83  // 文字列ポインタを調べる
84  if ( nullptr == pszReason ) {
85  // 失敗!
86  break;
87  }
88 
89  // 実行ファイル名を取得する
90  wchar_t szExeFile[ MAX_PATH ];
91  GetExeFileName( szExeFile, MAX_PATH );
92 
93  // モジュールファイル名を取得する
94  wchar_t szPath[ MAX_PATH ];
95  ::GetModuleFileNameW( hInstance, szPath, MAX_PATH );
96 
97  // カレントプロセスIDを取得する
98  DWORD dwProcessId = ::GetCurrentProcessId();
99 
100  // カレントスレッドIDを取得する
101  DWORD dwThreadId = ::GetCurrentThreadId();
102 
103  // デバッグ出力する
104  OutputDebugFormat( L"★%s:[%04X:%04X] %s, %s\n", pszReason, dwProcessId, dwThreadId, szExeFile, szPath );
105  } while ( false );
106  }
LIB_COMMON_API void OutputDebugFormat(wchar_t const *pszFormat,...) noexcept
デバッグ出力関数
Definition: LibUtility.cpp:165
LIB_COMMON_API wchar_t const * GetExeFileName(wchar_t *pszBuffer, size_t uSize) noexcept
実行ファイル名取得関数
Definition: LibUtility.cpp:272

呼び出し関係図:

void LibCommon::UtilNotifyConstructor ( wchar_t const *  pszFuncName)
noexcept

コンストラクタ実行通知関数

コンストラクタ実行通知関数です。

引数
[in]pszFuncName関数名
戻り値
なし
注意
なし

LibUtility.cpp110 行目に定義があります。

参照先 GetExeFileName(), OutputDebugFormat().

110  {
111  // 実行ファイル名を取得する
112  wchar_t szExeFile[ MAX_PATH ];
113  GetExeFileName( szExeFile, MAX_PATH );
114 
115  // カレントプロセスIDを取得する
116  DWORD dwProcessId = ::GetCurrentProcessId();
117 
118  // カレントスレッドIDを取得する
119  DWORD dwThreadId = ::GetCurrentThreadId();
120 
121  // デバッグ出力する
122  OutputDebugFormat( L"▼コンストラクタ:[%04X:%04X] %s!%s\n", dwProcessId, dwThreadId, szExeFile, pszFuncName );
123  }
LIB_COMMON_API void OutputDebugFormat(wchar_t const *pszFormat,...) noexcept
デバッグ出力関数
Definition: LibUtility.cpp:165
LIB_COMMON_API wchar_t const * GetExeFileName(wchar_t *pszBuffer, size_t uSize) noexcept
実行ファイル名取得関数
Definition: LibUtility.cpp:272

呼び出し関係図:

void LibCommon::UtilNotifyDestructor ( wchar_t const *  pszFuncName)
noexcept

デストラクタ実行通知関数

デストラクタ実行通知関数です。

引数
[in]pszFuncName関数名
戻り値
なし
注意
なし

LibUtility.cpp127 行目に定義があります。

参照先 GetExeFileName(), OutputDebugFormat().

127  {
128  // 実行ファイル名を取得する
129  wchar_t szExeFile[ MAX_PATH ];
130  GetExeFileName( szExeFile, MAX_PATH );
131 
132  // カレントプロセスIDを取得する
133  DWORD dwProcessId = ::GetCurrentProcessId();
134 
135  // カレントスレッドIDを取得する
136  DWORD dwThreadId = ::GetCurrentThreadId();
137 
138  // デバッグ出力する
139  OutputDebugFormat( L"▲デストラクタ:[%04X:%04X] %s!%s\n", dwProcessId, dwThreadId, szExeFile, pszFuncName );
140  }
LIB_COMMON_API void OutputDebugFormat(wchar_t const *pszFormat,...) noexcept
デバッグ出力関数
Definition: LibUtility.cpp:165
LIB_COMMON_API wchar_t const * GetExeFileName(wchar_t *pszBuffer, size_t uSize) noexcept
実行ファイル名取得関数
Definition: LibUtility.cpp:272

呼び出し関係図:

int LibCommon::ShowMessage ( wchar_t const *  pszMessage,
HWND  hWnd = nullptr,
UINT  uType = ( MB_OK | MB_ICONEXCLAMATION ) 
)
noexcept

メッセージ表示関数

メッセージ表示関数です。

引数
[in]pszMessageメッセージ文字列
[in]hWndウィンドウハンドル
[in]uTypeメッセージ種別
戻り値
実行結果
注意
なし

LibUtility.cpp144 行目に定義があります。

参照元 LibWindow::CWndMain::ExecMenuCommand().

144  {
145  // 処理ブロック
146  int result = 0;
147  do {
148  // ウィンドウハンドルを調べる
149  wchar_t szCaption[ MAX_PATH ] = L"メッセージ";
150  if ( nullptr != hWnd ) {
151  // ウィンドウタイトルを取得する
152  ::GetWindowTextW( hWnd, szCaption, MAX_PATH );
153  }
154 
155  // メッセージボックスを表示する
156  result = ::MessageBoxW( hWnd, pszMessage, szCaption, uType );
157  } while ( false );
158 
159  // 実行結果を返す
160  return result;
161  }

被呼び出し関係図:

void LibCommon::OutputDebugFormat ( wchar_t const *  pszFormat,
  ... 
)
noexcept

デバッグ出力関数

デバッグ出力関数です。

引数
[in]pszFormat書式設定文字列
[in]...可変長引数リスト
戻り値
なし
注意
なし

LibUtility.cpp165 行目に定義があります。

参照先 ExpandFormatArgs().

参照元 AppTest::CAppTest::CAppTest(), AppTest::CAppTest::Main(), UtilNotifyConstructor(), UtilNotifyDestructor(), UtilNotifyDllMain(), UtilNotifyFatalError(), AppTest::CAppTest::~CAppTest().

165  {
166  // 処理ブロック
167  do {
168  // 書式設定文字列ポインタを調べる
169  if ( nullptr == pszFormat ) {
170  // 失敗!
171  break;
172  }
173 
174  // 引数リストを作成する
175  va_list vaArgs;
176  va_start( vaArgs, pszFormat );
177 
178  // 書式設定文字列を展開する
179  wchar_t szBuffer[ MAX_PATH ];
180  if ( !ExpandFormatArgs( szBuffer, ( MAX_PATH ), pszFormat, vaArgs ) ) {
181  // 失敗!
182  break;
183  }
184 
185  // 引数リストを解放する
186  va_end( vaArgs );
187 
188  // デバッグコンソールに文字列を出力する
189  ::OutputDebugStringW( szBuffer );
190  } while ( false );
191  }
LIB_COMMON_API bool ExpandFormatArgs(wchar_t *pszBuffer, size_t uSize, wchar_t const *pszFormat, va_list vaArgs) noexcept
書式設定文字列展開関数
Definition: LibUtility.cpp:195

呼び出し関係図:

被呼び出し関係図:

bool LibCommon::ExpandFormatArgs ( wchar_t *  pszBuffer,
size_t  uSize,
wchar_t const *  pszFormat,
va_list  vaArgs 
)
noexcept

書式設定文字列展開関数

書式設定文字列展開関数です。

引数
[out]pszBuffer文字列バッファポインタ
[in]uSizeバッファサイズ
[in]pszFormat書式設定文字列
[in]vaArgs引数リスト
戻り値
実行結果
  • true 成功
  • false 失敗
注意
なし

LibUtility.cpp195 行目に定義があります。

参照元 LibCommon::CStreamOut::ExOutputLineArgs(), LibCommon::CStreamOut::OutputArgs(), OutputDebugFormat().

195  {
196  // 処理ブロック
197  bool result = false;
198  do {
199  // 文字列バッファポインタを調べる
200  if ( nullptr == pszBuffer ) {
201  // 失敗!
202  break;
203  }
204  // 書式設定文字列ポインタを調べる
205  else if ( nullptr == pszFormat ) {
206  // 失敗!
207  break;
208  }
209  // 書式設定文字列を展開する
210  else if ( 0 >= ::vswprintf_s( pszBuffer, uSize, pszFormat, vaArgs ) ) {
211  // 失敗!
212  break;
213  }
214 
215  // 成功!
216  result = true;
217  } while ( false );
218 
219  // 実行結果を返す
220  return result;
221  }

被呼び出し関係図:

wchar_t const * LibCommon::GetExeFilePath ( wchar_t *  pszBuffer,
size_t  uSize 
)
noexcept

実行ファイルパス取得関数

実行ファイルパス取得関数です。

引数
[in]pszBuffer文字列バッファポインタ
[in]uSizeバッファサイズ
戻り値
文字列ポインタ
注意
なし

LibUtility.cpp225 行目に定義があります。

参照元 GetExeFileDir(), GetExeFileName(), LibLogOut::CLibLogOut::GetNewLogFilePath().

225  {
226  // 処理ブロック
227  wchar_t const* result = nullptr;
228  do {
229  // 文字列バッファポインタを調べる
230  if ( nullptr == pszBuffer ) {
231  // 失敗!
232  break;
233  }
234 
235  // 実行ファイルパスを取得する
236  ::GetModuleFileNameW( nullptr, pszBuffer, static_cast< DWORD >( uSize ) );
237 
238  // 成功!
239  result = pszBuffer;
240  } while ( false );
241 
242  // 実行結果を返す
243  return result;
244  }

被呼び出し関係図:

wchar_t const * LibCommon::GetExeFileDir ( wchar_t *  pszBuffer,
size_t  uSize 
)
noexcept

実行ファイルディレクトリパス取得関数

実行ファイルディレクトリパス取得関数です。

引数
[in]pszBuffer文字列バッファポインタ
[in]uSizeバッファサイズ
戻り値
文字列ポインタ
注意
なし

LibUtility.cpp248 行目に定義があります。

参照先 GetDirPath(), GetExeFilePath().

248  {
249  // 処理ブロック
250  wchar_t const* result = nullptr;
251  do {
252  // 文字列バッファポインタを調べる
253  if ( nullptr == pszBuffer ) {
254  // 失敗!
255  break;
256  }
257 
258  // 実行ファイルパスを取得する
259  wchar_t szPath[ MAX_PATH ];
260  GetExeFilePath( szPath, MAX_PATH );
261 
262  // ディレクトリパスを取得する
263  result = GetDirPath( pszBuffer, uSize, szPath );
264  } while ( false );
265 
266  // 実行結果を返す
267  return result;
268  }
LIB_COMMON_API wchar_t const * GetDirPath(wchar_t *pszBuffer, size_t uSize, wchar_t const *pszPath) noexcept
ディレクトリパス取得関数
Definition: LibUtility.cpp:296
LIB_COMMON_API wchar_t const * GetExeFilePath(wchar_t *pszBuffer, size_t uSize) noexcept
実行ファイルパス取得関数
Definition: LibUtility.cpp:225

呼び出し関係図:

wchar_t const * LibCommon::GetExeFileName ( wchar_t *  pszBuffer,
size_t  uSize 
)
noexcept

実行ファイル名取得関数

実行ファイル名取得関数です。

引数
[in]pszBuffer文字列バッファポインタ
[in]uSizeバッファサイズ
戻り値
文字列ポインタ
注意
なし

LibUtility.cpp272 行目に定義があります。

参照先 GetExeFilePath(), GetFileName().

参照元 LibLogOut::CLibLogOut::CLibLogOut(), UtilNotifyConstructor(), UtilNotifyDestructor(), UtilNotifyDllMain(), UtilNotifyFatalError().

272  {
273  // 処理ブロック
274  wchar_t const* result = nullptr;
275  do {
276  // 文字列バッファポインタを調べる
277  if ( nullptr == pszBuffer ) {
278  // 失敗!
279  break;
280  }
281 
282  // 実行ファイルパスを取得する
283  wchar_t szPath[ MAX_PATH ];
284  GetExeFilePath( szPath, MAX_PATH );
285 
286  // ファイル名を取得する
287  result = GetFileName( pszBuffer, uSize, szPath );
288  } while ( false );
289 
290  // 実行結果を返す
291  return result;
292  }
LIB_COMMON_API wchar_t const * GetExeFilePath(wchar_t *pszBuffer, size_t uSize) noexcept
実行ファイルパス取得関数
Definition: LibUtility.cpp:225
LIB_COMMON_API wchar_t const * GetFileName(wchar_t *pszBuffer, size_t uSize, wchar_t const *pszPath) noexcept
ファイル名取得関数
Definition: LibUtility.cpp:331

呼び出し関係図:

被呼び出し関係図:

wchar_t const * LibCommon::GetDirPath ( wchar_t *  pszBuffer,
size_t  uSize,
wchar_t const *  pszPath 
)
noexcept

ディレクトリパス取得関数

ディレクトリパス取得関数です。

引数
[in]pszBuffer文字列バッファポインタ
[in]uSizeバッファサイズ
[in]pszPathファイルパス
戻り値
文字列ポインタ
注意
なし

LibUtility.cpp296 行目に定義があります。

参照元 GetExeFileDir().

296  {
297  // 処理ブロック
298  wchar_t const* result = nullptr;
299  do {
300  // 文字列バッファポインタを調べる
301  if ( nullptr == pszBuffer ) {
302  // 失敗!
303  break;
304  }
305  // ファイルパス文字列ポインタを調べる
306  else if ( nullptr == pszPath ) {
307  // 失敗!
308  break;
309  }
310 
311  // ファイルパスを分解する
312  wchar_t szDrive[ _MAX_DRIVE ];
313  wchar_t szDir [ _MAX_DIR ];
314  wchar_t szFName[ _MAX_FNAME ];
315  wchar_t szExt [ _MAX_EXT ];
316  ::_wsplitpath_s( pszPath, szDrive, szDir, szFName, szExt );
317 
318  // ディレクトリパスを取得する
319  ::swprintf_s( pszBuffer, uSize, L"%s%s", szDrive, szDir );
320 
321  // 成功!
322  result = pszBuffer;
323  } while ( false );
324 
325  // 実行結果を返す
326  return result;
327  }

被呼び出し関係図:

wchar_t const * LibCommon::GetFileName ( wchar_t *  pszBuffer,
size_t  uSize,
wchar_t const *  pszPath 
)
noexcept

ファイル名取得関数

ファイル名取得関数です。

引数
[in]pszBuffer文字列バッファポインタ
[in]uSizeバッファサイズ
[in]pszPathファイルパス
戻り値
文字列ポインタ
注意
なし

LibUtility.cpp331 行目に定義があります。

参照元 GetExeFileName(), UtilNotifyFatalError().

331  {
332  // 処理ブロック
333  wchar_t const* result = nullptr;
334  do {
335  // 文字列バッファポインタを調べる
336  if ( nullptr == pszBuffer ) {
337  // 失敗!
338  break;
339  }
340  // ファイルパス文字列ポインタを調べる
341  else if ( nullptr == pszPath ) {
342  // 失敗!
343  break;
344  }
345 
346  // ファイルパスを分解する
347  wchar_t szDrive[ _MAX_DRIVE ];
348  wchar_t szDir [ _MAX_DIR ];
349  wchar_t szFName[ _MAX_FNAME ];
350  wchar_t szExt [ _MAX_EXT ];
351  ::_wsplitpath_s( pszPath, szDrive, szDir, szFName, szExt );
352 
353  // ファイル名を取得する
354  ::swprintf_s( pszBuffer, uSize, L"%s%s", szFName, szExt );
355 
356  // 成功!
357  result = pszBuffer;
358  } while ( false );
359 
360  // 実行結果を返す
361  return result;
362  }

被呼び出し関係図:

wchar_t const * LibCommon::GetModuleName ( HINSTANCE  hInstance,
wchar_t *  pszBuffer = nullptr,
size_t  uSize = 0 
)
noexcept

モジュール名取得関数

モジュール名取得関数です。

引数
[in]hInstanceインスタンスハンドル
[in]pszBuffer文字列バッファポインタ
[in]uSizeバッファサイズ
戻り値
文字列ポインタ
注意
なし

LibUtility.cpp366 行目に定義があります。

参照元 AppTest::CAppTest::Main(), AppTest::CAppTestMenuConsole::ShowProjectInfo().

366  {
367  // 処理ブロック
368  wchar_t const* result = nullptr;
369  do {
370  // モジュール名を取得する
371  static wchar_t szPath[ MAX_PATH ];
372  ::GetModuleFileNameW( hInstance, szPath, MAX_PATH );
373 
374  // 文字列ポインタを取得する
375  result = szPath;
376 
377  // 文字列バッファポインタを調べる
378  if ( nullptr != pszBuffer ) {
379  // 文字列をコピーする
380  ::wcscpy_s( pszBuffer, uSize, szPath );
381 
382  // 文字列ポインタを取得する
383  result = pszBuffer;
384  }
385  } while ( false );
386 
387  // 実行結果を返す
388  return result;
389  }

被呼び出し関係図:

bool LibCommon::CompareCharCode ( wchar_t  ch1,
wchar_t  ch2,
bool  bIgnore 
)
noexcept

文字コード比較関数

文字コード比較関数です。

引数
[in]ch1比較元文字コード
[in]ch2比較先文字コード
[in]bIgnore最小文字無視フラグ
戻り値
比較結果
  • true 一致
  • false 不一致
注意
なし

LibUtility.cpp393 行目に定義があります。

参照元 CompareCharCode(), LibCommon::CStream::SkipChar().

393  {
394  // 処理ブロック
395  bool result = false;
396  do {
397  // 大小文字無視フラグを調べる
398  if ( bIgnore ) {
399  // 小文字に変換する
400  ch1 = ::towlower( ch1 );
401  ch2 = ::towlower( ch2 );
402  }
403 
404  // 文字コードを比較する
405  if ( ch1 != ch2 ) {
406  // 失敗!
407  break;
408  }
409 
410  // 成功!
411  result = true;
412  } while ( false );
413 
414  // 実行結果を返す
415  return result;
416  }

被呼び出し関係図:

bool LibCommon::CompareCharCode ( wchar_t  ch,
wchar_t const *  pszString,
bool  bIgnore 
)
noexcept

文字コード比較関数

文字コード比較関数です。

引数
[in]ch比較元文字コード
[in]pszString比較先文字列ポインタ
[in]bIgnore最小文字無視フラグ
戻り値
比較結果
  • true 一致
  • false 不一致
注意
なし

LibUtility.cpp420 行目に定義があります。

参照先 CompareCharCode().

420  {
421  // 処理ブロック
422  bool result = false;
423  do {
424  // 比較先文字列ポインタを調べる
425  if ( nullptr == pszString ) {
426  // 失敗!
427  break;
428  }
429  // 巡回する
430  else for ( ;; ) {
431  // 比較先文字コードを取得する
432  wchar_t ch2 = *pszString++;
433  if ( L'\0' == ch2 ) {
434  // 失敗!
435  break;
436  }
437  // 文字コードを比較する
438  else if ( CompareCharCode( ch, ch2, bIgnore ) ) {
439  // 成功!
440  result = true;
441  break;
442  }
443  }
444  } while ( false );
445 
446  // 実行結果を返す
447  return result;
448  }
LIB_COMMON_API bool CompareCharCode(wchar_t ch1, wchar_t ch2, bool bIgnore) noexcept
文字コード比較関数
Definition: LibUtility.cpp:393

呼び出し関係図:

bool LibCommon::SetWindowPosition ( HWND  hWnd,
EWindowPosition  ePos 
)
noexcept

ウィンドウ表示位置設定関数

ウィンドウ表示位置設定関数です。

引数
[in]hWndウィンドウハンドル
[in]ePosウィンドウ表示位置種別
戻り値
実行結果
  • true 成功
  • false 失敗
注意
なし

LibUtility.cpp452 行目に定義があります。

参照先 Bottom, Full, Left, Right, Top.

参照元 LibWindow::CWndMain::ExecMenuCommand(), AppTest::CAppTest::ResumeConfigConsole(), AppTest::CAppTest::ResumeConfigWindow(), LibCommon::CConsole::SubThreadProc().

452  {
453  // 処理ブロック
454  bool result = false;
455  do {
456  // ウィンドウ表示位置のモニタハンドルを取得する
457  HMONITOR hMonitor = ::MonitorFromWindow( hWnd, MONITOR_DEFAULTTONEAREST );
458  if ( nullptr == hMonitor ) {
459  // 失敗!
460  break;
461  }
462 
463  // モニタ作業領域サイズを取得する
464  MONITORINFO sMonitorInfo = { sizeof( MONITORINFO ) };
465  if ( 0 == ::GetMonitorInfo( hMonitor, &sMonitorInfo ) ) {
466  // 失敗!
467  break;
468  }
469 
470  // モニタ作業領域サイズを取得する
471  int nWidth = ( sMonitorInfo.rcWork.right - sMonitorInfo.rcWork.left );
472  int nHeight = ( sMonitorInfo.rcWork.bottom - sMonitorInfo.rcWork.top );
473 
474  // 表示位置種別を調べる
475  int nLeft = sMonitorInfo.rcWork.left;
476  int nTop = sMonitorInfo.rcWork.top;
477  bool bFailure = false;
478  switch ( ePos ) {
479  case EWindowPosition::Left: nWidth /= 2; break; // 左端
480  case EWindowPosition::Top: nHeight /= 2; break; // 上端
481  case EWindowPosition::Right: nWidth /= 2; nLeft += nWidth; break; // 右端
482  case EWindowPosition::Bottom: nHeight /= 2; nTop += nHeight; break; // 下端
483  case EWindowPosition::Full: break; // フルサイズ
484  default: bFailure = true; break; // 失敗!
485  }
486 
487  // 失敗フラグを調べる
488  if ( bFailure ) {
489  // 失敗!
490  break;
491  }
492 
493  // ウィンドウ表示領域を設定する
494  ::SetWindowPos( hWnd, HWND_TOP, nLeft, nTop, nWidth, nHeight, ( SWP_NOACTIVATE | SWP_SHOWWINDOW ) );
495  ::UpdateWindow( hWnd );
496 
497  // 成功!
498  result = true;
499  } while ( false );
500 
501  // 実行結果を返す
502  return result;
503  }

被呼び出し関係図:

DWORD LibCommon::SearchProcess ( wchar_t const *  pszPath)

プロセス検索関数

プロセス検索関数です。

引数
[in]pszPathプロセス実行ファイルパス
戻り値
プロセス識別子
注意
なし

LibUtility.cpp507 行目に定義があります。

507  {
508  // 処理ブロック
509  DWORD result = 0;
510  do {
511  // プロセススナップショットを作成する
512  HANDLE hSnapProcess = ::CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
513  if ( nullptr == hSnapProcess ) {
514  // 失敗!
515  break;
516  }
517 
518  // プロセス情報を巡回する
519  PROCESSENTRY32W sProcessEntry = { sizeof( PROCESSENTRY32 ) };
520  bool bResult = ( 0 != ::Process32FirstW( hSnapProcess, &sProcessEntry ) );
521  for ( ; !result && bResult; bResult = ( 0 != ::Process32NextW( hSnapProcess, &sProcessEntry ) ) ) {
522  // モジュールスナップショットを作成する
523  HANDLE hSnapModule = ::CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, sProcessEntry.th32ProcessID );
524  if ( nullptr == hSnapModule ) {
525  // 失敗!
526  break;
527  }
528 
529  // モジュール情報を巡回する
530  MODULEENTRY32W sModuleEntry = { sizeof( MODULEENTRY32 ) };
531  bool bResult = ( 0 != ::Module32FirstW( hSnapModule, &sModuleEntry ) );
532  for ( ; bResult; bResult = ( 0 != ::Module32NextW( hSnapModule, &sModuleEntry ) ) ) {
533  // プロセス実行ファイルパスを調べる
534  if ( 0 == ::_wcsicmp( pszPath, sModuleEntry.szExePath ) ) {
535  // 成功!
536  result = sProcessEntry.th32ProcessID;
537  break;
538  }
539  }
540  }
541  } while ( false );
542 
543  // 実行結果を返す
544  return result;
545  }

変数詳解

template class LIB_COMMON_API LibCommon::CArray< int >

CArray.cpp29 行目に定義があります。

template class LIB_COMMON_API LibCommon::CArray< wchar_t >

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