CLI  2.9
CmdLineHistory Class Reference

Command line history objet. More...

#include <command_line_history.h>

Inheritance diagram for CmdLineHistory:

Public Member Functions

 CmdLineHistory (const unsigned int UI_StackSize)
 Default constructor. More...
 
virtual ~CmdLineHistory (void)
 Destructor. More...
 
const bool Push (const CmdLineEdition &CLI_Line)
 Pushes a command line in the history stack. More...
 
const bool Clear (void)
 Cleares all history from the stack. More...
 
const CmdLineEditionGetLine (const unsigned int UI_BackwardIndex) const
 History line retrieval. More...
 
const unsigned int GetCount (void) const
 History line count retrieval. More...
 
const bool SaveCurrentLine (const CmdLineEdition &CLI_CurrentLine)
 Saves the current line. More...
 
const bool Navigate (CmdLineEdition &CLI_CmdLine, const OutputDevice &CLI_Stream, const int I_Navigation)
 History line navigation. More...
 
const unsigned int GetNavigationIndex (void) const
 History index retrieval. More...
 
void EnableNavigationMemory (const bool B_NavigationMemory)
 Navigation memory enabling. More...
 
- Public Member Functions inherited from Object
virtual ~Object (void)=0
 Pure virtual destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Object
 Object (void)
 Default constructor only available to sub-classes. More...
 

Detailed Description

Command line history objet.

Definition at line 49 of file command_line_history.h.

Constructor & Destructor Documentation

◆ CmdLineHistory()

CmdLineHistory::CmdLineHistory ( const unsigned int  UI_StackSize)
explicit

Default constructor.

Parameters
UI_StackSizeNumber of history lines the stack should manage.

◆ ~CmdLineHistory()

virtual CmdLineHistory::~CmdLineHistory ( void  )
virtual

Destructor.

Member Function Documentation

◆ Clear()

const bool CmdLineHistory::Clear ( void  )

Cleares all history from the stack.

Returns
true for success, false for failure.

◆ EnableNavigationMemory()

void CmdLineHistory::EnableNavigationMemory ( const bool  B_NavigationMemory)

Navigation memory enabling.

As far as the navigation memory is on, the navigation keeps going on. When something happens while the navigation memory is off, the navigation starts from the beginning.

Parameters
B_NavigationMemorytrue for enabling, false otherwise.

◆ GetCount()

const unsigned int CmdLineHistory::GetCount ( void  ) const

History line count retrieval.

Returns
The number of history lines stacked + 1 for the current one.

◆ GetLine()

const CmdLineEdition& CmdLineHistory::GetLine ( const unsigned int  UI_BackwardIndex) const

History line retrieval.

Returns
The expected command line.
Parameters
UI_BackwardIndexBackward index in history lines. 0 means the current line.

◆ GetNavigationIndex()

const unsigned int CmdLineHistory::GetNavigationIndex ( void  ) const

History index retrieval.

Returns
The index of the current navigation position.

◆ Navigate()

const bool CmdLineHistory::Navigate ( CmdLineEdition CLI_CmdLine,
const OutputDevice CLI_Stream,
const int  I_Navigation 
)

History line navigation.

Returns
true if all the navigation expected has been executed, false otherwise.
Parameters
CLI_CmdLineCurrent command line edition object.
CLI_StreamOutput stream that should be used to display command lines.
I_NavigationNumber of steps in history navigation. Positive values mean navigating to older command lines. Negative values mean navigating to newer command lines.

◆ Push()

const bool CmdLineHistory::Push ( const CmdLineEdition CLI_Line)

Pushes a command line in the history stack.

Returns
true for success, false for failure.
Parameters
CLI_LineCommand line to push.

◆ SaveCurrentLine()

const bool CmdLineHistory::SaveCurrentLine ( const CmdLineEdition CLI_CurrentLine)

Saves the current line.

Returns
true for success, false otherwise.
Parameters
CLI_CurrentLineCurrent line.

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