Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pavel Zhukov
Kea
Commits
14c9baf0
Commit
14c9baf0
authored
Jan 07, 2011
by
Jelte Jansen
Browse files
more extensive documentation for validateCommand
parent
a104538a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/config/module_spec.h
View file @
14c9baf0
...
@@ -93,6 +93,35 @@ namespace isc { namespace config {
...
@@ -93,6 +93,35 @@ namespace isc { namespace config {
/// Validates the arguments for the given command
/// Validates the arguments for the given command
///
///
/// This checks the command and argument against the
/// specification in the module's .spec file.
///
/// A command is considered valid if:
/// - it is known (the 'command' string must have an entry in
/// the specification)
/// - the args is a MapElement
/// - args contains all mandatory arguments
/// - args does not contain unknown arguments
/// - all arguments in args match their specification
/// If all of these are true, this function returns \c true
/// If not, this method returns \c false
///
/// Example usage:
/// \code
/// ElementPtr errors = Element::createList();
/// if (module_specification_.validateCommand(cmd_str,
/// arg,
/// errors)) {
/// std::cout << "Command is valid" << std::endl;
/// } else {
/// std::cout << "Command is invalid: " << std::endl;
/// BOOST_FOREACH(ConstElementPtr error,
/// errors->listValue()) {
/// std::cout << error->stringValue() << std::endl;
/// }
/// }
/// \endcode
///
/// \param command The command to validate the arguments for
/// \param command The command to validate the arguments for
/// \param args A dict containing the command parameters
/// \param args A dict containing the command parameters
/// \param errors An ElementPtr pointing to a ListElement. Any
/// \param errors An ElementPtr pointing to a ListElement. Any
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment