Solution46
CConsole.h
[詳解]
1 //=============================================================================
2 /// @file
3 /// コンソール入出力クラスヘッダコンソール
4 ///
5 /// コンソール入出力クラスヘッダコンソールです。
6 ///
7 /// $Id: CConsole.h 245 2019-03-20 15:03:41Z admin $
8 /// $Date: 2019-03-21 00:03:41 +0900 (2019/03/21 (木)) $
9 /// $Author: admin $
10 ///
11 /// @attention なし
12 
13 #pragma once
14 #pragma managed( push, off )
15 
16 //=============================================================================
17 // インクルードファイル
18 #include <CStream.h>
19 #include <CMutex.h>
20 #include <CEvent.h>
21 #include <CThread.h>
22 
23 //=============================================================================
24 // マクロ定義
25 #define ConsoleInstance() LibCommon::CConsole::GetInstance() ///< インスタンス取得マクロ
26 #define ConsoleChar(...) ConsoleInstance().OutputChar(__VA_ARGS__) ///< 1文字出力マクロ
27 #define ConsoleString(...) ConsoleInstance().OutputString(__VA_ARGS__) ///< 文字列出力マクロ
28 #define ConsoleFormat(...) ConsoleInstance().OutputFormat(__VA_ARGS__) ///< 書式設定文字列出力マクロ
29 #define ConsoleNewLine() ConsoleInstance().OutputNewLine() ///< 改行出力マクロ
30 #define ConsoleLineString(...) ConsoleInstance().OutputLineString(__VA_ARGS__) ///< 文字列行出力マクロ
31 #define ConsoleLineFormat(...) ConsoleInstance().OutputLineFormat(__VA_ARGS__) ///< 書式設定文字列行出力マクロ
32 #define ConsoleExLineFormat(...) ConsoleInstance().ExOutputLineFormat(__VA_ARGS__) ///< 拡張書式設定文字列行出力マクロ
33 #define ConsoleNoIndent(...) ConsoleInstance().ExOutputLineFormat(true,false,__VA_ARGS__) ///< インデントなし書式設定文字列行出力マクロ
34 #define ConsoleLine(...) ConsoleInstance().ExOutputLineFormat(false,false,__VA_ARGS__) ///< ヘッダインデントなし書式設定文字列行出力マクロ
35 #define ConsoleFunction() ConsoleLineFormat(L"%s()",__FUNCTIONW__) ///< 関数マクロ
36 #define ConsoleIndent() ConsoleInstance().Indent() ///< インデントマクロ
37 #define ConsoleUnindent() ConsoleInstance().Unindent() ///< アンインデントマクロ
38 #define ConsoleBlockIn(...) ConsoleLineFormat(__VA_ARGS__);ConsoleIndent() ///< ブロック開始マクロ
39 #define ConsoleBlockOut(...) ConsoleUnindent();ConsoleLineFormat(__VA_ARGS__) ///< ブロック終了マクロ
40 #define ConsoleHeader() ConsoleBlockIn (L"%s() {", __FUNCTIONW__) ///< 関数ヘッダマクロ
41 #define ConsoleFooter() ConsoleBlockOut(L"} // %s()",__FUNCTIONW__) ///< 関数フッタマクロ
42 #define ConsoleInputHandle() ConsoleInstance().GetInputHandle() ///< 入力ハンドル取得マクロ
43 #define ConsoleOutputHandle() ConsoleInstance().GetOutputHandle() ///< 出力ハンドル取得マクロ
44 #define ConsoleWindowHandle() ConsoleInstance().GetWindowHandle() ///< ウィンドウハンドル取得マクロ
45 #define ConsoleGetFontSize(...) ConsoleInstance().GetFontSize(__VA_ARGS__) ///< フォントサイズ取得マクロ
46 #define ConsoleGetBufferSize(...) ConsoleInstance().GetSize(__VA_ARGS__) ///< 出力バッファサイズ取得マクロ
47 #define ConsoleBufferSize(...) ConsoleInstance().SetBufferSize(__VA_ARGS__) ///< 出力バッファサイズ設定マクロ
48 #define ConsoleGetBufferPosition(...) ConsoleInstance().GetBufferPosition(__VA_ARGS__) ///< 出力バッファ表示位置取得マクロ
49 #define ConsoleSetBufferPosition(...) ConsoleInstance().SetBufferPosition(__VA_ARGS__) ///< 出力バッファ表示位置設定マクロ
50 #define ConsoleGetBufferArea(...) ConsoleInstance().GetBufferArea(__VA_ARGS__) ///< 出力バッファ表示領域取得マクロ
51 #define ConsoleSetBufferArea(...) ConsoleInstance().SetBufferArea(__VA_ARGS__) ///< 出力バッファ表示領域設定マクロ
52 #define ConsoleGetWindowArea(...) ConsoleInstance().GetWindowArea(__VA_ARGS__) ///< ウィンドウ表示領域取得マクロ
53 #define ConsoleSetWindowArea(...) ConsoleInstance().SetWindowArea(__VA_ARGS__) ///< ウィンドウ表示領域設定マクロ
54 #define ConsoleGetCursorPosition(...) ConsoleInstance().GetCursorPosition(__VA_ARGS__) ///< カーソル位置取得マクロ
55 #define ConsoleSetCursorPosition(...) ConsoleInstance().SetCursorPosition(__VA_ARGS__) ///< カーソル位置設定マクロ
56 #define ConsoleGetCursor(...) ConsoleInstance().GetCursor(__VA_ARGS__) ///< カーソル位置取得マクロ
57 #define ConsoleSetCursor(...) ConsoleInstance().SetCursor(__VA_ARGS__) ///< カーソル位置設定マクロ
58 #define ConsoleScroll(...) ConsoleInstance().ScrollWindow(__VA_ARGS__) ///< スクロールマクロ
59 #define ConsoleInputCount() ConsoleInstance().GetInputCount() ///< 入力レコード数取得マクロ
60 #define ConsoleInputChar(...) ConsoleInstance().InputChar(__VA_ARGS__) ///< 1文字入力マクロ
61 #define ConsoleInput(...) ConsoleInstance().InputString(__VA_ARGS__) ///< 文字列入力マクロ
62 #define ConsoleInputDirect(...) ConsoleInstance().InputDirect(__VA_ARGS__) ///< 直接文字入力マクロ
63 #define ConsoleKbHitDirect() ConsoleInstance().KbHitDirect() ///< 直接入力検査マクロ
64 #define ConsoleClearInput() ConsoleInstance().ClearInputBuffer() ///< 入力バッファクリアマクロ
65 #define ConsoleHitKey(...) ConsoleInstance().HitAnyKey(__VA_ARGS__) ///< キー入力待ちマクロ
66 #define ConsoleYesNo(...) ConsoleInstance().YesNoKey(__VA_ARGS__) ///< 確認入力待ちマクロ
67 #define ConsoleStopInput() ConsoleInstance().StopInput() ///< 入力中止要求マクロ
68 
69 //=============================================================================
70 // 共通ライブラリ名前空間
71 namespace LibCommon {
72  //=========================================================================
73  /// コンソール入出力クラス
74  ///
75  /// コンソール入出力クラスです。
76  ///
77  /// @attention シングルトンクラスです。
78  ///
79  class LIB_COMMON_API CConsole final: public CMutex, public CStream {
80  //=====================================================================
81  // 公開型定義
82  //---------------------------------------------------------------------
83  /// 入力レコード構造体
84  ///
85  /// 入力レコード構造体です。
86  ///
87  /// @attention なし
88  ///
89  struct SInputRecord {
90  INPUT_RECORD m_sEvent; ///< 入力イベント構造体
91  bool m_bShift; ///< シフトキー押下状態フラグ
92  bool m_bControl; ///< コントロールキー押下状態フラグ
93  bool m_bMenu; ///< オルトキー押下状態フラグ
94  };
95 
96  //=====================================================================
97  // 構築子と解体子
98  public:
99  //---------------------------------------------------------------------
100  /// コンストラクタ
101  ///
102  /// コンストラクタです。
103  ///
104  /// @param なし
105  /// @return なし
106  /// @attention なし
107  ///
108  explicit CConsole() noexcept;
109 
110  //---------------------------------------------------------------------
111  /// デストラクタ
112  ///
113  /// デストラクタです。
114  ///
115  /// @param なし
116  /// @return なし
117  /// @attention なし
118  ///
119  virtual ~CConsole() noexcept;
120 
121  //=====================================================================
122  // インライン公開関数
123  public:
124  //---------------------------------------------------------------------
125  /// 入力レコード数取得関数
126  ///
127  /// 入力レコード数取得関数です。
128  ///
129  /// @param なし
130  /// @return 入力レコード数
131  /// @attention なし
132  ///
133  inline virtual int GetInputCount() const noexcept { return m_nRecordCount; }
134 
135  //---------------------------------------------------------------------
136  /// 入力中止要求関数
137  ///
138  /// 入力中止要求関数です。
139  ///
140  /// @param なし
141  /// @return 入力レコード数
142  /// @attention なし
143  ///
144  inline virtual void StopInput() noexcept { m_bStopInput = true; }
145 
146  //=====================================================================
147  // 公開関数
148  public:
149  //---------------------------------------------------------------------
150  /// 文字列出力関数
151  ///
152  /// 文字列出力関数です。
153  ///
154  /// @param[in] pszString 文字列ポインタ
155  /// @return 実行結果
156  /// - true 成功
157  /// - false 失敗
158  /// @attention オーバーライド関数です。
159  ///
160  virtual bool OutputString( wchar_t const* pszString ) noexcept override;
161 
162  //---------------------------------------------------------------------
163  /// 1文字入力関数
164  ///
165  /// 1文字入力関数です。
166  ///
167  /// @param[out] rCh 文字コード参照
168  /// @return 実行結果
169  /// - true 成功
170  /// - false 失敗
171  /// @attention オーバーライド関数です。
172  ///
173  virtual bool InputChar( wchar_t& rCh ) noexcept override { return InputChar( rCh, INFINITE ); }
174 
175  //---------------------------------------------------------------------
176  /// 文字列入力関数
177  ///
178  /// 文字列入力関数です。
179  ///
180  /// @param[in] pszBuffer 文字列バッファポインタ
181  /// @param[in] nSize バッファサイズ
182  /// @return 入力文字数
183  /// @attention オーバーライド関数です。
184  ///
185  virtual int InputString( wchar_t* pszBuffer, int nSize ) noexcept override { return InputString( pszBuffer, nSize, INFINITE ); }
186 
187  //---------------------------------------------------------------------
188  /// 1文字入力関数
189  ///
190  /// 1文字入力関数です。
191  ///
192  /// @param[out] rCh 文字コード参照
193  /// @param[in] dwTime 待機時間
194  /// @return 実行結果
195  /// - true 成功
196  /// - false 失敗
197  /// @attention なし
198  ///
199  virtual bool InputChar( wchar_t& rCh, DWORD dwTime ) noexcept;
200 
201  //---------------------------------------------------------------------
202  /// 文字列入力関数
203  ///
204  /// 文字列入力関数です。
205  ///
206  /// @param[in] pszBuffer 文字列バッファポインタ
207  /// @param[in] nSize バッファサイズ
208  /// @param[in] dwTime 待機時間
209  /// @return 入力文字数
210  /// @attention なし
211  ///
212  virtual int InputString( wchar_t* pszBuffer, int nSize, DWORD dwTime ) noexcept { return InputString( pszBuffer, nSize, nullptr, dwTime ); }
213 
214  //---------------------------------------------------------------------
215  /// 文字列入力関数
216  ///
217  /// 文字列入力関数です。
218  ///
219  /// @param[in] pszBuffer 文字列バッファポインタ
220  /// @param[in] nSize バッファサイズ
221  /// @param[in] pszString 文字列ポインタ
222  /// @param[in] dwTime 待機時間
223  /// @return 入力文字数
224  /// @attention なし
225  ///
226  virtual int InputString( wchar_t* pszBuffer, int nSize, wchar_t const* pszString, DWORD dwTime = INFINITE ) noexcept;
227 
228  //---------------------------------------------------------------------
229  /// 入力バッファクリア関数
230  ///
231  /// 入力バッファクリア関数です。
232  ///
233  /// @param なし
234  /// @return なし
235  /// @attention なし
236  ///
237  virtual void ClearInputBuffer() noexcept;
238 
239  //---------------------------------------------------------------------
240  /// 入力レコード取得関数
241  ///
242  /// 入力レコード取得関数です。
243  ///
244  /// @param[out] rsRecord 入力レコード参照
245  /// @param[in] dwTime 待機時間
246  /// @return 実行結果
247  /// - true 成功
248  /// - false 失敗
249  /// @attention なし
250  ///
251  virtual bool InputRecord( SInputRecord& rsRecord, DWORD dwTime ) noexcept;
252 
253  //---------------------------------------------------------------------
254  /// キー入力待ち関数
255  ///
256  /// キー入力待ち関数です。
257  ///
258  /// @param[in] pszString 文字列ポインタ
259  /// @param[in] dwTime 待機時間
260  /// @return 実行結果
261  /// - 0以上 文字コード
262  /// - 0未満 タイムアウト
263  /// @attention なし
264  ///
265  virtual int HitAnyKey( wchar_t const* pszString = nullptr, DWORD dwTime = INFINITE ) noexcept;
266 
267  //---------------------------------------------------------------------
268  /// 確認入力待ち関数
269  ///
270  /// 確認入力待ち関数です。
271  ///
272  /// @param[in] pszString 文字列ポインタ
273  /// @param[in] dwTime 待機時間
274  /// @return 実行結果
275  /// - true 成功
276  /// - false 失敗
277  /// @attention なし
278  ///
279  virtual bool YesNoKey( wchar_t const* pszString = nullptr, DWORD dwTime = INFINITE ) noexcept;
280 
281  //=====================================================================
282  // インライン静的公開関数
283  public:
284  //---------------------------------------------------------------------
285  /// インスタンス取得関数
286  ///
287  /// インスタンス取得関数です。
288  ///
289  /// @param なし
290  /// @return インスタンス参照
291  /// @attention なし
292  ///
293  inline static CConsole& GetInstance() noexcept { return s_cInstance; }
294 
295  //---------------------------------------------------------------------
296  /// 入力ハンドル取得関数
297  ///
298  /// 入力ハンドル取得関数です。
299  ///
300  /// @param なし
301  /// @return コンソール入力ハンドル
302  /// @attention なし
303  ///
304  inline static HANDLE GetInputHandle() noexcept { return ::GetStdHandle( STD_INPUT_HANDLE ); }
305 
306  //---------------------------------------------------------------------
307  /// 出力ハンドル取得関数
308  ///
309  /// 出力ハンドル取得関数です。
310  ///
311  /// @param なし
312  /// @return コンソール出力ハンドル
313  /// @attention なし
314  ///
315  inline static HANDLE GetOutputHandle() noexcept { return ::GetStdHandle( STD_OUTPUT_HANDLE ); }
316 
317  //---------------------------------------------------------------------
318  /// ウィンドウハンドル取得関数
319  ///
320  /// ウィンドウハンドル取得関数です。
321  ///
322  /// @param なし
323  /// @return ウィンドウハンドル
324  /// @attention なし
325  ///
326  inline static HWND GetWindowHandle() noexcept { return ::GetConsoleWindow(); }
327 
328  //=====================================================================
329  // 静的公開関数
330  public:
331  //---------------------------------------------------------------------
332  /// フォントサイズ取得関数
333  ///
334  /// フォントサイズ取得関数です。
335  ///
336  /// @param[out] rnWidth 水平サイズ参照
337  /// @param[out] rnHeight 垂直サイズ参照
338  /// @return 実行結果
339  /// - true 成功
340  /// - false 失敗
341  /// @attention なし
342  ///
343  static bool GetFontSize( int& rnWidth, int& rnHeight ) noexcept;
344 
345  //---------------------------------------------------------------------
346  /// 出力バッファサイズ取得関数
347  ///
348  /// 出力バッファサイズ取得関数です。
349  ///
350  /// @param[out] rnWidth 水平サイズ参照
351  /// @param[out] rnHeight 垂直サイズ参照
352  /// @return 実行結果
353  /// - true 成功
354  /// - false 失敗
355  /// @attention なし
356  ///
357  static bool GetSize( int& rnWidth, int& rnHeight ) noexcept;
358 
359  //---------------------------------------------------------------------
360  /// 出力バッファサイズ設定関数
361  ///
362  /// 出力バッファサイズ設定関数です。
363  ///
364  /// @param[in] nWidth 水平サイズ
365  /// @param[in] nHeight 垂直サイズ
366  /// @return 実行結果
367  /// - true 成功
368  /// - false 失敗
369  /// @attention なし
370  ///
371  static bool SetBufferSize( int nWidth, int nHeight ) noexcept;
372 
373  //---------------------------------------------------------------------
374  /// 出力バッファ表示位置取得関数
375  ///
376  /// 出力バッファ表示位置取得関数です。
377  ///
378  /// @param[out] rnLeft 左位置参照
379  /// @param[out] rnTop 上位置参照
380  /// @return 実行結果
381  /// - true 成功
382  /// - false 失敗
383  /// @attention なし
384  ///
385  static bool GetBufferPosition( int& rnLeft, int& rnTop ) noexcept;
386 
387  //---------------------------------------------------------------------
388  /// 出力バッファ表示位置設定関数
389  ///
390  /// 出力バッファ表示位置設定関数です。
391  ///
392  /// @param[in] nLeft 左位置
393  /// @param[in] nTop 上位置
394  /// @return 実行結果
395  /// - true 成功
396  /// - false 失敗
397  /// @attention なし
398  ///
399  static bool SetBufferPosition( int nLeft, int nTop ) noexcept;
400 
401  //---------------------------------------------------------------------
402  /// 出力バッファ表示領域取得関数
403  ///
404  /// 出力バッファ表示領域取得関数です。
405  ///
406  /// @param[out] rnLeft 左位置参照
407  /// @param[out] rnTop 上位置参照
408  /// @param[out] rnWidth 水平サイズ参照
409  /// @param[out] rnHeight 垂直サイズ参照
410  /// @return 実行結果
411  /// - true 成功
412  /// - false 失敗
413  /// @attention なし
414  ///
415  static bool GetBufferArea( int& rnLeft, int& rnTop, int& rnWidth, int& rnHeight ) noexcept;
416 
417  //---------------------------------------------------------------------
418  /// 出力バッファ表示領域設定関数
419  ///
420  /// 出力バッファ表示領域設定関数です。
421  ///
422  /// @param[in] nLeft 左位置
423  /// @param[in] nTop 上位置
424  /// @param[in] nWidth 水平サイズ
425  /// @param[in] nHeight 垂直サイズ
426  /// @return 実行結果
427  /// - true 成功
428  /// - false 失敗
429  /// @attention なし
430  ///
431  static bool SetBufferArea( int nLeft, int nTop, int nWidth, int nHeight ) noexcept;
432 
433  //---------------------------------------------------------------------
434  /// ウィンドウ表示領域取得関数
435  ///
436  /// ウィンドウ表示領域取得関数です。
437  ///
438  /// @param[out] rnLeft 左座標参照
439  /// @param[out] rnTop 上座標参照
440  /// @param[out] rnWidth 水平サイズ参照
441  /// @param[out] rnHeight 垂直サイズ参照
442  /// @return 実行結果
443  /// - true 成功
444  /// - false 失敗
445  /// @attention なし
446  ///
447  static bool GetWindowArea( int& rnLeft, int& rnTop, int& rnWidth, int& rnHeight ) noexcept;
448 
449  //---------------------------------------------------------------------
450  /// ウィンドウ表示領域設定関数
451  ///
452  /// ウィンドウ表示領域設定関数です。
453  ///
454  /// @param[in] nLeft 左座標
455  /// @param[in] nTop 上座標
456  /// @param[in] nWidth 水平サイズ
457  /// @param[in] nHeight 垂直サイズ
458  /// @return 実行結果
459  /// - true 成功
460  /// - false 失敗
461  /// @attention なし
462  ///
463  static bool SetWindowArea( int nLeft, int nTop, int nWidth, int nHeight ) noexcept;
464 
465  //---------------------------------------------------------------------
466  /// カーソル位置取得関数
467  ///
468  /// カーソル位置取得関数です。
469  ///
470  /// @param[out] rnX 水平位置参照
471  /// @param[out] rnY 垂直位置参照
472  /// @return 実行結果
473  /// - true 成功
474  /// - false 失敗
475  /// @attention なし
476  ///
477  static bool GetCursorPosition( int& rnX, int& rnY ) noexcept;
478 
479  //---------------------------------------------------------------------
480  /// カーソル位置設定関数
481  ///
482  /// カーソル位置設定関数です。
483  ///
484  /// @param[in] nX 水平位置
485  /// @param[in] nY 垂直位置
486  /// @return 実行結果
487  /// - true 成功
488  /// - false 失敗
489  /// @attention なし
490  ///
491  static bool SetCursorPosition( int nX, int nY ) noexcept;
492 
493  //---------------------------------------------------------------------
494  /// カーソル位置取得関数
495  ///
496  /// カーソル位置取得関数です。
497  ///
498  /// @param[out] rsCursor カーソル位置構造体参照
499  /// @return 実行結果
500  /// - true 成功
501  /// - false 失敗
502  /// @attention なし
503  ///
504  static bool GetCursor( COORD& rsCursor ) noexcept;
505 
506  //---------------------------------------------------------------------
507  /// カーソル位置設定関数
508  ///
509  /// カーソル位置設定関数です。
510  ///
511  /// @param[in] rsCursor カーソル位置構造体参照
512  /// @return 実行結果
513  /// - true 成功
514  /// - false 失敗
515  /// @attention なし
516  ///
517  static bool SetCursor( COORD const& rsCursor ) noexcept;
518 
519  //---------------------------------------------------------------------
520  /// ウィンドウスクロール関数
521  ///
522  /// ウィンドウスクロール関数です。
523  ///
524  /// @param[in] nX 水平スクロール量
525  /// @param[in] nY 垂直スクロール量
526  /// @return 実行結果
527  /// - true 成功
528  /// - false 失敗
529  /// @attention なし
530  ///
531  static bool ScrollWindow( int nX, int nY ) noexcept;
532 
533  //---------------------------------------------------------------------
534  /// コンソール入力バッファ直接入力関数
535  ///
536  /// コンソール入力バッファ直接入力関数です。
537  ///
538  /// @param[out] rCh 文字コード参照
539  /// @return 実行結果
540  /// - true 成功
541  /// - false 失敗
542  /// @attention なし
543  ///
544  static bool InputDirect( wchar_t& rCh ) noexcept;
545 
546  //---------------------------------------------------------------------
547  /// コンソール入力バッファ直接検査関数
548  ///
549  /// コンソール入力バッファ直接検査関数です。
550  ///
551  /// @param なし
552  /// @return 実行結果
553  /// - true 入力あり
554  /// - false 入力なし
555  /// @attention なし
556  ///
557  static bool KbHitDirect() noexcept;
558 
559  //=====================================================================
560  // 静的限定公開関数
561  protected:
562  //---------------------------------------------------------------------
563  /// サブスレッド関数
564  ///
565  /// サブスレッド関数です。
566  ///
567  /// @param[in] lpParam 引数ポインタ
568  /// @return 終了コード
569  /// @attention なし
570  ///
571  static DWORD WINAPI SubThreadProc( LPVOID lpParam ) noexcept;
572 
573  //=====================================================================
574  // 静的限定公開定数
575  protected:
576  static int const BUFFER_SIZE = ( 512 - 1 ); ///< 文字列バッファサイズ
577  static int const RECORD_SIZE = 512; ///< 入力レコードリングバッファサイズ
578  static int const KBHIT_RECORD_SIZE = 32; ///< 直接入力検査レコードバッファサイズ
579 
580  //=====================================================================
581  // 限定公開変数
582  protected:
583  wchar_t m_szBuffer[ BUFFER_SIZE + 1 ]; ///< 文字列バッファ
584  SInputRecord m_sRecordBuffer[ RECORD_SIZE ]; ///< 入力レコードリングバッファ
585  int m_nRecordPos; ///< 入力レコード先頭位置
586  int m_nRecordCount; ///< 入力レコードカウント
587  COORD m_sMaxCursor; ///< 最大カーソル位置
588  CThread m_cThreadSub; ///< サブスレッド
589  bool m_bStopInput; ///< 入力中止要求フラグ
590 
591  //=====================================================================
592  // 静的限定公開変数
593  protected:
594  static CConsole s_cInstance; ///< 静的インスタンス
595 
596  //=====================================================================
597  // 削除関数
598  private:
599  CConsole( CConsole const& ) = delete;
600  CConsole& operator=( CConsole const& ) = delete;
601  };
602 }
603 
604 #pragma managed( pop )
COORD m_sMaxCursor
最大カーソル位置
Definition: CConsole.h:587
INPUT_RECORD m_sEvent
入力イベント構造体
Definition: CConsole.h:90
bool m_bMenu
オルトキー押下状態フラグ
Definition: CConsole.h:93
スレッドクラスヘッダファイル
static HANDLE GetOutputHandle() noexcept
出力ハンドル取得関数
Definition: CConsole.h:315
CThread m_cThreadSub
サブスレッド
Definition: CConsole.h:588
static HWND GetWindowHandle() noexcept
ウィンドウハンドル取得関数
Definition: CConsole.h:326
static CConsole & GetInstance() noexcept
インスタンス取得関数
Definition: CConsole.h:293
入力レコード構造体
Definition: CConsole.h:89
共通ライブラリ名前空間
Definition: CArray.h:23
static CConsole s_cInstance
静的インスタンス
Definition: CConsole.h:594
ミューテックスクラス
Definition: CMutex.h:30
ストリームクラス
Definition: CStream.h:31
ミューテックスクラスヘッダファイル
int m_nRecordPos
入力レコード先頭位置
Definition: CConsole.h:585
コンソール入出力クラス
Definition: CConsole.h:79
スレッドクラス
Definition: CThread.h:30
ストリームクラスヘッダファイル
int m_nRecordCount
入力レコードカウント
Definition: CConsole.h:586
virtual void StopInput() noexcept
入力中止要求関数
Definition: CConsole.h:144
イベントクラスヘッダファイル
#define LIB_COMMON_API
ダイナミックライブラリインポート宣言
Definition: LibCommonDef.h:44
bool m_bControl
コントロールキー押下状態フラグ
Definition: CConsole.h:92
virtual bool InputChar(wchar_t &rCh) noexcept override
1文字入力関数
Definition: CConsole.h:173
bool m_bShift
シフトキー押下状態フラグ
Definition: CConsole.h:91
static HANDLE GetInputHandle() noexcept
入力ハンドル取得関数
Definition: CConsole.h:304
virtual int InputString(wchar_t *pszBuffer, int nSize) noexcept override
文字列入力関数
Definition: CConsole.h:185
bool m_bStopInput
入力中止要求フラグ
Definition: CConsole.h:589
virtual int InputString(wchar_t *pszBuffer, int nSize, DWORD dwTime) noexcept
文字列入力関数
Definition: CConsole.h:212