14 #pragma managed( push, off ) 25 #define ConsoleInstance() LibCommon::CConsole::GetInstance() 26 #define ConsoleChar(...) ConsoleInstance().OutputChar(__VA_ARGS__)
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__)
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()
133 inline virtual
int GetInputCount() const noexcept {
return m_nRecordCount; }
144 inline virtual void StopInput() noexcept { m_bStopInput =
true; }
160 virtual bool OutputString(
wchar_t const* pszString ) noexcept
override;
185 virtual int InputString(
wchar_t* pszBuffer,
int nSize ) noexcept
override {
return InputString( pszBuffer, nSize, INFINITE ); }
199 virtual bool InputChar(
wchar_t& rCh, DWORD dwTime ) noexcept;
212 virtual int InputString(
wchar_t* pszBuffer,
int nSize, DWORD dwTime ) noexcept {
return InputString( pszBuffer, nSize,
nullptr, dwTime ); }
226 virtual int InputString(
wchar_t* pszBuffer,
int nSize,
wchar_t const* pszString, DWORD dwTime = INFINITE ) noexcept;
237 virtual void ClearInputBuffer() noexcept;
251 virtual bool InputRecord(
SInputRecord& rsRecord, DWORD dwTime ) noexcept;
265 virtual int HitAnyKey(
wchar_t const* pszString =
nullptr, DWORD dwTime = INFINITE ) noexcept;
279 virtual bool YesNoKey(
wchar_t const* pszString =
nullptr, DWORD dwTime = INFINITE ) noexcept;
304 inline static HANDLE
GetInputHandle() noexcept { return ::GetStdHandle( STD_INPUT_HANDLE ); }
315 inline static HANDLE
GetOutputHandle() noexcept { return ::GetStdHandle( STD_OUTPUT_HANDLE ); }
343 static bool GetFontSize(
int& rnWidth,
int& rnHeight ) noexcept;
357 static bool GetSize(
int& rnWidth,
int& rnHeight ) noexcept;
371 static bool SetBufferSize(
int nWidth,
int nHeight ) noexcept;
385 static bool GetBufferPosition(
int& rnLeft,
int& rnTop ) noexcept;
399 static bool SetBufferPosition(
int nLeft,
int nTop ) noexcept;
415 static bool GetBufferArea(
int& rnLeft,
int& rnTop,
int& rnWidth,
int& rnHeight ) noexcept;
431 static bool SetBufferArea(
int nLeft,
int nTop,
int nWidth,
int nHeight ) noexcept;
447 static bool GetWindowArea(
int& rnLeft,
int& rnTop,
int& rnWidth,
int& rnHeight ) noexcept;
463 static bool SetWindowArea(
int nLeft,
int nTop,
int nWidth,
int nHeight ) noexcept;
477 static bool GetCursorPosition(
int& rnX,
int& rnY ) noexcept;
491 static bool SetCursorPosition(
int nX,
int nY ) noexcept;
504 static bool GetCursor( COORD& rsCursor ) noexcept;
517 static bool SetCursor( COORD
const& rsCursor ) noexcept;
531 static bool ScrollWindow(
int nX,
int nY ) noexcept;
544 static bool InputDirect(
wchar_t& rCh ) noexcept;
557 static bool KbHitDirect() noexcept;
571 static DWORD WINAPI SubThreadProc( LPVOID lpParam ) noexcept;
576 static int const BUFFER_SIZE = ( 512 - 1 );
577 static int const RECORD_SIZE = 512;
578 static int const KBHIT_RECORD_SIZE = 32;
583 wchar_t m_szBuffer[ BUFFER_SIZE + 1 ];
604 #pragma managed( pop ) COORD m_sMaxCursor
最大カーソル位置
static HANDLE GetOutputHandle() noexcept
出力ハンドル取得関数
CThread m_cThreadSub
サブスレッド
static HWND GetWindowHandle() noexcept
ウィンドウハンドル取得関数
static CConsole & GetInstance() noexcept
インスタンス取得関数
static CConsole s_cInstance
静的インスタンス
int m_nRecordPos
入力レコード先頭位置
int m_nRecordCount
入力レコードカウント
virtual void StopInput() noexcept
入力中止要求関数
#define LIB_COMMON_API
ダイナミックライブラリインポート宣言
virtual bool InputChar(wchar_t &rCh) noexcept override
1文字入力関数
static HANDLE GetInputHandle() noexcept
入力ハンドル取得関数
virtual int InputString(wchar_t *pszBuffer, int nSize) noexcept override
文字列入力関数
bool m_bStopInput
入力中止要求フラグ
virtual int InputString(wchar_t *pszBuffer, int nSize, DWORD dwTime) noexcept
文字列入力関数