Command handler class. More...

#include <CommandHandler.h>

Public Member Functions

 CommandHandler ()
 Instantiate a CommandHandler. More...
 
 ~CommandHandler ()
 
 CommandHandler (const CommandHandler &)=delete
 
bool registerCommand (CommandDelegate reqDelegate)
 Add a new command to the command handler. More...
 
bool unregisterCommand (CommandDelegate reqDelegate)
 Remove a command from the command handler. More...
 
void registerSystemCommands ()
 Register default system commands. More...
 
CommandDelegate getCommandDelegate (const String &commandString)
 Get the command delegate for a command. More...
 
VerboseMode getVerboseMode ()
 Get the verbose mode. More...
 
void setVerboseMode (VerboseMode reqVerboseMode)
 Set the verbose mode. More...
 
String getCommandPrompt ()
 Get the command line prompt. More...
 
void setCommandPrompt (const String &reqPrompt)
 Set the command line prompt. More...
 
char getCommandEOL ()
 Get the end of line character. More...
 
void setCommandEOL (char reqEOL)
 Set the end of line character. More...
 
String getCommandWelcomeMessage ()
 Get the welcome message. More...
 
void setCommandWelcomeMessage (const String &reqWelcomeMessage)
 Set the welcome message. More...
 

Detailed Description

Command handler class.

Constructor & Destructor Documentation

◆ CommandHandler() [1/2]

CommandHandler::CommandHandler ( )

Instantiate a CommandHandler.

◆ ~CommandHandler()

CommandHandler::~CommandHandler ( )

◆ CommandHandler() [2/2]

CommandHandler::CommandHandler ( const CommandHandler )
delete

Member Function Documentation

◆ getCommandDelegate()

CommandDelegate CommandHandler::getCommandDelegate ( const String commandString)

Get the command delegate for a command.

Parameters
commandStringCommand to query
Return values
CommandDelegateThe command delegate matchin the command

◆ getCommandEOL()

char CommandHandler::getCommandEOL ( )
inline

Get the end of line character.

Return values
charThe EOL character
Note
Only supports one EOL, unlike Windows

◆ getCommandPrompt()

String CommandHandler::getCommandPrompt ( )
inline

Get the command line prompt.

Return values
StringThe command line prompt
Note
This is what is shown on the command line before user input Default is Sming>

◆ getCommandWelcomeMessage()

String CommandHandler::getCommandWelcomeMessage ( )
inline

Get the welcome message.

Return values
StringThe welcome message that is shown when clients connect
Note
Only if verbose mode is enabled

◆ getVerboseMode()

VerboseMode CommandHandler::getVerboseMode ( )
inline

Get the verbose mode.

Return values
VerboseModeVerbose mode

◆ registerCommand()

bool CommandHandler::registerCommand ( CommandDelegate  reqDelegate)

Add a new command to the command handler.

Parameters
reqDelegateCommand delegate to register
Return values
boolTrue on success
Note
If command already exists, it will not be replaced and function will fail. Call unregisterCommand first if you want to replace a command.

◆ registerSystemCommands()

void CommandHandler::registerSystemCommands ( )

Register default system commands.

Note
Adds the following system commmands to the command handler
  • status
  • echo
  • help
  • debugon
  • debugoff
  • command

◆ setCommandEOL()

void CommandHandler::setCommandEOL ( char  reqEOL)
inline

Set the end of line character.

Parameters
reqEOLThe EOL character
Note
Only supports one EOL, unlike Windows

◆ setCommandPrompt()

void CommandHandler::setCommandPrompt ( const String reqPrompt)
inline

Set the command line prompt.

Parameters
reqPromptThe command line prompt
Note
This is what is shown on the command line before user input Default is Sming>

◆ setCommandWelcomeMessage()

void CommandHandler::setCommandWelcomeMessage ( const String reqWelcomeMessage)
inline

Set the welcome message.

Parameters
reqWelcomeMessageThe welcome message that is shown when clients connect
Note
Only if verbose mode is enabled

◆ setVerboseMode()

void CommandHandler::setVerboseMode ( VerboseMode  reqVerboseMode)
inline

Set the verbose mode.

Parameters
reqVerboseModeVerbose mode to set

◆ unregisterCommand()

bool CommandHandler::unregisterCommand ( CommandDelegate  reqDelegate)

Remove a command from the command handler.

reqDelegate Delegate to remove from command handler


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