Command handler class.
More...
#include <Handler.h>
◆ Handler() [1/3]
CommandProcessing::Handler::Handler |
( |
| ) |
|
|
inline |
Instantiate a CommandHandler.
◆ Handler() [2/3]
CommandProcessing::Handler::Handler |
( |
ReadWriteStream * |
stream, |
|
|
bool |
owned = true |
|
) |
| |
|
inline |
◆ Handler() [3/3]
CommandProcessing::Handler::Handler |
( |
const Handler & |
rhs | ) |
|
|
delete |
◆ ~Handler()
CommandProcessing::Handler::~Handler |
( |
| ) |
|
|
inline |
◆ getCommand()
Command CommandProcessing::Handler::getCommand |
( |
const String & |
name | ) |
const |
Find command object.
- Parameters
-
- Return values
-
Command | The command object matching the command |
◆ getCommandEOL()
char CommandProcessing::Handler::getCommandEOL |
( |
| ) |
const |
|
inline |
Get the end of line character.
- Return values
-
- Note
- Only supports one EOL, unlike Windows
- Deprecated:
- Not required
◆ getCommandPrompt()
String CommandProcessing::Handler::getCommandPrompt |
( |
| ) |
const |
Get the command line prompt.
- Return values
-
- Note
- This is what is shown on the command line before user input Default is Sming>
◆ getCommandWelcomeMessage()
String CommandProcessing::Handler::getCommandWelcomeMessage |
( |
| ) |
const |
Get the welcome message.
- Return values
-
String | The welcome message that should be shown when clients connect |
- Note
- For use by application
◆ getOutputStream()
◆ isVerbose()
bool CommandProcessing::Handler::isVerbose |
( |
| ) |
const |
|
inline |
Get the verbose mode.
- Return values
-
◆ process() [1/2]
size_t CommandProcessing::Handler::process |
( |
char |
charToWrite | ) |
|
◆ process() [2/2]
size_t CommandProcessing::Handler::process |
( |
const char * |
buffer, |
|
|
size_t |
size |
|
) |
| |
|
inline |
Write chars to stream.
- Parameters
-
buffer | Pointer to buffer to write to the stream |
size | Quantity of chars to write |
- Return values
-
size_t | Quantity of chars processed |
◆ processNow()
String CommandProcessing::Handler::processNow |
( |
const char * |
buffer, |
|
|
size_t |
size |
|
) |
| |
Process command input and return response text.
- Parameters
-
buffer | Command input |
size | Number of characters to process |
- Return values
-
- Note
- Do not use this method if
setOutputStream
has been called
◆ registerCommand()
bool CommandProcessing::Handler::registerCommand |
( |
const Command & |
command | ) |
|
Add a new command to the command handler.
- Parameters
-
- Return values
-
- 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 CommandProcessing::Handler::registerSystemCommands |
( |
| ) |
|
Register default system commands.
- Note
- Adds the following system commands to the command handler
- status
- echo
- help
- debugon
- debugoff
- command
◆ setCommandEOL()
void CommandProcessing::Handler::setCommandEOL |
( |
char |
eol | ) |
|
|
inline |
Set the end of line character.
- Parameters
-
- Note
- Only supports one EOL, unlike Windows
- Deprecated:
- Not required
◆ setCommandPrompt()
void CommandProcessing::Handler::setCommandPrompt |
( |
const String & |
prompt | ) |
|
|
inline |
Set the command line prompt.
- Parameters
-
prompt | The command line prompt, nullptr to reset to default |
- Note
- This is what is shown on the command line before user input Default is Sming>
◆ setCommandWelcomeMessage()
void CommandProcessing::Handler::setCommandWelcomeMessage |
( |
const String & |
message | ) |
|
|
inline |
Set the welcome message.
- Parameters
-
message | The welcome message that should be shown when clients connect |
- Note
- For use by application Pass nullptr to revert to default message.
◆ setOutputStream()
void CommandProcessing::Handler::setOutputStream |
( |
ReadWriteStream * |
stream, |
|
|
bool |
owned = true |
|
) |
| |
|
inline |
sets the output stream
- Parameters
-
stream | pointer to the output stream |
owned | specifies if the output stream should be deleted in this class(owned=true) |
◆ setVerbose()
void CommandProcessing::Handler::setVerbose |
( |
bool |
mode | ) |
|
|
inline |
Set the verbose mode.
- Parameters
-
◆ unregisterCommand()
bool CommandProcessing::Handler::unregisterCommand |
( |
const Command & |
command | ) |
|
Remove a command from the command handler.
- Parameters
-
command | Item to remove from command handler |
The documentation for this class was generated from the following file: