Signature for a command handler.
More...
#include <CommandHandler.h>
|
static bool | isArgEqual (const char *arg, const char *token) |
| Test for equality against token. More...
|
|
static bool | isArgEqual (const char *arg, const __FlashStringHelper *token) |
| Test for equality when token is in PROGMEM. More...
|
|
Signature for a command handler.
Definition at line 47 of file CommandHandler.h.
◆ CommandHandler() [1/2]
ace_routine::cli::CommandHandler::CommandHandler |
( |
const char * |
name, |
|
|
const char * |
helpString |
|
) |
| |
|
inlineprotected |
◆ CommandHandler() [2/2]
ace_routine::cli::CommandHandler::CommandHandler |
( |
const __FlashStringHelper * |
name, |
|
|
const __FlashStringHelper * |
helpString |
|
) |
| |
|
inlineprotected |
◆ getHelpString()
FCString ace_routine::cli::CommandHandler::getHelpString |
( |
| ) |
const |
|
inline |
◆ getName()
FCString ace_routine::cli::CommandHandler::getName |
( |
| ) |
const |
|
inline |
◆ isArgEqual() [1/2]
static bool ace_routine::cli::CommandHandler::isArgEqual |
( |
const char * |
arg, |
|
|
const char * |
token |
|
) |
| |
|
inlinestaticprotected |
◆ isArgEqual() [2/2]
static bool ace_routine::cli::CommandHandler::isArgEqual |
( |
const char * |
arg, |
|
|
const __FlashStringHelper * |
token |
|
) |
| |
|
inlinestaticprotected |
Test for equality when token is in PROGMEM.
Definition at line 80 of file CommandHandler.h.
◆ run()
virtual void ace_routine::cli::CommandHandler::run |
( |
Print & |
printer, |
|
|
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| const |
|
pure virtual |
Run the command.
- Parameters
-
printer | The output printer, normally Serial. This is not expected to change during the lifetime of the CommandHandler instance, so normally I would inject this parameter into the object. However, that would cause each instance to consume 2 more bytes, even though all instances are expected to have the same 'printer'. For an 8-bit AVR processor with only 2kB of RAM, every byte is important , so I am keeping this as a parameter passed into the run() method. |
argc | Number of tokens in the input command, including the name of the command itself. |
argv | An array of strings for each token. |
The documentation for this class was generated from the following file: