![]() |
HAN-FUN API
1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
|
Parent class for the commands API implementations. More...
#include <common.h>
Public Member Functions | |
Command (const char *__key, const char *__usage) | |
Constructor. More... | |
const std::string & | key () const |
Get the command key. More... | |
const std::string | usage (bool format=false) const |
Get the command help documentation. More... | |
![]() | |
virtual void | run (std::vector< std::string > &args)=0 |
Execute the command code. More... | |
Protected Attributes | |
const std::string | _key |
Command key. More... | |
const std::string | _usage |
Command help string. More... | |
Additional Inherited Members | |
![]() | |
static void | add (ICommand *command) |
Add a command to the registry. More... | |
static void | remove (ICommand *command) |
Remove a command to the registry. More... | |
static void | run (std::string &cmd, std::vector< std::string > &args) |
Find and run the command with the given key , using the arguments in args . More... | |
static std::ostream & | help (std::ostream &stream) |
Generate the help screen, based on the commands in the registry. More... | |
![]() | |
static std::map< std::string, ICommand * > | registry |
Command registry. | |
Parent class for the commands API implementations.
Definition at line 105 of file apps/common.h.
|
inline |
Constructor.
__key | command key. |
__usage | command help string. |
Definition at line 120 of file apps/common.h.
|
inlinevirtual |
Get the command key.
Implements ICommand.
Definition at line 124 of file apps/common.h.
References _key.
|
inlinevirtual |
Get the command help documentation.
[in] | format | if true the usage string SHOULD be formatted to be displayed to the user. |
Implements ICommand.
Definition at line 129 of file apps/common.h.
References _usage.
|
protected |
|
protected |