Configuration Parser.
More...
#include <Configuration.h>
List of all members.
Detailed Description
Configuration Parser.
Parses and interprets Configuration data stored in XML files (e.g., config.xml).
Member Typedef Documentation
Constructor & Destructor Documentation
| Configuration::Configuration |
( |
|
) |
|
| Configuration::~Configuration |
( |
|
) |
|
Member Function Documentation
| void Configuration::clearGuiOption |
( |
const std::string & |
key |
) |
|
| void Configuration::clearGuiPosition |
( |
const std::string & |
key |
) |
|
| int Configuration::getAudioBufferSize |
( |
|
) |
const |
Returns the audio Buffer Length.
| int Configuration::getAudioMixRate |
( |
|
) |
const |
Returns the Audio Rate that should be used by the Mixer.
| int Configuration::getAudioMusicVolume |
( |
|
) |
const |
Returns the Volume Level for Music.
| int Configuration::getAudioSfxVolume |
( |
|
) |
const |
Returns the Volume Level for Sound Effects.
| int Configuration::getAudioStereoChannels |
( |
|
) |
const |
| int Configuration::getGraphicsColorDepth |
( |
|
) |
const |
| int Configuration::getGraphicsHeight |
( |
|
) |
const |
| int Configuration::getGraphicsTextureQuality |
( |
|
) |
const |
Returns texture render quality.
- Note:
- Equivalent to GL_NEAREST or GL_LINEAR
| int Configuration::getGraphicsWidth |
( |
|
) |
const |
| string Configuration::getGuiOption |
( |
const std::string & |
key |
) |
|
Gets a GUI option value given a key.
- Parameters:
-
| key | An alphanumeric key to search for. |
- Returns:
- A string containing the requested value. An empty string if the requested value was not found.
- Note:
- The search is case sensistive.
| AbsCoordinate Configuration::getGuiPosition |
( |
const std::string & |
key |
) |
|
Gets a GUI Position value given a key.
- Parameters:
-
| key | An alphanumeric key to search for. |
- Returns:
- An AbsCoordinate object. An empty AbsCoordinate object if the requested value was not found.
- Note:
- The search is case sensistive.
| std::string Configuration::getRenderer |
( |
|
) |
const |
| void Configuration::isGraphicsFullscreen |
( |
bool |
isFullscreen |
) |
|
Toggles between windowed and fullscreen mode.
- Todo:
- Needs proper value and error checking.
| bool Configuration::isGraphicsFullscreen |
( |
|
) |
const |
Returns true if fullscreen mode is requested.
| bool Configuration::isVsyncEnabled |
( |
|
) |
const |
Returns true if vsync mode is requested.
| void Configuration::isVsyncEnabled |
( |
bool |
isVsync |
) |
|
Toggles the use of Vertical Sync.
- Todo:
- Needs proper value and error checking.
| void Configuration::loadConfig |
( |
const std::string & |
filePath |
) |
|
Loads a configuration file.
- Parameters:
-
| filePath | A string indicating the file to load and process for configuration. |
| bool Configuration::parseAudio |
( |
TiXmlNode * |
node |
) |
[private] |
Parses audio information from an XML node.
| bool Configuration::parseGraphics |
( |
TiXmlNode * |
node |
) |
[private] |
Parse the <graphics> tab.
- Todo:
- Check for sane configurations, particularly screen resolution.
| bool Configuration::parseGuiOption |
( |
TiXmlNode * |
node |
) |
[private] |
| bool Configuration::parseGuiOptions |
( |
TiXmlNode * |
node |
) |
[private] |
| bool Configuration::parseGuiPosition |
( |
TiXmlNode * |
node |
) |
[private] |
| bool Configuration::readConfig |
( |
const std::string & |
filePath |
) |
[private] |
| void Configuration::saveConfig |
( |
|
) |
|
| void Configuration::setAudioBufferSize |
( |
int |
audioBuffer |
) |
|
Sets the size of the audio buffer.
- Todo:
- Needs proper value and error checking.
| void Configuration::setAudioMixRate |
( |
int |
mixrate |
) |
|
Sets the audio mixrate.
- Todo:
- Needs proper value and error checking.
| void Configuration::setAudioMusicVolume |
( |
int |
musicVolume |
) |
|
Sets the Music volume.
- Todo:
- Needs proper value and error checking.
| void Configuration::setAudioSfxVolume |
( |
int |
sfxVolume |
) |
|
Sets the Sound Effects volume.
- Todo:
- Needs proper value and error checking.
| void Configuration::setAudioStereoChannels |
( |
int |
channels |
) |
|
Sets the number of sound channels.
- Todo:
- Needs proper value and error checking.
| void Configuration::setDefaultValues |
( |
|
) |
|
Sets default values for all important values.
| void Configuration::setGraphicsColorDepth |
( |
int |
bpp |
) |
|
Sets the screen depth.
- Todo:
- Needs proper value and error checking.
| void Configuration::setGraphicsHeight |
( |
int |
height |
) |
|
Sets the screen height.
- Todo:
- Needs proper value and error checking.
| void Configuration::setGraphicsTextureQuality |
( |
const std::string & |
quality |
) |
|
| void Configuration::setGraphicsWidth |
( |
int |
width |
) |
|
Sets the screen width.
- Todo:
- Needs proper value and error checking.
| void Configuration::setGuiOption |
( |
const std::string & |
key, |
|
|
const std::string & |
value | |
|
) |
| | |
Sets a GUI Option.
- Parameters:
-
| key | Name of the option to set. |
| value | Value to give the named option. |
| void Configuration::setGuiPosition |
( |
const std::string & |
key, |
|
|
const AbsCoordinate & |
position | |
|
) |
| | |
Sets a GUI Position.
- Parameters:
-
| key | Name of the option to set. |
| position | Coordinates of a named object. |
| void Configuration::writeConfig |
( |
|
) |
[private] |
Writes all stored values to disk.
Member Data Documentation
Flags whether or not an option was changed.
Either AUDIO_STEREO or AUDIO_MONO
Texture render quality -- equivalent to GL_NEAREST and GL_LINEAR
The documentation for this class was generated from the following files: