xoreos
0.0.5
|
Accessor for a domain (section) in a config file. More...
#include <configfile.h>
Classes | |
struct | Line |
A line in the config domain. More... | |
Public Member Functions | |
ConfigDomain (const UString &name) | |
~ConfigDomain () | |
const UString & | getName () const |
bool | hasKey (const UString &key) const |
bool | getKey (const UString &key, UString &value) const |
UString | getString (const UString &key, const UString &def="") const |
bool | getBool (const UString &key, bool def=false) const |
int | getInt (const UString &key, int def=0) const |
uint | getUint (const UString &key, uint def=0) const |
double | getDouble (const UString &key, double def=0.0) const |
void | setKey (const UString &key, const UString &value) |
void | setString (const UString &key, const UString &value) |
void | setBool (const UString &key, bool value) |
void | setInt (const UString &key, int value) |
void | setUint (const UString &key, uint value) |
void | setDouble (const UString &key, double value) |
bool | removeKey (const UString &key) |
bool | renameKey (const UString &oldName, const UString &newName) |
void | set (const ConfigDomain &domain, bool clobber=true) |
Add the keys of another domain. More... | |
Private Types | |
typedef std::list< Line > | LineList |
Private Attributes | |
UString | _name |
LineList | _lines |
The lines of the config domain. More... | |
StringIMap | _keys |
The key/value pairs of the config domain. More... | |
UString | _comment |
Comment on the same line as the domain definition. More... | |
UString | _prologue |
Comment directly above the domain. More... | |
Friends | |
class | ConfigFile |
Accessor for a domain (section) in a config file.
Definition at line 46 of file configfile.h.
|
private |
Definition at line 91 of file configfile.h.
Common::ConfigDomain::ConfigDomain | ( | const UString & | name | ) |
Definition at line 40 of file configfile.cpp.
Common::ConfigDomain::~ConfigDomain | ( | ) |
Definition at line 43 of file configfile.cpp.
bool Common::ConfigDomain::getBool | ( | const UString & | key, |
bool | def = false |
||
) | const |
Definition at line 71 of file configfile.cpp.
References Common::exceptionDispatcherWarning(), getKey(), and Common::parseString().
double Common::ConfigDomain::getDouble | ( | const UString & | key, |
double | def = 0.0 |
||
) | const |
Definition at line 116 of file configfile.cpp.
References Common::exceptionDispatcherWarning(), getKey(), and Common::parseString().
int Common::ConfigDomain::getInt | ( | const UString & | key, |
int | def = 0 |
||
) | const |
Definition at line 86 of file configfile.cpp.
References Common::exceptionDispatcherWarning(), getKey(), and Common::parseString().
Referenced by Engines::Jade::AreaLayout::updateCamera().
Definition at line 54 of file configfile.cpp.
References _keys.
Referenced by getBool(), getDouble(), getInt(), Common::ConfigManager::getKey(), getString(), and getUint().
const UString & Common::ConfigDomain::getName | ( | ) | const |
Definition at line 46 of file configfile.cpp.
References _name.
Definition at line 63 of file configfile.cpp.
References getKey().
Referenced by Engines::NWN::Tileset::loadGeneral(), Engines::NWN::Tileset::loadTile(), and Engines::Jade::AreaLayout::updateCamera().
Definition at line 101 of file configfile.cpp.
References Common::exceptionDispatcherWarning(), getKey(), and Common::parseString().
Referenced by Engines::Jade::AreaLayout::currentRoom(), Engines::NWN::Tileset::load(), Engines::NWN::Tileset::loadGeneral(), and Engines::Jade::AreaLayout::updateCamera().
bool Common::ConfigDomain::hasKey | ( | const UString & | key | ) | const |
Definition at line 50 of file configfile.cpp.
References _keys.
Referenced by Common::ConfigManager::hasKey().
bool Common::ConfigDomain::removeKey | ( | const UString & | key | ) |
Definition at line 169 of file configfile.cpp.
Definition at line 195 of file configfile.cpp.
void Common::ConfigDomain::set | ( | const ConfigDomain & | domain, |
bool | clobber = true |
||
) |
Add the keys of another domain.
domain | The domain to add. |
clobber | Overwrite existing values? |
Definition at line 230 of file configfile.cpp.
Referenced by Common::ConfigManager::setDefaults().
void Common::ConfigDomain::setBool | ( | const UString & | key, |
bool | value | ||
) |
Definition at line 153 of file configfile.cpp.
References Common::composeString(), and setKey().
void Common::ConfigDomain::setDouble | ( | const UString & | key, |
double | value | ||
) |
Definition at line 165 of file configfile.cpp.
References Common::composeString(), and setKey().
void Common::ConfigDomain::setInt | ( | const UString & | key, |
int | value | ||
) |
Definition at line 157 of file configfile.cpp.
References Common::composeString(), and setKey().
Definition at line 131 of file configfile.cpp.
Referenced by setBool(), setDouble(), setInt(), Common::ConfigManager::setKey(), setString(), and setUint().
Definition at line 149 of file configfile.cpp.
References setKey().
Referenced by Common::ConfigManager::createGame().
Definition at line 161 of file configfile.cpp.
References Common::composeString(), and setKey().
|
friend |
Definition at line 101 of file configfile.h.
|
private |
Comment on the same line as the domain definition.
Definition at line 98 of file configfile.h.
|
private |
The key/value pairs of the config domain.
Definition at line 96 of file configfile.h.
Referenced by Common::ConfigFile::addDomainKey(), getKey(), hasKey(), removeKey(), renameKey(), set(), and setKey().
|
private |
The lines of the config domain.
Definition at line 95 of file configfile.h.
Referenced by Common::ConfigFile::addDomainKey(), removeKey(), renameKey(), set(), and setKey().
|
private |
Definition at line 93 of file configfile.h.
Referenced by Common::ConfigFile::addDomain(), Common::ConfigFile::addDomainKey(), getName(), and Common::ConfigFile::renameDomain().
|
private |
Comment directly above the domain.
Definition at line 99 of file configfile.h.