#include <configuration.h>
Definition at line 75 of file configuration.h.
Public Member Functions | |
virtual | ~ConfigurationObject () |
virtual void | setValue (const std::string &key, const std::string &value) |
Sets an option using a string value. | |
std::string | getValue (const std::string &key, const std::string &deflt) const |
Gets a value as string. | |
int | getValue (const std::string &key, int deflt) const |
unsigned | getValue (const std::string &key, unsigned deflt) const |
double | getValue (const std::string &key, double deflt) const |
virtual void | clear () |
Re-sets all data in the configuration. | |
template<class IT, class T, class CONT> | |
void | setList (const std::string &name, IT begin, IT end, ConfigurationListManager< T, CONT > *manager) |
Serialises a container into a list of configuration options. | |
template<class T, class CONT> | |
CONT | getList (const std::string &name, CONT empty, ConfigurationListManager< T, CONT > *manager) |
Serialises a container into a list of configuration options. | |
Protected Types | |
typedef std::map< std::string, std::string > | Options |
typedef std::list < ConfigurationObject * > | ConfigurationList |
Protected Member Functions | |
virtual void | initFromXML (xmlNodePtr node) |
virtual void | writeToXML (xmlTextWriterPtr writer) |
void | deleteList (const std::string &name) |
Protected Attributes | |
Options | mOptions |
std::map< std::string, ConfigurationList > | mContainerOptions |
Friends | |
class | Configuration |
typedef std::map<std::string, std::string> ConfigurationObject::Options [protected] |
Definition at line 173 of file configuration.h.
typedef std::list<ConfigurationObject *> ConfigurationObject::ConfigurationList [protected] |
Definition at line 176 of file configuration.h.
ConfigurationObject::~ConfigurationObject | ( | ) | [virtual] |
Definition at line 94 of file configuration.cpp.
void ConfigurationObject::setValue | ( | const std::string & | key, | |
const std::string & | value | |||
) | [virtual] |
Sets an option using a string value.
key | Option identifier. | |
value | Value. |
Reimplemented in Configuration.
Definition at line 29 of file configuration.cpp.
std::string ConfigurationObject::getValue | ( | const std::string & | key, | |
const std::string & | deflt | |||
) | const |
Gets a value as string.
key | Option identifier. | |
deflt | Default option if not there or error. |
Definition at line 50 of file configuration.cpp.
int ConfigurationObject::getValue | ( | const std::string & | key, | |
int | deflt | |||
) | const |
Definition at line 57 of file configuration.cpp.
unsigned ConfigurationObject::getValue | ( | const std::string & | key, | |
unsigned | deflt | |||
) | const |
Definition at line 63 of file configuration.cpp.
double ConfigurationObject::getValue | ( | const std::string & | key, | |
double | deflt | |||
) | const |
Definition at line 70 of file configuration.cpp.
void ConfigurationObject::clear | ( | ) | [virtual] |
void ConfigurationObject::setList | ( | const std::string & | name, | |
IT | begin, | |||
IT | end, | |||
ConfigurationListManager< T, CONT > * | manager | |||
) | [inline] |
Serialises a container into a list of configuration options.
IT | Iterator type over CONT | |
T | Elements that IT iterates over | |
CONT | The associated container type | |
name | Name of the list the elements should be stored under | |
begin | Iterator start | |
end | Iterator end | |
manager | An object capable of serialising T items |
Definition at line 124 of file configuration.h.
CONT ConfigurationObject::getList | ( | const std::string & | name, | |
CONT | empty, | |||
ConfigurationListManager< T, CONT > * | manager | |||
) | [inline] |
Serialises a container into a list of configuration options.
IT | Iterator type over CONT | |
T | Elements that IT iterates over | |
CONT | The associated container type | |
name | Name of the list the elements should be read from under | |
empty | Initial (empty) container to write to | |
manager | An object capable of deserialising items into CONT |
Definition at line 156 of file configuration.h.
void ConfigurationObject::initFromXML | ( | xmlNodePtr | node | ) | [protected, virtual] |
Definition at line 99 of file configuration.cpp.
void ConfigurationObject::writeToXML | ( | xmlTextWriterPtr | writer | ) | [protected, virtual] |
Definition at line 164 of file configuration.cpp.
void ConfigurationObject::deleteList | ( | const std::string & | name | ) | [protected] |
Definition at line 77 of file configuration.cpp.
friend class Configuration [friend] |
Definition at line 77 of file configuration.h.
Options ConfigurationObject::mOptions [protected] |
Definition at line 174 of file configuration.h.
std::map<std::string, ConfigurationList> ConfigurationObject::mContainerOptions [protected] |
Definition at line 177 of file configuration.h.