xoreos  0.0.5
Classes | Public Member Functions | Private Types | Private Attributes | Friends | List of all members
Common::ConfigDomain Class Reference

Accessor for a domain (section) in a config file. More...

#include <configfile.h>

Collaboration diagram for Common::ConfigDomain:
Collaboration graph
[legend]

Classes

struct  Line
 A line in the config domain. More...
 

Public Member Functions

 ConfigDomain (const UString &name)
 
 ~ConfigDomain ()
 
const UStringgetName () 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< LineLineList
 

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
 

Detailed Description

Accessor for a domain (section) in a config file.

Definition at line 46 of file configfile.h.

Member Typedef Documentation

◆ LineList

typedef std::list<Line> Common::ConfigDomain::LineList
private

Definition at line 91 of file configfile.h.

Constructor & Destructor Documentation

◆ ConfigDomain()

Common::ConfigDomain::ConfigDomain ( const UString name)

Definition at line 40 of file configfile.cpp.

◆ ~ConfigDomain()

Common::ConfigDomain::~ConfigDomain ( )

Definition at line 43 of file configfile.cpp.

Member Function Documentation

◆ getBool()

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

Here is the call graph for this function:

◆ getDouble()

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

Here is the call graph for this function:

◆ getInt()

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getKey()

bool Common::ConfigDomain::getKey ( const UString key,
UString value 
) const

Definition at line 54 of file configfile.cpp.

References _keys.

Referenced by getBool(), getDouble(), getInt(), Common::ConfigManager::getKey(), getString(), and getUint().

Here is the caller graph for this function:

◆ getName()

const UString & Common::ConfigDomain::getName ( ) const

Definition at line 46 of file configfile.cpp.

References _name.

◆ getString()

UString Common::ConfigDomain::getString ( const UString key,
const UString def = "" 
) const

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUint()

uint Common::ConfigDomain::getUint ( const UString key,
uint  def = 0 
) const

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasKey()

bool Common::ConfigDomain::hasKey ( const UString key) const

Definition at line 50 of file configfile.cpp.

References _keys.

Referenced by Common::ConfigManager::hasKey().

Here is the caller graph for this function:

◆ removeKey()

bool Common::ConfigDomain::removeKey ( const UString key)

Definition at line 169 of file configfile.cpp.

References _keys, and _lines.

◆ renameKey()

bool Common::ConfigDomain::renameKey ( const UString oldName,
const UString newName 
)

Definition at line 195 of file configfile.cpp.

References _keys, and _lines.

◆ set()

void Common::ConfigDomain::set ( const ConfigDomain domain,
bool  clobber = true 
)

Add the keys of another domain.

Parameters
domainThe domain to add.
clobberOverwrite existing values?

Definition at line 230 of file configfile.cpp.

References _keys, and _lines.

Referenced by Common::ConfigManager::setDefaults().

Here is the caller graph for this function:

◆ setBool()

void Common::ConfigDomain::setBool ( const UString key,
bool  value 
)

Definition at line 153 of file configfile.cpp.

References Common::composeString(), and setKey().

Here is the call graph for this function:

◆ setDouble()

void Common::ConfigDomain::setDouble ( const UString key,
double  value 
)

Definition at line 165 of file configfile.cpp.

References Common::composeString(), and setKey().

Here is the call graph for this function:

◆ setInt()

void Common::ConfigDomain::setInt ( const UString key,
int  value 
)

Definition at line 157 of file configfile.cpp.

References Common::composeString(), and setKey().

Here is the call graph for this function:

◆ setKey()

void Common::ConfigDomain::setKey ( const UString key,
const UString value 
)

Definition at line 131 of file configfile.cpp.

References _keys, and _lines.

Referenced by setBool(), setDouble(), setInt(), Common::ConfigManager::setKey(), setString(), and setUint().

Here is the caller graph for this function:

◆ setString()

void Common::ConfigDomain::setString ( const UString key,
const UString value 
)

Definition at line 149 of file configfile.cpp.

References setKey().

Referenced by Common::ConfigManager::createGame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUint()

void Common::ConfigDomain::setUint ( const UString key,
uint  value 
)

Definition at line 161 of file configfile.cpp.

References Common::composeString(), and setKey().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ ConfigFile

friend class ConfigFile
friend

Definition at line 101 of file configfile.h.

Member Data Documentation

◆ _comment

UString Common::ConfigDomain::_comment
private

Comment on the same line as the domain definition.

Definition at line 98 of file configfile.h.

◆ _keys

StringIMap Common::ConfigDomain::_keys
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().

◆ _lines

LineList Common::ConfigDomain::_lines
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().

◆ _name

UString Common::ConfigDomain::_name
private

◆ _prologue

UString Common::ConfigDomain::_prologue
private

Comment directly above the domain.

Definition at line 99 of file configfile.h.


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