CLI  2.9
Menu Class Reference

Menu definition. More...

#include <menu.h>

Inheritance diagram for Menu:

Public Member Functions

 Menu (const char *const STR_Name, const Help &CLI_Help)
 Constructor. More...
 
virtual ~Menu (void)
 Destructor. More...
 
const tk::String GetName (void) const
 Menu name access. More...
 
virtual void SetCli (Cli &CLI_Cli)
 Cli reference setting. More...
 
virtual const bool ExecuteReserved (const CommandLine &CLI_CommandLine) const
 Reserved commands execution. More...
 
virtual const bool Execute (const CommandLine &CLI_CommandLine) const
 User-defined commands execution. More...
 
virtual void OnExit (void) const
 Handler on menu exit. More...
 
virtual const tk::String OnPrompt (void) const
 Handler on prompt display. More...
 
- Public Member Functions inherited from SyntaxNode
 SyntaxNode (const char *const STR_Keyword, const Help &CLI_Help)
 Constructor. More...
 
virtual ~SyntaxNode (void)
 Destructor. More...
 
ElementAddElement (Element *const PCLI_Element)
 Possible element addition. More...
 
const bool RemoveElement (const Element *const PCLI_Element, const bool B_AutoDelete)
 Element removal. More...
 
virtual const bool FindElements (Element::List &CLI_ExactList, Element::List &CLI_NearList, const char *const STR_Keyword) const
 Sub-elements search. More...
 
- Public Member Functions inherited from Element
 Element (const char *const STR_Keyword, const Help &STR_Help)
 Constructor. More...
 
virtual ~Element (void)=0
 Destructor. More...
 
virtual const tk::String GetKeyword (void) const
 String identifier accessor. More...
 
virtual const HelpGetHelp (void) const
 Element help accessor. More...
 
CliGetCli (void)
 Read-Write Cli reference accessor. More...
 
const CliGetCli (void) const
 Read-only Cli reference accessor. More...
 
ShellGetShell (void) const
 Shell reference accessor. More...
 
const OutputDeviceGetOutputStream (void) const
 Output stream reference accessor. More...
 
const OutputDeviceGetErrorStream (void) const
 Error stream reference accessor. More...
 
- Public Member Functions inherited from Object
virtual ~Object (void)=0
 Pure virtual destructor. More...
 

Additional Inherited Members

- Public Types inherited from Element
typedef tk::Queue< const Element * > List
 CLI element list type. More...
 
typedef tk::Map< const tk::String, const Element * > Map
 CLI element map type. More...
 
- Protected Member Functions inherited from Object
 Object (void)
 Default constructor only available to sub-classes. More...
 

Detailed Description

Menu definition.

Definition at line 51 of file menu.h.

Constructor & Destructor Documentation

◆ Menu()

Menu::Menu ( const char *const  STR_Name,
const Help CLI_Help 
)
explicit

Constructor.

Parameters
STR_NameMenu name.
CLI_HelpCorresponding help.

◆ ~Menu()

virtual Menu::~Menu ( void  )
virtual

Destructor.

Member Function Documentation

◆ Execute()

virtual const bool Menu::Execute ( const CommandLine CLI_CommandLine) const
virtual

User-defined commands execution.

Parameters
CLI_CommandLineCommand line to execute.
Returns
true if the command has found an execution code, false otherwise.

Reimplemented in ConfigMenu, and TracesMenu.

◆ ExecuteReserved()

virtual const bool Menu::ExecuteReserved ( const CommandLine CLI_CommandLine) const
virtual

Reserved commands execution.

Parameters
CLI_CommandLineCommand line to execute.
Returns
true if the command has found an execution code, false otherwise.

Reimplemented in Cli, ConfigMenu, and TracesMenu.

◆ GetName()

const tk::String Menu::GetName ( void  ) const

Menu name access.

Returns
Name of the menu.

◆ OnExit()

virtual void Menu::OnExit ( void  ) const
virtual

Handler on menu exit.

Reimplemented in Cli.

◆ OnPrompt()

virtual const tk::String Menu::OnPrompt ( void  ) const
virtual

Handler on prompt display.

Returns
Prompt to display. Empty string for default.

◆ SetCli()

virtual void Menu::SetCli ( Cli CLI_Cli)
virtual

Cli reference setting.

Parameters
CLI_CliCli reference.

The m_pcliCli member should be set for each Element object. However, generally, this method is automaticaly called, as in SyntaxNode::AddElement() for instance.

Reimplemented from Element.

Reimplemented in Cli, ConfigMenu, and TracesMenu.


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