Keos::CXMLConfigFile Class Reference

Class for quickly loading settings from a XML file. More...

#include <KeosXMLConfigFile.h>

List of all members.

Public Member Functions

 CXMLConfigFile ()
 Constructor.
virtual ~CXMLConfigFile ()
 Destructor.
bool Load (const String &strFilename)
 Load from a file name.
bool Save (const String &strFilename, ConfigOptionMap ConfigMap)
 Save ConfigOptionMap in a file.
String GetSetting (const String &strKey) const
 Get the setting value from the setting name.
SettingsMapGetSettingsMap (void)
 Get the settings map.
void Clear (void)
 Clear the settings.

Protected Attributes

SettingsMap m_Settings
 Map of all the settings.


Detailed Description

Class for quickly loading settings from a XML file.

The file must be in a format like that : <?xml version="1.0" encoding="UTF-8"?> <properties> <property name="videomode" value="1024x768"> <property name="colordepth" value="32"> <property name="fullscreen" value="no"> </properties>

Definition at line 39 of file KeosXMLConfigFile.h.


Constructor & Destructor Documentation

Keos::CXMLConfigFile::CXMLConfigFile (  ) 

Constructor.

Definition at line 32 of file KeosXMLConfigFile.cpp.

Keos::CXMLConfigFile::~CXMLConfigFile (  )  [virtual]

Destructor.

Definition at line 36 of file KeosXMLConfigFile.cpp.

References Clear().


Member Function Documentation

bool Keos::CXMLConfigFile::Load ( const String strFilename  ) 

Load from a file name.

Parameters:
strFilename Path of the XML config file.
Returns:
False if the file cannot be read, true else.

Definition at line 48 of file KeosXMLConfigFile.cpp.

References Keos::ILogger::Log(), and m_Settings.

Referenced by Keos::CRoot::RestoreConfig().

bool Keos::CXMLConfigFile::Save ( const String strFilename,
ConfigOptionMap  ConfigMap 
)

Save ConfigOptionMap in a file.

Parameters:
strFilename Path of the XML config file.
ConfigMap Map which contains the configuration options.
Returns:
False if the file cannot be saved, true else.

Definition at line 87 of file KeosXMLConfigFile.cpp.

References Keos::CSingleton< T >::Instance().

Referenced by Keos::CRoot::SaveConfig().

String Keos::CXMLConfigFile::GetSetting ( const String strKey  )  const

Get the setting value from the setting name.

Parameters:
strKey The name of the setting.
Returns:
The value of the setting.

Definition at line 134 of file KeosXMLConfigFile.cpp.

References Keos::CStringUtil::BLANK, and m_Settings.

Referenced by Keos::CRoot::RestoreConfig().

SettingsMap& Keos::CXMLConfigFile::GetSettingsMap ( void   )  [inline]

Get the settings map.

Definition at line 72 of file KeosXMLConfigFile.h.

Referenced by Keos::CRoot::RestoreConfig().

void Keos::CXMLConfigFile::Clear ( void   ) 

Clear the settings.

Definition at line 42 of file KeosXMLConfigFile.cpp.

References m_Settings.

Referenced by ~CXMLConfigFile().


Member Data Documentation

SettingsMap Keos::CXMLConfigFile::m_Settings [protected]

Map of all the settings.

Definition at line 84 of file KeosXMLConfigFile.h.

Referenced by Clear(), GetSetting(), and Load().


The documentation for this class was generated from the following files:
Generated on Fri Mar 9 14:29:30 2007 for Keos by  doxygen 1.5.1-p1