Commit 0bb6cd06 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

improve doc for parseCommand()

parent 09a7dbf0
......@@ -96,17 +96,16 @@ isc::data::ConstElementPtr createCommand(const std::string& command,
/// Example code: (command_message is a ConstElementPtr that is
/// passed here)
/// \code
/// ConstElementPtr args;
/// std::string command_str;
///
/// ElementPtr command_message = Element::fromJSON("{ \"command\": [\"foo\", { \"bar\": 123 } ] }");
/// try {
/// command_str = parseCommand(args, command_message);
/// ConstElementPtr args;
/// std::string command_str = parseCommand(args, command_message);
/// if (command_str == "foo") {
/// std::cout << "The command 'foo' was given" << std::endl;
/// if (args.contains("bar")) {
/// std::cout << "It had argument name 'bar' set, which has
/// if (args->contains("bar")) {
/// std::cout << "It had argument name 'bar' set, which has"
/// << "value "
/// << args->get("bar")->stringValue();
/// << args->get("bar")->intValue();
/// }
/// } else {
/// std::cout << "Unknown command '" << command_str << std::endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment