lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lintel::AbstractCommandLineMenu Class Reference

#include <AbstractCommandLineMenu.h>

Public Member Functions

 AbstractCommandLineMenu (const std::vector< std::shared_ptr< CommandLineComponent > > &components)
 
void onShowMenu ()
 
std::set< std::string > allMenuEntriesOf ()
 
bool onMenu (const std::string &command)
 
bool onExit ()
 
void printCommandList ()
 
void onCommand (const UserDto &userDto, const std::string &command, const std::vector< std::string > &parameters)
 
std::vector< std::string > allCommandsOf ()
 
void onHelp ()
 
const std::shared_ptr< CommandLineComponent > & currentOf ()
 

Detailed Description

Manages a collection of CommandLineComponents and routes commands/menu navigation between them

Constructor & Destructor Documentation

◆ AbstractCommandLineMenu()

lintel::AbstractCommandLineMenu::AbstractCommandLineMenu ( const std::vector< std::shared_ptr< CommandLineComponent > > &  components)
explicit
Parameters
componentsthe list of available CLI components

Member Function Documentation

◆ allCommandsOf()

std::vector< std::string > lintel::AbstractCommandLineMenu::allCommandsOf ( )
Returns
list of all commands across all components

◆ allMenuEntriesOf()

std::set< std::string > lintel::AbstractCommandLineMenu::allMenuEntriesOf ( )
Returns
set of all menu entry names

◆ currentOf()

const std::shared_ptr< CommandLineComponent > & lintel::AbstractCommandLineMenu::currentOf ( )
Returns
reference to the currently active component

◆ onCommand()

void lintel::AbstractCommandLineMenu::onCommand ( const UserDto &  userDto,
const std::string &  command,
const std::vector< std::string > &  parameters 
)

Route command to the currently active component

◆ onExit()

bool lintel::AbstractCommandLineMenu::onExit ( )
Returns
true if exit was confirmed

◆ onHelp()

void lintel::AbstractCommandLineMenu::onHelp ( )

Show help for the current component

◆ onMenu()

bool lintel::AbstractCommandLineMenu::onMenu ( const std::string &  command)
Parameters
commandcomponent name to navigate to

◆ onShowMenu()

void lintel::AbstractCommandLineMenu::onShowMenu ( )

Show the main menu with all available components

◆ printCommandList()

void lintel::AbstractCommandLineMenu::printCommandList ( )

Print the command list for the current component


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