Config Class Reference

#include <Config.h>

Inherits Object, and Singleton< T >< Config >.

Inheritance diagram for Config:

Inheritance graph
[legend]
Collaboration diagram for Config:

Collaboration graph
[legend]
List of all members.

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 >

Detailed Description

Definition at line 28 of file Config.h.


Constructor & Destructor Documentation

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]

Definition at line 108 of file Config.cpp.

References _xml.


Member Function Documentation

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().

template<class T>
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.

template<class T>
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.


Friends And Related Function Documentation

friend class Singleton< Config > [friend]

Definition at line 32 of file Config.h.


Member Data Documentation

XmlDocument* Config::_xml [private]

Definition at line 56 of file Config.h.

Referenced by Config(), get(), remove(), save(), set(), and ~Config().


The documentation for this class was generated from the following files:
Generated on Thu Sep 6 20:13:32 2007 for Pylon Application Platform by  doxygen 1.5.1