39 Line::
Line(const tk::
String& TK_DefaultLine, const
int I_MinLineLength, const
int I_MaxLineLength)
41 m_tkDefaultLine(TK_DefaultLine), m_iMinLineLength(I_MinLineLength), m_iMaxLineLength(I_MaxLineLength),
47 :
UI(CLI_ParentContext),
48 m_tkDefaultLine(TK_DefaultLine), m_iMinLineLength(I_MinLineLength), m_iMaxLineLength(I_MaxLineLength),
63 void Line::SetLine(
const tk::String& TK_Line,
const bool B_NewLine,
const bool B_ResetOnTyping)
68 m_cliLine.
Put(ECHO, TK_Line);
69 m_bResetOnTyping = B_ResetOnTyping;
83 SetLine(m_tkDefaultLine,
false,
true);
100 m_cliLine.
Home(ECHO);
101 m_bResetOnTyping =
false;
105 m_bResetOnTyping =
false;
108 if (! m_cliLine.
GetLeft().IsEmpty())
111 m_bResetOnTyping =
false;
119 if (! m_cliLine.
GetRight().IsEmpty())
122 m_bResetOnTyping =
false;
130 if (! m_cliLine.
GetLeft().IsEmpty())
132 m_cliLine.
Delete(ECHO, -1);
133 m_bResetOnTyping =
false;
141 if (! m_cliLine.
GetRight().IsEmpty())
143 m_cliLine.
Delete(ECHO, 1);
144 m_bResetOnTyping =
false;
152 if (((m_iMinLineLength < 0) || (m_cliLine.
GetLine().GetLength() >= (
unsigned int) m_iMinLineLength))
153 && ((m_iMaxLineLength < 0) || (m_cliLine.
GetLine().GetLength() <= (
unsigned int) m_iMaxLineLength)))
169 case CLS: m_cliLine.
CleanAll(ECHO); m_bResetOnTyping =
false;
break;
173 case KEY_b:
case KEY_c:
case KEY_ccedil:
case KEY_d:
175 case KEY_f:
case KEY_g:
case KEY_h:
177 case KEY_j:
case KEY_k:
case KEY_l:
case KEY_m:
case KEY_n:
179 case KEY_p:
case KEY_q:
case KEY_r:
case KEY_s:
case KEY_t:
181 case KEY_v:
case KEY_w:
case KEY_x:
case KEY_y:
case KEY_z:
183 case KEY_A:
case KEY_B:
case KEY_C:
case KEY_D:
case KEY_E:
case KEY_F:
184 case KEY_G:
case KEY_H:
case KEY_I:
case KEY_J:
case KEY_K:
case KEY_L:
185 case KEY_M:
case KEY_N:
case KEY_O:
case KEY_P:
case KEY_Q:
case KEY_R:
186 case KEY_S:
case KEY_T:
case KEY_U:
case KEY_V:
case KEY_W:
case KEY_X:
187 case KEY_Y:
case KEY_Z:
189 case KEY_0:
case KEY_1:
case KEY_2:
case KEY_3:
case KEY_4:
case KEY_5:
190 case KEY_6:
case KEY_7:
case KEY_8:
case KEY_9:
226 case OPENING_CURLY_BRACE:
227 case CLOSING_CURLY_BRACE:
228 case OPENING_BRACKET:
229 case CLOSING_BRACKET:
230 if (m_bResetOnTyping)
233 m_bResetOnTyping =
false;
236 || (m_cliLine.
GetLine().GetLength() < (
unsigned int) m_iMaxLineLength))
238 m_cliLine.
Put(ECHO, E_KeyCode);
void NextLine(const OutputDevice &CLI_OutputDevice)
Moves the cursor to the next line.
Main namespace of the CLI library.
const tk::String GetLine(void) const
Line retrieval.
Based on utf-8 encoding for '§' (changed in version 2.9)
const tk::String GetLeft(void) const
Left part of the command line accessor.
Based on utf-8 encoding for 'à' (changed in version 2.9)
Based on utf-8 encoding for '€' (changed in version 2.9)
Based on utf-8 encoding for 'í' (changed in version 2.9)
Simple line user interface object.
Based on utf-8 encoding for 'ì' (changed in version 2.9)
const bool GetInsertMode(void) const
Insert mode retrieval.
void SetLine(const tk::String &TK_Line, const bool B_NewLine, const bool B_CleanOnTyping)
Protected line setter for child classes.
Based on utf-8 encoding for 'ç' (changed in version 2.9)
Based on utf-8 encoding for 'ü' (changed in version 2.9)
#define CLI_NS_END(__ns)
End a namespace definition.
void EndControl(const bool B_ExecResult)
Method to call by child classes in order to end the control execution.
Based on utf-8 encoding for '£' (changed in version 2.9)
Based on utf-8 encoding for 'á' (changed in version 2.9)
Based on utf-8 encoding for 'ô' (changed in version 2.9)
void MoveCursor(const OutputDevice &CLI_OutputDevice, const int I_Count)
Moves the cursor.
const tk::String GetLine(void) const
Current command line.
Based on utf-8 encoding for 'ï' (changed in version 2.9)
void CleanAll(const OutputDevice &CLI_OutputDevice)
Line deletion.
virtual ~Line(void)
Destructor.
const tk::String GetRight(void) const
Right part of the command line accessor.
CmdLineEdition class definition.
void Beep(void)
Sends a beep signal.
Based on utf-8 encoding for 'ü' (changed in version 2.9)
CLI library default pre-compiled header.
Line(const tk::String &TK_DefaultLine, const int I_MinLineLength, const int I_MaxLineLength)
Top execution context constructor.
Based on utf-8 encoding for 'ä' (changed in version 2.9)
void SetInsertMode(const bool B_InsertMode)
Insert mode setting.
Clean screen key (changed from 129 to 501 in order to avoid overlap with printable ASCII characters)...
Based on utf-8 encoding for 'ò' (changed in version 2.9)
Based on utf-8 encoding for 'µ' (changed in version 2.9)
virtual void Reset(void)
Handler called when data reset is required.
#define CLI_NS_BEGIN(__ns)
Begin a namespace definition.
Based on utf-8 encoding for 'û' (changed in version 2.9)
Based on utf-8 encoding for 'â' (changed in version 2.9)
Based on utf-8 encoding for 'é' (changed in version 2.9)
Based on utf-8 encoding for 'ù' (changed in version 2.9)
void Put(const OutputDevice &CLI_OutputDevice, const KEY E_Char)
Character addition.
Based on utf-8 encoding for '²' (changed in version 2.9)
Backspace (changed from '\b' to 8 in version 2.7 for ASCII compliance).
Based on utf-8 encoding for 'è' (changed in version 2.9)
Based on utf-8 encoding for 'ú' (changed in version 2.9)
void Home(const OutputDevice &CLI_OutputDevice)
Moves the cursor at the beginning of the line.
void Delete(const OutputDevice &CLI_OutputDevice, const int I_Count)
Character deletion.
Command line edition objet.
Based on utf-8 encoding for 'î' (changed in version 2.9)
virtual void OnKey(const KEY E_KeyCode)
Handler called on character input.
Based on utf-8 encoding for 'û' (changed in version 2.9)
Generic user interface class.
void End(const OutputDevice &CLI_OutputDevice)
Moves the cursor at the end of the line.
void Reset(void)
Reset the object.
const OutputDevice & GetStream(const STREAM_TYPE E_StreamType) const
Output stream accessor.
Insert key (changed from 500 to 502 in order to avoid overlap with printable ASCII characters)...
Based on utf-8 encoding for 'ö' (changed in version 2.9)
Based on utf-8 encoding for 'ó' (changed in version 2.9)
virtual void ResetToDefault(void)
Handler called when default value is required to be restored.
Delete key (changed from 128 to 127 in version 2.7 for ASCII compliance).