#include <ConfigChecker.h>


Classes | |
| class | Param |
| Internal class. Do not use. More... | |
Public Member Functions | |
| ConfigChecker () | |
| virtual | ~ConfigChecker () |
| void | check (const Config &c) |
| String | getParamList () |
| void | addIntegerParam (const String &name, bool mandatory, bool argIsRequired, const String &desc="") |
| void | addFloatParam (const String &name, bool mandatory, bool argIsRequired, const String &desc="") |
| void | addBooleanParam (const String &name, bool mandatory, bool argIsRequired, const String &desc="") |
| void | addStringParam (const String &name, bool mandatory, bool argIsRequired, const String &desc="") |
| virtual String | getClassName () const |
Private Member Functions | |
| void | err (const String &e) const |
| void | checkName (const String &name) const |
| ConfigChecker (const ConfigChecker &) | |
| const ConfigChecker & | operator= (const ConfigChecker &c) |
| bool | operator== (const ConfigChecker &c) const |
| bool | operator!= (const ConfigChecker &c) const |
Private Attributes | |
| RefVector< Param > | _vect |
Friends | |
| class | TestConfigChecker |
Class for validating parameters of a configuration object.
Definition at line 82 of file ConfigChecker.h.
| CC::ConfigChecker | ( | ) |
Definition at line 67 of file ConfigChecker.cpp.
| CC::~ConfigChecker | ( | ) | [virtual] |
Definition at line 229 of file ConfigChecker.cpp.
| alize::ConfigChecker::ConfigChecker | ( | const ConfigChecker & | ) | [private] |
| void CC::addBooleanParam | ( | const String & | name, |
| bool | mandatory, | ||
| bool | argIsRequired, | ||
| const String & | desc = "" |
||
| ) |
Adds a boolean parameter
| name | name of the parameter |
| mandatory | true if option is mandatory in the config; false otherwise |
| argIsRequired | true if argument is mandatory for this option; false otherwise |
| desc | description. Useful for --help |
| Exception | throw if name is empty |
Definition at line 165 of file ConfigChecker.cpp.
References alize::ConfigChecker::Param::argIsRequired, alize::ConfigChecker::Param::description, alize::ConfigChecker::Param::mandatory, alize::ConfigChecker::Param::name, alize::PARAMTYPE_BOOLEAN, and alize::ConfigChecker::Param::type.
| void CC::addFloatParam | ( | const String & | name, |
| bool | mandatory, | ||
| bool | argIsRequired, | ||
| const String & | desc = "" |
||
| ) |
Adds a float parameter
| name | name of the parameter |
| mandatory | true if option is mandatory in the config; false otherwise |
| argIsRequired | true if argument is mandatory for this option; false otherwise |
| desc | description. Useful for --help |
| Exception | throw if name is empty |
Definition at line 151 of file ConfigChecker.cpp.
References alize::ConfigChecker::Param::argIsRequired, alize::ConfigChecker::Param::description, alize::ConfigChecker::Param::mandatory, alize::ConfigChecker::Param::name, alize::PARAMTYPE_FLOAT, and alize::ConfigChecker::Param::type.
| void CC::addIntegerParam | ( | const String & | name, |
| bool | mandatory, | ||
| bool | argIsRequired, | ||
| const String & | desc = "" |
||
| ) |
Adds an integer parameter
| name | name of the parameter |
| mandatory | true if option is mandatory in the config; false otherwise |
| argIsRequired | true if argument is mandatory for this option; false otherwise |
| desc | description. Useful for --help |
| Exception | throw if name is empty |
Definition at line 137 of file ConfigChecker.cpp.
References alize::ConfigChecker::Param::argIsRequired, alize::ConfigChecker::Param::description, alize::ConfigChecker::Param::mandatory, alize::ConfigChecker::Param::name, alize::PARAMTYPE_INTEGER, and alize::ConfigChecker::Param::type.
| void CC::addStringParam | ( | const String & | name, |
| bool | mandatory, | ||
| bool | argIsRequired, | ||
| const String & | desc = "" |
||
| ) |
Adds a string parameter
| name | name of the parameter |
| mandatory | true if option is mandatory in the config; false otherwise |
| argIsRequired | true if argument is mandatory for this option; false otherwise |
| desc | description. Useful for --help |
| Exception | throw if name is empty |
Definition at line 179 of file ConfigChecker.cpp.
References alize::ConfigChecker::Param::argIsRequired, alize::ConfigChecker::Param::description, alize::ConfigChecker::Param::mandatory, alize::ConfigChecker::Param::name, alize::PARAMTYPE_STRING, and alize::ConfigChecker::Param::type.
| void CC::check | ( | const Config & | c ) |
Checks a configuration
| ConfigCheckException | thrown if check fail |
| c | the config to check |
Definition at line 70 of file ConfigChecker.cpp.
References alize::ConfigChecker::Param::argIsRequired, alize::Config::existsParam(), alize::Config::getParam(), alize::String::getToken(), alize::ConfigChecker::Param::mandatory, alize::ConfigChecker::Param::name, alize::PARAMTYPE_BOOLEAN, alize::PARAMTYPE_FLOAT, alize::PARAMTYPE_INTEGER, alize::PARAMTYPE_STRING, alize::String::toBool(), alize::String::toDouble(), alize::String::toLong(), and alize::ConfigChecker::Param::type.
| void CC::checkName | ( | const String & | name ) | const [private] |
Definition at line 131 of file ConfigChecker.cpp.
References alize::String::getToken().
| void CC::err | ( | const String & | e ) | const [private] |
Definition at line 128 of file ConfigChecker.cpp.
| String CC::getClassName | ( | ) | const [virtual] |
Returns the name of the class
Implements alize::Object.
Definition at line 227 of file ConfigChecker.cpp.
| String CC::getParamList | ( | ) |
Returns the list of parameters. Useful for --help on command line
Definition at line 193 of file ConfigChecker.cpp.
References alize::ConfigChecker::Param::description, alize::String::length(), alize::ConfigChecker::Param::name, and alize::ConfigChecker::Param::type.
| bool alize::ConfigChecker::operator!= | ( | const ConfigChecker & | c ) | const [private] |
not implemented
| const ConfigChecker& alize::ConfigChecker::operator= | ( | const ConfigChecker & | c ) | [private] |
not implemented
| bool alize::ConfigChecker::operator== | ( | const ConfigChecker & | c ) | const [private] |
not implemented
friend class TestConfigChecker [friend] |
Definition at line 84 of file ConfigChecker.h.
RefVector<Param> alize::ConfigChecker::_vect [private] |
Definition at line 160 of file ConfigChecker.h.
1.7.2