Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cCommandLog.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cCommandLog_H
7 #define _INC_cCommandLog_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "../Input/cInputBase.h"
13 #include "../WinAPI/WinTypes.h" // VK_TYPE
15 
16 namespace GrayLib
17 {
19 
21  {
25 
26  public:
30  cArrayString<GChar_t> m_aCmdHistory; // History of commands.
31  private:
32  ITERATE_t m_nCurCommandIndex;
33 
34  public:
35  cCommandLog() noexcept;
36  ~cCommandLog();
37 
38  ITERATE_t get_CmdQty() const noexcept
39  {
41  return m_aCmdHistory.GetSize();
42  }
44  {
46  return m_aCmdHistory.GetAt(i);
47  }
49  {
50  m_sCmd = "";
51  m_aCmdHistory.RemoveAll();
52  m_nCurCommandIndex = 0;
53  }
54 
55  void AddCmd(const GChar_t* pszStr);
56  cString ScrollCmd(VK_TYPE iVKey);
57 
58  HRESULT AddConsoleKey(VK_TYPE vKey, cStreamOutput* pOut=nullptr, bool bEcho=false);
59 
61  };
62 }
63 #endif // _INC_cCommandLog_H
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
int VK_TYPE
a type of physical key in _WIN32. "#define VK_UP" etc. NOT the same as a scan code.
Definition: cInputBase.h:27
Definition: cCommandLog.h:21
cArrayString< GChar_t > m_aCmdHistory
Definition: cCommandLog.h:30
cString GetCmdAt(ITERATE_t i) const
Definition: cCommandLog.h:43
UNITTEST_FRIEND(cCommandLog)
cString m_sCmd
The current working command line. AddConsoleKey.
Definition: cCommandLog.h:27
bool m_bCmdComplete
Definition: cCommandLog.h:28
void RemoveAllCmds()
Definition: cCommandLog.h:48
ITERATE_t m_iMaxCommandQty
arbitrary limit to store this many.
Definition: cCommandLog.h:29
void RemoveAll()
Clean up.
Definition: cArray.h:230
const TYPE & GetAt(ITERATE_t nIndex) const
Definition: cArray.h:162
ITERATE_t GetSize() const noexcept
Definition: cArray.h:137
Definition: cStream.h:126
Definition: cMesh.h:22
UNITTEST2_PREDEF(cQuadtree)
int ITERATE_t
like size_t but signed
Definition: Index.h:28
char GChar_t
My version of TCHAR, _TCHAR.
Definition: StrConst.h:26