39 Password::
Password(const
bool B_DisplayStars, const
int I_MinPasswordLength, const
int I_MaxPasswordLength)
41 m_bDisplayStars(B_DisplayStars), m_iMinPasswordLength(I_MinPasswordLength), m_iMaxPasswordLength(I_MaxPasswordLength),
47 :
UI(CLI_ParentContext),
48 m_bDisplayStars(B_DisplayStars), m_iMinPasswordLength(I_MinPasswordLength), m_iMaxPasswordLength(I_MaxPasswordLength),
55 delete & m_cliPassword;
66 m_cliPassword.
Reset();
74 m_cliPassword.
Reset();
93 m_cliPassword.
Home(NOECHO);
100 m_cliPassword.
End(NOECHO);
108 if (! m_cliLine.
GetLeft().IsEmpty())
114 if (m_bDisplayStars) {
121 if (! m_cliLine.
GetRight().IsEmpty())
134 m_cliPassword.
Delete(NOECHO, -1);
135 if (! m_cliLine.
GetLeft().IsEmpty())
137 m_cliLine.
Delete(ECHO, -1);
148 m_cliPassword.
Delete(NOECHO, 1);
149 if (! m_cliLine.
GetRight().IsEmpty())
151 m_cliLine.
Delete(ECHO, 1);
162 if (((m_iMinPasswordLength < 0) || (m_cliPassword.
GetLine().GetLength() >= (
unsigned int) m_iMinPasswordLength))
163 && ((m_iMaxPasswordLength < 0) || (m_cliPassword.
GetLine().GetLength() <= (
unsigned int) m_iMaxPasswordLength)))
182 m_cliPassword.
Reset();
188 case KEY_b:
case KEY_c:
case KEY_ccedil:
case KEY_d:
190 case KEY_f:
case KEY_g:
case KEY_h:
192 case KEY_j:
case KEY_k:
case KEY_l:
case KEY_m:
case KEY_n:
194 case KEY_p:
case KEY_q:
case KEY_r:
case KEY_s:
case KEY_t:
196 case KEY_v:
case KEY_w:
case KEY_x:
case KEY_y:
case KEY_z:
198 case KEY_A:
case KEY_B:
case KEY_C:
case KEY_D:
case KEY_E:
case KEY_F:
199 case KEY_G:
case KEY_H:
case KEY_I:
case KEY_J:
case KEY_K:
case KEY_L:
200 case KEY_M:
case KEY_N:
case KEY_O:
case KEY_P:
case KEY_Q:
case KEY_R:
201 case KEY_S:
case KEY_T:
case KEY_U:
case KEY_V:
case KEY_W:
case KEY_X:
202 case KEY_Y:
case KEY_Z:
204 case KEY_0:
case KEY_1:
case KEY_2:
case KEY_3:
case KEY_4:
case KEY_5:
205 case KEY_6:
case KEY_7:
case KEY_8:
case KEY_9:
241 case OPENING_CURLY_BRACE:
242 case CLOSING_CURLY_BRACE:
243 case OPENING_BRACKET:
244 case CLOSING_BRACKET:
245 if ((m_iMaxPasswordLength < 0) || (m_cliPassword.
GetLine().GetLength() < (
unsigned int) m_iMaxPasswordLength))
247 m_cliPassword.
Put(NOECHO, E_KeyCode);
250 m_cliLine.
Put(ECHO, STAR);
void NextLine(const OutputDevice &CLI_OutputDevice)
Moves the cursor to the next line.
static OutputDevice & GetNullDevice(void)
Null device singleton.
Main namespace of the CLI library.
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)
virtual ~Password(void)
Destructor.
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)
Based on utf-8 encoding for 'ì' (changed in version 2.9)
const bool GetInsertMode(void) const
Insert mode retrieval.
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)
virtual void ResetToDefault(void)
Handler called when default value is required to be restored.
Password user interface object.
void MoveCursor(const OutputDevice &CLI_OutputDevice, const int I_Count)
Moves the cursor.
virtual void Reset(void)
Handler called when data reset is required.
const tk::String GetLine(void) const
Current command line.
Password class definition.
Based on utf-8 encoding for 'ï' (changed in version 2.9)
void CleanAll(const OutputDevice &CLI_OutputDevice)
Line deletion.
const tk::String GetRight(void) const
Right part of the command line accessor.
Password(const bool B_DisplayStars, const int I_MinPasswordLength, const int I_MaxPasswordLength)
Top execution context constructor.
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.
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)
const tk::String GetPassword(void) const
Password retrieval.
#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)
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)
Delete key (changed from 128 to 127 in version 2.7 for ASCII compliance).