#include <Config.h>
Inherits Object, and Singleton< T >< Config >.
Inheritance diagram for Config:


Public Member Functions | |
| int | save () |
| int | remove (const String &name) |
| template<class T> | |
| int | set (const String &name, const T &value) |
| template<class T> | |
| int | get (const String &name, T &value, const T &defaultValue=T()) |
Private Member Functions | |
| Config () | |
| virtual | ~Config () |
Private Attributes | |
| XmlDocument * | _xml |
Friends | |
| class | Singleton< Config > |
Definition at line 28 of file Config.h.
| Config::Config | ( | ) | [private] |
Definition at line 56 of file Config.cpp.
References _xml, CHECK_PARENT, CONFIG_PATH, ERROR, ERROR_BACKTRACE(), FAILED(), Support::failure(), Support::failureCode(), LIMIT_CSTRING_SIZE, MSG_FILE_CANNOT_CLOSE, MSG_FILE_CANNOT_OPEN, MSG_FILE_CANNOT_READ, MSG_OBJECT_CANNOT_CREATE, XmlDocument::parse(), XmlDocument::reset(), and WARNING.
| Config::~Config | ( | ) | [private, virtual] |
| int Config::save | ( | ) |
Definition at line 18 of file Config.cpp.
References _xml, CONFIG_PATH, CSTRING(), ERROR, ERROR_BACKTRACE(), FAILED(), MSG_FILE_CANNOT_CLOSE, MSG_FILE_CANNOT_OPEN, OK, XmlDocument::root(), XmlElement::toString(), and WARNING.
| int Config::remove | ( | const String & | name | ) |
Definition at line 40 of file Config.cpp.
References _xml, ERROR_BACKTRACE(), FAILED(), XmlDocument::getElementById(), OK, and XmlDocument::removeElement().
| int Config::set | ( | const String & | name, | |
| const T & | value | |||
| ) |
Definition at line 68 of file Config.h.
References _xml, XmlDocument::createElement(), ERROR_BACKTRACE(), FAILED(), XmlDocument::getElementById(), OK, XML_ATTR_ID, and XML_TAG_REGISTRY.
| int Config::get | ( | const String & | name, | |
| T & | value, | |||
| const T & | defaultValue = T() | |||
| ) |
Definition at line 87 of file Config.h.
References _xml, CSTRING(), ERROR_BACKTRACE(), FAILED(), XmlDocument::getElementById(), MSG_CONFIG_NOT_FOUND, OK, and WARNING.
XmlDocument* Config::_xml [private] |
1.5.1