CLI  2.9
CmdLineEdition Class Reference

Command line edition objet. More...

#include <command_line_edition.h>

Inheritance diagram for CmdLineEdition:

Public Member Functions

 CmdLineEdition (const CmdLineEdition &)
 Copy constructor. More...
 
 CmdLineEdition (void)
 Default constructor. More...
 
virtual ~CmdLineEdition (void)
 Destructor. More...
 
CmdLineEditionoperator= (const CmdLineEdition &)
 Assignment operator. More...
 
void Set (const tk::String &TK_Left, const tk::String &TK_Right)
 Set the object. More...
 
void Reset (void)
 Reset the object. More...
 
void SetInsertMode (const bool B_InsertMode)
 Insert mode setting. More...
 
const bool GetInsertMode (void) const
 Insert mode retrieval. More...
 
void Put (const OutputDevice &CLI_OutputDevice, const KEY E_Char)
 Character addition. More...
 
void Put (const OutputDevice &CLI_OutputDevice, const tk::String &TK_String)
 String addition. More...
 
void CleanAll (const OutputDevice &CLI_OutputDevice)
 Line deletion. More...
 
void Delete (const OutputDevice &CLI_OutputDevice, const int I_Count)
 Character deletion. More...
 
void PrintCmdLine (const OutputDevice &CLI_OutputDevice) const
 Command line display. More...
 
void MoveCursor (const OutputDevice &CLI_OutputDevice, const int I_Count)
 Moves the cursor. More...
 
void NextLine (const OutputDevice &CLI_OutputDevice)
 Moves the cursor to the next line. More...
 
void Home (const OutputDevice &CLI_OutputDevice)
 Moves the cursor at the beginning of the line. More...
 
void End (const OutputDevice &CLI_OutputDevice)
 Moves the cursor at the end of the line. More...
 
const tk::String GetLine (void) const
 Current command line. More...
 
const tk::String GetRight (void) const
 Right part of the command line accessor. More...
 
const tk::String GetLeft (void) const
 Left part of the command line accessor. More...
 
const tk::String GetNextWord (void) const
 Next word retrieval. More...
 
const tk::String GetPrevWord (void) const
 Previous word retrieval. 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 edition objet.

Definition at line 48 of file command_line_edition.h.

Constructor & Destructor Documentation

◆ CmdLineEdition() [1/2]

CmdLineEdition::CmdLineEdition ( const CmdLineEdition )

Copy constructor.

Useful so that CmdLineEdition objects can stored in a tk::Queue<CmdLineEdition> member in CmdLineHistory.

◆ CmdLineEdition() [2/2]

CmdLineEdition::CmdLineEdition ( void  )
explicit

Default constructor.

◆ ~CmdLineEdition()

virtual CmdLineEdition::~CmdLineEdition ( void  )
virtual

Destructor.

Member Function Documentation

◆ CleanAll()

void CmdLineEdition::CleanAll ( const OutputDevice CLI_OutputDevice)

Line deletion.

Parameters
CLI_OutputDeviceOutput device.

Referenced by Password::OnKey(), Line::OnKey(), Password::ResetToDefault(), and Line::SetLine().

◆ Delete()

void CmdLineEdition::Delete ( const OutputDevice CLI_OutputDevice,
const int  I_Count 
)

Character deletion.

Note
If the deletion would move the cursor out of the bounds of the line, the cursor gets stuck either at the beginning (when deleting backward) or at the end (when deleting forward).
Parameters
CLI_OutputDeviceOutput device.
I_CountNumber of characters to delete. A positive value means deleting characters forward (from the right of the cursor). A negative value means deleting characters backward (from the left of the cursor, ie backspace).

Referenced by Password::OnKey(), and Line::OnKey().

◆ End()

void CmdLineEdition::End ( const OutputDevice CLI_OutputDevice)

Moves the cursor at the end of the line.

Parameters
CLI_OutputDeviceOutput device.

Referenced by Password::OnKey(), and Line::OnKey().

◆ GetInsertMode()

const bool CmdLineEdition::GetInsertMode ( void  ) const

Insert mode retrieval.

Returns
Current insert mode.

◆ GetLeft()

const tk::String CmdLineEdition::GetLeft ( void  ) const

Left part of the command line accessor.

Returns
The left part of the command line.

Referenced by Password::OnKey(), and Line::OnKey().

◆ GetLine()

const tk::String CmdLineEdition::GetLine ( void  ) const

Current command line.

Returns
The current command line.

Referenced by Line::GetLine(), Password::GetPassword(), Password::OnKey(), and Line::OnKey().

◆ GetNextWord()

const tk::String CmdLineEdition::GetNextWord ( void  ) const

Next word retrieval.

Returns
The next word after the cursor.
Note
A word means until the next blank.

◆ GetPrevWord()

const tk::String CmdLineEdition::GetPrevWord ( void  ) const

Previous word retrieval.

Returns
The previous word before the cursor.
Note
A word means until the next blank.

◆ GetRight()

const tk::String CmdLineEdition::GetRight ( void  ) const

Right part of the command line accessor.

Returns
The right part of the command line.

Referenced by Password::OnKey(), and Line::OnKey().

◆ Home()

void CmdLineEdition::Home ( const OutputDevice CLI_OutputDevice)

Moves the cursor at the beginning of the line.

Parameters
CLI_OutputDeviceOutput device.

Referenced by Password::OnKey(), and Line::OnKey().

◆ MoveCursor()

void CmdLineEdition::MoveCursor ( const OutputDevice CLI_OutputDevice,
const int  I_Count 
)

Moves the cursor.

Note
If the call would move the cursor out of the bounds of the line, the cursor gets stuck either at the beginning (when moving backward) or at the end (when moving forward).
Parameters
CLI_OutputDeviceOutput device.
I_CountNumber of characters to switch. A positive value means moving forward (on the right). A negative value means moving backward (on the left).

Referenced by Password::OnKey(), and Line::OnKey().

◆ NextLine()

void CmdLineEdition::NextLine ( const OutputDevice CLI_OutputDevice)

Moves the cursor to the next line.

Parameters
CLI_OutputDeviceOutput device.

Referenced by Password::OnKey(), Line::OnKey(), and Line::SetLine().

◆ operator=()

CmdLineEdition& CmdLineEdition::operator= ( const CmdLineEdition )

Assignment operator.

Returns
The CmdLineEdition instance itself.

◆ PrintCmdLine()

void CmdLineEdition::PrintCmdLine ( const OutputDevice CLI_OutputDevice) const

Command line display.

Note
Displays the current command line, positionning the cursor at the correct place.
Parameters
CLI_OutputDeviceOutput device.

◆ Put() [1/2]

void CmdLineEdition::Put ( const OutputDevice CLI_OutputDevice,
const KEY  E_Char 
)

Character addition.

Parameters
CLI_OutputDeviceOutput device.
E_CharCharacter to add.

Referenced by Line::SetLine().

◆ Put() [2/2]

void CmdLineEdition::Put ( const OutputDevice CLI_OutputDevice,
const tk::String &  TK_String 
)

String addition.

Parameters
CLI_OutputDeviceOutput device.
TK_StringString to add.

◆ Reset()

void CmdLineEdition::Reset ( void  )

Reset the object.

Note
Does not print out anything.

Referenced by Password::OnKey(), Password::Reset(), Line::Reset(), and Password::ResetToDefault().

◆ Set()

void CmdLineEdition::Set ( const tk::String &  TK_Left,
const tk::String &  TK_Right 
)

Set the object.

Note
Does not print out anything.
Parameters
TK_LeftLeft part of the command line.
TK_RightRight part of the command line.

◆ SetInsertMode()

void CmdLineEdition::SetInsertMode ( const bool  B_InsertMode)

Insert mode setting.

Note
Default is on.
Parameters
B_InsertModeInsert Mode.

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