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, ...@@ -96,17 +96,16 @@ isc::data::ConstElementPtr createCommand(const std::string& command,
/// Example code: (command_message is a ConstElementPtr that is /// Example code: (command_message is a ConstElementPtr that is
/// passed here) /// passed here)
/// \code /// \code
/// ConstElementPtr args; /// ElementPtr command_message = Element::fromJSON("{ \"command\": [\"foo\", { \"bar\": 123 } ] }");
/// std::string command_str;
///
/// try { /// try {
/// command_str = parseCommand(args, command_message); /// ConstElementPtr args;
/// std::string command_str = parseCommand(args, command_message);
/// if (command_str == "foo") { /// if (command_str == "foo") {
/// std::cout << "The command 'foo' was given" << std::endl; /// std::cout << "The command 'foo' was given" << std::endl;
/// if (args.contains("bar")) { /// if (args->contains("bar")) {
/// std::cout << "It had argument name 'bar' set, which has /// std::cout << "It had argument name 'bar' set, which has"
/// << "value " /// << "value "
/// << args->get("bar")->stringValue(); /// << args->get("bar")->intValue();
/// } /// }
/// } else { /// } else {
/// std::cout << "Unknown command '" << command_str << std::endl; /// 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