CLI
2.9
|
#include <shell.h>
Public Member Functions | |
Shell (const Cli &CLI_Cli) | |
Top execution context constructor. More... | |
Shell (ExecutionContext &CLI_ParentContext, const Cli &CLI_Cli) | |
Child execution context constructor. More... | |
virtual | ~Shell (void) |
Destructor. More... | |
const Cli & | GetCli (void) const |
Cli accessor. More... | |
void | SetWelcomeMessage (const ResourceString &CLI_WelcomeMessage) |
Welcome message setting. More... | |
void | SetByeMessage (const ResourceString &CLI_ByeMessage) |
Bye message setting. More... | |
void | SetPrompt (const ResourceString &CLI_Prompt) |
Prompt message positionning. More... | |
const unsigned int | GetHelpMargin (void) const |
Help margin accessor. More... | |
const unsigned int | GetHelpOffset (void) const |
Help offset accessor. More... | |
const Menu *const | GetCurrentMenu (const int I_MenuIndex) const |
Current menu retrieval. More... | |
void | EnterMenu (const Menu &CLI_Menu, const bool B_PromptMenu) |
Enters a menu. More... | |
void | ExitMenu (const bool B_PromptMenu) |
Exits the current menu. More... | |
void | Quit (void) |
Terminates the shell. More... | |
void | DisplayHelp (void) |
Displays help depending on the context of the current line. More... | |
void | PrintWorkingMenu (void) |
Prints the working menu. More... | |
void | CleanScreen (const bool B_PromptMenu) |
Clean screen shortcut. More... | |
Public Member Functions inherited from ExecutionContext | |
virtual | ~ExecutionContext (void) |
Destructor. More... | |
ExecutionContextManager & | GetContextManager (void) |
Execution context manager accessor. More... | |
const IODevice & | GetInput (void) const |
Input stream accessor. More... | |
const OutputDevice & | GetStream (const STREAM_TYPE E_StreamType) const |
Output stream accessor. More... | |
const bool | SetStream (const STREAM_TYPE E_StreamType, OutputDevice &CLI_Stream) |
Output stream positionning. More... | |
const bool | StreamEnabled (const STREAM_TYPE E_StreamType) const |
Enabled/disabled stream accessor. More... | |
const bool | EnableStream (const STREAM_TYPE E_StreamType, const bool B_Enable) |
Enable/disable stream. More... | |
void | SetLang (const ResourceString::LANG E_Lang) |
Language setting. More... | |
const ResourceString::LANG | GetLang (void) const |
Language access. More... | |
void | SetBeep (const bool B_Enable) |
Beep configuration setting. More... | |
const bool | GetBeep (void) const |
Beep configuration access. More... | |
void | Beep (void) |
Sends a beep signal. More... | |
void | Run (IODevice &CLI_IODevice) |
Runs the execution context onto the corresponding input/output device. More... | |
void | Run (void) |
Runs the execution context as a child context of the parent given by the construction. More... | |
const bool | IsRunning (void) const |
Tells whether this execution context is running or not. More... | |
void | StopExecution (void) |
Terminates this execution context's execution. More... | |
void | StopAllExecutions (void) |
Terminates execution for all execution contexts attached to the same top execution context. More... | |
Public Member Functions inherited from Object | |
virtual | ~Object (void)=0 |
Pure virtual destructor. More... | |
Protected Member Functions | |
virtual const bool | OnStartExecution (void) |
Beginning of execution handler. More... | |
virtual void | OnKey (const KEY E_KeyCode) |
Handler called on character input. More... | |
virtual const bool | OnStopExecution (void) |
Execution termination handler. More... | |
Protected Member Functions inherited from ExecutionContext | |
ExecutionContext (void) | |
Top context constructor. More... | |
ExecutionContext (ExecutionContext &CLI_ParentContext) | |
Child context constructor. More... | |
Protected Member Functions inherited from Object | |
Object (void) | |
Default constructor only available to sub-classes. More... | |
|
explicit |
Top execution context constructor.
CLI_Cli | CLI reference. |
|
explicit |
Child execution context constructor.
CLI_ParentContext | Parent execution context. |
CLI_Cli | CLI reference. |
|
virtual |
Destructor.
void Shell::CleanScreen | ( | const bool | B_PromptMenu | ) |
Clean screen shortcut.
B_PromptMenu | true if the menu should be (re)prompted. Basically false when executed within the context of a command processing, true when executed from other contexts. |
void Shell::DisplayHelp | ( | void | ) |
Displays help depending on the context of the current line.
void Shell::EnterMenu | ( | const Menu & | CLI_Menu, |
const bool | B_PromptMenu | ||
) |
Enters a menu.
CLI_Menu | Menu to enter. |
B_PromptMenu | true if the menu should be (re)prompted. Basically false when executed within the context of a command processing, true when executed from other contexts. |
void Shell::ExitMenu | ( | const bool | B_PromptMenu | ) |
Exits the current menu.
B_PromptMenu | true if the menu should be (re)prompted. Basically false when executed within the context of a command processing, true when executed from other contexts. |
const Cli& Shell::GetCli | ( | void | ) | const |
const Menu* const Shell::GetCurrentMenu | ( | const int | I_MenuIndex | ) | const |
Current menu retrieval.
I_MenuIndex | Index of the menu in the stack. 0: root menu (bottom of the stack). 1: menu stacked over the root menu. 2: menu stacked over again... -1: current menu (top of the stack) |
const unsigned int Shell::GetHelpMargin | ( | void | ) | const |
Help margin accessor.
const unsigned int Shell::GetHelpOffset | ( | void | ) | const |
Help offset accessor.
|
protectedvirtual |
|
protectedvirtual |
Beginning of execution handler.
Implements ExecutionContext.
|
protectedvirtual |
Execution termination handler.
Implements ExecutionContext.
void Shell::PrintWorkingMenu | ( | void | ) |
Prints the working menu.
void Shell::Quit | ( | void | ) |
Terminates the shell.
void Shell::SetByeMessage | ( | const ResourceString & | CLI_ByeMessage | ) |
Bye message setting.
CLI_ByeMessage | Bye message. When an empty string is given, the default bye message is restored. |
void Shell::SetPrompt | ( | const ResourceString & | CLI_Prompt | ) |
Prompt message positionning.
CLI_Prompt | Prompt string. When an empty string is given, the default prompt (depending on the current menu) is restored. |
void Shell::SetWelcomeMessage | ( | const ResourceString & | CLI_WelcomeMessage | ) |
Welcome message setting.
CLI_WelcomeMessage | Welcome message. When an empty string is given, the default welcome message is restored. |