Parser for commands of the default form. More...
#include <Command.h>
Public Member Functions | |
| const std::map< std::string, std::string > & | GetParameters () const |
| Get the map of parameters. More... | |
| const std::string & | GetPath () const |
| Get the path. More... | |
| const std::string & | GetVerb () const |
| Get the verb. More... | |
| bool | HasParameters () const |
| Does the command have parameters? More... | |
| bool | HasPath () const |
| Does the command have a path specified? More... | |
| bool | Is (const char *pattern) const |
| Do a case insensitive regex match on the verb. More... | |
Static Public Member Functions | |
| static void | HighlighterCallback (const std::string &input, replxx::Replxx::colors_t &colors, void *unused) |
| Highlighter callback for commands. More... | |
| static Command | Parse (std::string command) |
| Parse a string as a command. More... | |
Private Member Functions | |
| Command (const std::string &verb) | |
| Construct a new Command object. More... | |
Private Attributes | |
| std::map< std::string, std::string > | _parameters |
| Parameters. More... | |
| std::string | _path |
| Path. More... | |
| std::string | _verb |
| Verb. More... | |
Parser for commands of the default form.
Basic format is: VERB [PATH] [NAME=VALUE]...
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
Highlighter callback for commands.
| input | Input string |
| colors | Colors |
| unused | Unused parameter |
Definition at line 8 of file Command.cpp.
| bool Command::Is | ( | const char * | pattern | ) | const |
Do a case insensitive regex match on the verb.
| pattern | Regex pattern |
Definition at line 229 of file Command.cpp.
|
static |
Parse a string as a command.
| command | Command string |
Definition at line 108 of file Command.cpp.
|
private |