Classes | Public Member Functions | Private Member Functions | Private Attributes | Friends

alize::ConfigChecker Class Reference

#include <ConfigChecker.h>

Inheritance diagram for alize::ConfigChecker:
Inheritance graph
[legend]
Collaboration diagram for alize::ConfigChecker:
Collaboration graph
[legend]

List of all members.

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 ConfigCheckeroperator= (const ConfigChecker &c)
bool operator== (const ConfigChecker &c) const
bool operator!= (const ConfigChecker &c) const

Private Attributes

RefVector< Param_vect

Friends

class TestConfigChecker

Detailed Description

Class for validating parameters of a configuration object.

Author:
Frederic Wils frederic.wils@lia.univ-avignon.fr
Version:
1.0
Date:
2005

Definition at line 82 of file ConfigChecker.h.


Constructor & Destructor Documentation

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]

Member Function Documentation

void CC::addBooleanParam ( const String name,
bool  mandatory,
bool  argIsRequired,
const String desc = "" 
)

Adds a boolean parameter

Parameters:
namename of the parameter
mandatorytrue if option is mandatory in the config; false otherwise
argIsRequiredtrue if argument is mandatory for this option; false otherwise
descdescription. Useful for --help
Exceptions:
Exceptionthrow 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

Parameters:
namename of the parameter
mandatorytrue if option is mandatory in the config; false otherwise
argIsRequiredtrue if argument is mandatory for this option; false otherwise
descdescription. Useful for --help
Exceptions:
Exceptionthrow 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

Parameters:
namename of the parameter
mandatorytrue if option is mandatory in the config; false otherwise
argIsRequiredtrue if argument is mandatory for this option; false otherwise
descdescription. Useful for --help
Exceptions:
Exceptionthrow 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

Parameters:
namename of the parameter
mandatorytrue if option is mandatory in the config; false otherwise
argIsRequiredtrue if argument is mandatory for this option; false otherwise
descdescription. Useful for --help
Exceptions:
Exceptionthrow 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 )
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

Returns:
the name of the class of the object as a String

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

Returns:
the list of parameters

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


Friends And Related Function Documentation

friend class TestConfigChecker [friend]

Definition at line 84 of file ConfigChecker.h.


Member Data Documentation

Definition at line 160 of file ConfigChecker.h.


The documentation for this class was generated from the following files: