The syntax for the arguments looks like this:
$ hey foo create string with name bar value 'Hello, World!'
Then, you can manipulate the server and object with the following commands:
$ hey foo list
string
strings
$ hey foo list strings
bar
$ hey foo get value of string bar
Hello, World!
$ hey foo delete string bar
ok
$ hey foo list strings
$
Definition at line 145 of file HeyParser.hh.
Public Types | |
enum | hp_what_t { SHUTDOWN, LIST_PROPERTIES, GET_PROPERTY, SET_PROPERTY, CREATE_PROPERTY, DELETE_PROPERTY, EXECUTE_PROPERTY, GET_SUITES, WHAT_MAX } |
Public Member Functions | |
HeyParser (int argc, const char *argv[]) throw (HeyParserException) | |
Construct a parser that interprets the given command-line arguments. | |
virtual | ~HeyParser (void) |
Deconstruct a parser object. | |
int | getArgCount (void) const |
const char ** | getArgValues (void) const |
const char * | who (void) const |
hp_what_t | what (void) const |
void | popProperty (const char *&name_out, const char *&value_out) throw (HeyParserException) |
Pop a pair from the property stack. | |
const char * | to (void) const |
void | with (const char **&with_out, size_t &count_out) const |
Get the argument array containing the 'with' name/value pairs. | |
const char * | withValue (const char *name, unsigned int instance=0, const char *default_value=NULL) const throw (HeyParserException) |
Get the value for a particular 'with' argument. | |
Static Public Attributes | |
const char * | hp_what_strings [WHAT_MAX] |
String versions of the hp_what_t enumeration values. | |
Private Member Functions | |
const char * | consumeArg (void) throw (HeyParserException) |
Consume an argument from the argument list. | |
void | nextProperty (const char *&name_out, const char *&value_out) throw (HeyParserException) |
Find the next name/value pair in the argument list. | |
Private Attributes | |
int | hp_ArgCount |
The arguments count. | |
const char ** | hp_ArgValue |
The argument values. | |
hp_what_t | hp_What |
The "what" value. | |
const char * | hp_ToValue |
The 'to' value for a SET_PROPERTY request. | |
int | hp_ArgIndex |
The current index in the argument list during processing. | |
stack< struct Pair > | hp_PropertyStack |
The stack of property pairs. |
|
Definition at line 154 of file HeyParser.hh. Referenced by what(). |
|
Construct a parser that interprets the given command-line arguments. Most of the parsing will be done here so there are fewer surprises along the way. Note that the object expects all of the arguments, including the command name.
Definition at line 38 of file HeyParser.cc. References ensure, HeyParser::Pair::p_Name, HeyParser::Pair::p_Value, and require. |
|
Consume an argument from the argument list. This method is for internal use when initially processing the argument list.
Definition at line 182 of file HeyParser.cc. |
|
Definition at line 196 of file HeyParser.hh. References hp_ArgCount. Referenced by afFactoryLibraryHey(). |
|
Definition at line 204 of file HeyParser.hh. References hp_ArgValue. Referenced by afFactoryLibraryHey(). |
|
Find the next name/value pair in the argument list. This method differs from popProperty() in that it translates from the argument list to hp_PropertyStack. Whereas popProperty() interacts only with hp_PropertyStack.
Definition at line 198 of file HeyParser.cc. |
|
Pop a pair from the property stack.
Definition at line 245 of file HeyParser.cc. References HeyParser::Pair::p_Name, and HeyParser::Pair::p_Value. Referenced by afAllupHey(), bfHey(), bfManagerHey(), bfRealTimeTaskHey(), dfDelegateHey(), dfHey(), pfHey(), pfStrictPolicyHey(), qfKernelHey(), qfValueSCHey(), and tfHey(). |
|
Definition at line 240 of file HeyParser.hh. References hp_ToValue. Referenced by bfManagerHey(), bfRealTimeTaskHey(), dfDelegateHey(), pfStrictPolicyHey(), and qfValueSCHey(). |
|
Definition at line 220 of file HeyParser.hh. References hp_What, and hp_what_t. Referenced by afAllupHey(), bfHey(), bfManagerHey(), bfRealTimeTaskHey(), dfDelegateHey(), dfHey(), pfHey(), pfStrictPolicyHey(), qfKernelHey(), qfValueSCHey(), and tfHey(). |
|
Definition at line 212 of file HeyParser.hh. References hp_ArgValue. Referenced by afAllupHey(), afFactoryLibraryHey(), bfManagerHey(), bfRealTimeTaskHey(), dfDelegateHey(), pfStrictPolicyHey(), qfKernelHey(), and qfValueSCHey(). |
|
Get the argument array containing the 'with' name/value pairs.
Definition at line 264 of file HeyParser.cc. References hp_ArgCount, hp_ArgIndex, and hp_ArgValue. Referenced by bfManagerHey(), and bfRealTimeTaskHey(). |
|
Get the value for a particular 'with' argument.
Definition at line 270 of file HeyParser.cc. References require. Referenced by afAllupHey(), bfHey(), bfManagerHey(), bfRealTimeTaskHey(), dfDelegateHey(), pfHey(), and qfKernelHey(). |
|
The "what" value. This will only be set by the constructor when it is initially parsing the arguments. Definition at line 352 of file HeyParser.hh. Referenced by what(). |
|
Initial value: { "shutdown", "list", "get", "set", "create", "delete", "execute", "getsuites", }
Definition at line 27 of file HeyParser.cc. |