clang-tags
C/C++ source code indexing tool based on libclang
|
Example custom command parser. More...
Public Member Functions | |
Repeat (std::string name) | |
Constructor. | |
void | defaults () |
Set default values for keys. | |
void | run (std::ostream &cout) |
Run the command. | |
Public Member Functions inherited from Request::CommandParser | |
CommandParser (std::string name, std::string description="") | |
Constructor. | |
void | parse (std::istream &cin, std::ostream &cout, bool echo=false) |
Parse an input stream and handle key arguments. | |
void | parseJson (const Json::Value &request, std::ostream &cout) |
Parse an input stream and handle key arguments. |
Additional Inherited Members | |
Protected Member Functions inherited from Request::CommandParser | |
const std::string & | name () |
Get the command name. | |
void | setDescription (std::string description) |
Set the command description. | |
CommandParser & | add (KeyParserBase *key) |
Add a key parser to the list of parameters. | |
Protected Attributes inherited from Request::CommandParser | |
std::string | prompt_ |
Prompt used for interactive plain-text requests. |
Example custom command parser.
|
inline |
Constructor.
name | command name |
|
inlinevirtual |
Set default values for keys.
This method should be specialized to specify default key values.
Reimplemented from Request::CommandParser.
|
inlinevirtual |
Run the command.
This typically is a user-defined function. It should use key values and write results on the provided output stream.
cout | output stream for results |
Implements Request::CommandParser.