Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cCommandLog Class Reference

#include <cCommandLog.h>

Public Member Functions

 cCommandLog () noexcept
 
 ~cCommandLog ()
 
ITERATE_t get_CmdQty () const noexcept
 
cString GetCmdAt (ITERATE_t i) const
 
void RemoveAllCmds ()
 
void AddCmd (const GChar_t *pszStr)
 add to tail(size-1). More...
 
cString ScrollCmd (VK_TYPE iVKey)
 VK_UP. More...
 
HRESULT AddConsoleKey (VK_TYPE vKey, cStreamOutput *pOut=nullptr, bool bEcho=false)
 
 UNITTEST_FRIEND (cCommandLog)
 

Public Attributes

cString m_sCmd
 The current working command line. AddConsoleKey. More...
 
bool m_bCmdComplete
 
ITERATE_t m_iMaxCommandQty
 arbitrary limit to store this many. More...
 
cArrayString< GChar_tm_aCmdHistory
 

Detailed Description

Keeps last X command strings. allow to scroll through them using arrows.

Constructor & Destructor Documentation

◆ cCommandLog()

GrayLib::cCommandLog::cCommandLog ( )
noexcept

◆ ~cCommandLog()

GrayLib::cCommandLog::~cCommandLog ( )

Member Function Documentation

◆ AddCmd()

void GrayLib::cCommandLog::AddCmd ( const GChar_t pszStr)

add to tail(size-1).

Kill the duplicates. Add command to the end. Enforce Max qty.

◆ AddConsoleKey()

HRESULT GrayLib::cCommandLog::AddConsoleKey ( VK_TYPE  vKey,
cStreamOutput pOut = nullptr,
bool  bEcho = false 
)

build up a command string from key presses. Add a key to an existing command from the console. bEcho chars as necessary/desired. Build up an input string.

Returns
<0 = dump this connection. 0 = no change keep going. 1 = keep processing. 2 = process this command. newline.

◆ get_CmdQty()

ITERATE_t GrayLib::cCommandLog::get_CmdQty ( ) const
inlinenoexcept

How many commands in memory queue.

◆ GetCmdAt()

cString GrayLib::cCommandLog::GetCmdAt ( ITERATE_t  i) const
inline

MUST be in bounds

◆ RemoveAllCmds()

void GrayLib::cCommandLog::RemoveAllCmds ( )
inline

◆ ScrollCmd()

cString GrayLib::cCommandLog::ScrollCmd ( VK_TYPE  iVKey)

VK_UP.

scroll m_nCurCommandIndex up/down. iVKey = VK_UP, VK_DOWN, VK_ESCAPE.

◆ UNITTEST_FRIEND()

GrayLib::cCommandLog::UNITTEST_FRIEND ( cCommandLog  )

Member Data Documentation

◆ m_aCmdHistory

cArrayString<GChar_t> GrayLib::cCommandLog::m_aCmdHistory

◆ m_bCmdComplete

bool GrayLib::cCommandLog::m_bCmdComplete

◆ m_iMaxCommandQty

ITERATE_t GrayLib::cCommandLog::m_iMaxCommandQty

arbitrary limit to store this many.

◆ m_sCmd

cString GrayLib::cCommandLog::m_sCmd

The current working command line. AddConsoleKey.


The documentation for this class was generated from the following files: