Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# 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.
SettingsMap & | GetSettingsMap (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 38 of file KeosXMLConfigFile.h.

## Constructor & Destructor Documentation

Keos::CXMLConfigFile::CXMLConfigFile | ( |  | ) |

| Constructor. Definition at line 31 of file KeosXMLConfigFile.cpp.

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

| Destructor. Definition at line 36 of file KeosXMLConfigFile.cpp. References Clear().

## Member Function Documentation

void Keos::CXMLConfigFile::Clear | ( | void |  | ) |

| Clear the settings. Definition at line 42 of file KeosXMLConfigFile.cpp. References m_Settings. Referenced by ~CXMLConfigFile().

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 m_Settings.

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

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

| Get the settings map. Definition at line 71 of file KeosXMLConfigFile.h. Referenced by Keos::CRoot::RestoreConfig().

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

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

## Member Data Documentation

SettingsMap Keos::CXMLConfigFile::m_Settings`[protected]`

| Map of all the settings. Definition at line 81 of file KeosXMLConfigFile.h. Referenced by Clear(), GetSetting(), and Load().

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

- KeosEngine/KeosXMLConfigFile.h
- KeosEngine/KeosXMLConfigFile.cpp