Browse Source

improve doc for parseCommand()

Jelte Jansen 14 years ago
parent
commit
0bb6cd0687
1 changed files with 6 additions and 7 deletions
  1. 6 7
      src/lib/config/ccsession.h

+ 6 - 7
src/lib/config/ccsession.h

@@ -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;