CLI
2.9
|
Simple line user interface object. More...
#include <ui_text.h>
Public Member Functions | |
Text (const unsigned int UI_MaxLines, const unsigned int UI_MaxLineLength) | |
Constructor. More... | |
virtual | ~Text (void) |
Destructor. More... | |
virtual void | PutString (const char *const STR_Out) const |
Output handler. More... | |
virtual void | Beep (void) const |
Beep handler. More... | |
virtual void | CleanScreen (void) const |
Clean screen. More... | |
virtual const bool | WouldOutput (const OutputDevice &CLI_Device) const |
Stack overflow protection. More... | |
void | Begin (TextIterator &it) const |
Retrieves a text head iterator. More... | |
const bool | PageUp (TextIterator &it) const |
Moves iterator one page up. More... | |
const bool | LineUp (TextIterator &it) const |
Moves iterator one line up. More... | |
const bool | LineDown (TextIterator &it, const OutputDevice *const PCLI_Out) const |
Moves iterator one line down. More... | |
const bool | PageDown (TextIterator &it, const OutputDevice *const PCLI_Out) const |
Moves iterator one page down. More... | |
void | End (TextIterator &it, const OutputDevice *const PCLI_Out) const |
Retrieves a text end iterator. More... | |
void | PrintPage (TextIterator &it, const OutputDevice &CLI_Out, const bool B_FillPageWithBlankLines) const |
Print out a page of text. More... | |
![]() | |
const tk::String | GetDebugName (void) const |
Debug name accessor. More... | |
const int | UseInstance (const CallInfo &CLI_CallInfo) |
Ensures instance validity. More... | |
const int | FreeInstance (const CallInfo &CLI_CallInfo) |
Releases the instance. More... | |
const int | GetInstanceUsers (void) const |
Instance user count accessor. More... | |
const bool | OpenUp (const CallInfo &CLI_CallInfo) |
Checks the device is opened. More... | |
const bool | CloseDown (const CallInfo &CLI_CallInfo) |
Indicates the device the client does not need the device to opened anymore. More... | |
const int | GetOpenUsers (void) const |
Open state user count accessor. More... | |
const OutputDevice & | operator<< (const std::string &STR_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const tk::String &STR_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const char *const STR_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const char C_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const KEY E_Key) const |
Output operator. More... | |
const OutputDevice & | operator<< (const uint8_t UI8_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const int16_t I16_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const uint16_t UI16_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const int32_t I32_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const uint32_t UI32_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const int64_t I64_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const uint64_t UI64_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const float F_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const double D_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const void *const PV_Out) const |
Output operator. More... | |
const OutputDevice & | operator<< (const IOEndl &CLI_IOEndl) const |
Output operator. More... | |
const ResourceString | GetLastError (void) const |
Last error accessor. More... | |
virtual const ScreenInfo | GetScreenInfo (void) const |
Screen info accessor. More... | |
![]() | |
virtual | ~Object (void)=0 |
Pure virtual destructor. More... | |
Protected Member Functions | |
virtual const bool | OpenDevice (void) |
Device opening handler. More... | |
virtual const bool | CloseDevice (void) |
Device closure handler. More... | |
![]() | |
OutputDevice (const char *const STR_DbgName, const bool B_AutoDelete) | |
Constructor. More... | |
virtual | ~OutputDevice (void) |
Destructor. More... | |
![]() | |
Object (void) | |
Default constructor only available to sub-classes. More... | |
Additional Inherited Members | |
![]() | |
static OutputDevice & | GetNullDevice (void) |
Null device singleton. More... | |
static OutputDevice & | GetStdOut (void) |
Standard output device singleton. More... | |
static OutputDevice & | GetStdErr (void) |
Standard error device singleton. More... | |
![]() | |
ResourceString | m_cliLastError |
|
explicit |
Constructor.
UI_MaxLines | Maximum number of lines |
UI_MaxLineLength | Maximum length of lines |
Definition at line 38 of file ui_text.cpp.
|
virtual |
Destructor.
Definition at line 44 of file ui_text.cpp.
|
virtual |
void Text::Begin | ( | TextIterator & | it | ) | const |
Retrieves a text head iterator.
it | Current iterator. |
Definition at line 105 of file ui_text.cpp.
Referenced by LineUp(), Less::OnKey(), More::ResetToDefault(), and Less::ResetToDefault().
|
virtual |
|
protectedvirtual |
Device closure handler.
Implements OutputDevice.
Definition at line 53 of file ui_text.cpp.
void Text::End | ( | TextIterator & | it, |
const OutputDevice *const | PCLI_Out | ||
) | const |
Retrieves a text end iterator.
it | Current iterator. |
PCLI_Out | Output device, if the end of the text should be output by the way. |
Definition at line 235 of file ui_text.cpp.
References LineDown().
Referenced by Less::OnKey().
const bool Text::LineDown | ( | TextIterator & | it, |
const OutputDevice *const | PCLI_Out | ||
) | const |
Moves iterator one line down.
it | Current iterator. |
PCLI_Out | Output device, if the bottom line should be output by the way. |
Definition at line 177 of file ui_text.cpp.
References CLI_ASSERT, OutputDevice::GetNullDevice(), OutputDevice::ScreenInfo::GetSafeWidth(), and PrintPage().
Referenced by End(), More::OnKey(), Less::OnKey(), and PageDown().
const bool Text::LineUp | ( | TextIterator & | it | ) | const |
Moves iterator one line up.
it | Current iterator. |
Definition at line 128 of file ui_text.cpp.
References Begin(), CLI_ASSERT, and OutputDevice::ScreenInfo::GetSafeWidth().
Referenced by Less::OnKey(), and PageUp().
|
protectedvirtual |
Device opening handler.
Implements OutputDevice.
Definition at line 48 of file ui_text.cpp.
const bool Text::PageDown | ( | TextIterator & | it, |
const OutputDevice *const | PCLI_Out | ||
) | const |
Moves iterator one page down.
it | Current iterator. |
PCLI_Out | Output device, if the page should be output by the way. |
Definition at line 220 of file ui_text.cpp.
References LineDown().
Referenced by Less::OnKey(), and More::OnKey().
const bool Text::PageUp | ( | TextIterator & | it | ) | const |
Moves iterator one page up.
it | Current iterator. |
Definition at line 113 of file ui_text.cpp.
References LineUp().
Referenced by Less::OnKey().
void Text::PrintPage | ( | TextIterator & | it, |
const OutputDevice & | CLI_Out, | ||
const bool | B_FillPageWithBlankLines | ||
) | const |
Print out a page of text.
Updates automatically the bottom position of the iterator one page below the top position.
it | Iterator which top position is ready for a page display. |
CLI_Out | Output device to use for display. |
B_FillPageWithBlankLines | true when incomplete pages should be filled with blank lines. |
Definition at line 241 of file ui_text.cpp.
References endl.
Referenced by LineDown(), and More::ResetToDefault().
|
virtual |
Output handler.
STR_Out | Output string. |
Implements OutputDevice.
Definition at line 58 of file ui_text.cpp.
References CLI_ASSERT.
|
virtual |
Stack overflow protection.
CLI_Device | Other device that the callee device should check it would output characters to. |
Determines whether the current device would output the given device in any way. Default implementation checks whether CLI_Device is the self device.
Reimplemented from OutputDevice.
Definition at line 95 of file ui_text.cpp.
References OutputDevice::WouldOutput().