ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

The (singleton) configuration manager, used to query & set configuration values using string keys. More...

#include <config-manager.h>

Inheritance diagram for Common::ConfigManager:
Collaboration diagram for Common::ConfigManager:

List of all members.

Classes

class  Domain

Public Types

typedef HashMap< String,
Domain, IgnoreCase_Hash,
IgnoreCase_EqualTo
DomainMap

Public Member Functions

void loadDefaultConfigFile ()
void loadConfigFile (const String &filename)
DomaingetDomain (const String &domName)
 Retrieve the config domain with the given name.
const DomaingetDomain (const String &domName) const
bool hasKey (const String &key) const
const Stringget (const String &key) const
void set (const String &key, const String &value)
bool hasKey (const String &key, const String &domName) const
const Stringget (const String &key, const String &domName) const
void set (const String &key, const String &value, const String &domName)
void removeKey (const String &key, const String &domName)
int getInt (const String &key, const String &domName=String()) const
bool getBool (const String &key, const String &domName=String()) const
void setInt (const String &key, int value, const String &domName=String())
void setBool (const String &key, bool value, const String &domName=String())
void registerDefault (const String &key, const String &value)
void registerDefault (const String &key, const char *value)
void registerDefault (const String &key, int value)
void registerDefault (const String &key, bool value)
void flushToDisk ()
void setActiveDomain (const String &domName)
DomaingetActiveDomain ()
const DomaingetActiveDomain () const
const StringgetActiveDomainName () const
void addGameDomain (const String &domName)
void removeGameDomain (const String &domName)
void renameGameDomain (const String &oldName, const String &newName)
void addMiscDomain (const String &domName)
void removeMiscDomain (const String &domName)
void renameMiscDomain (const String &oldName, const String &newName)
bool hasGameDomain (const String &domName) const
bool hasMiscDomain (const String &domName) const
const DomainMapgetGameDomains () const
DomainMap::iterator beginGameDomains ()
DomainMap::iterator endGameDomains ()
void copyFrom (ConfigManager &source)

Static Public Member Functions

static void defragment ()

Static Public Attributes

static char const *const kApplicationDomain = "residualvm"
 The name of the application domain (normally 'scummvm').
static char const *const kTransientDomain = "__TRANSIENT"
 The transient (pseudo) domain.

Private Member Functions

 ConfigManager ()
void loadFromStream (SeekableReadStream &stream)
void addDomain (const String &domainName, const Domain &domain)
 Add a ready-made domain based on its name and contents The domain name should not already exist in the ConfigManager.
void writeDomain (WriteStream &stream, const String &name, const Domain &domain)
void renameDomain (const String &oldName, const String &newName, DomainMap &map)
 Common private function to rename both game and misc domains.

Private Attributes

Domain _transientDomain
DomainMap _gameDomains
DomainMap _miscDomains
Domain _appDomain
Domain _defaultsDomain
Array< String_domainSaveOrder
String _activeDomainName
Domain_activeDomain
String _filename

Friends

class Singleton< SingletonBaseType >

Detailed Description

The (singleton) configuration manager, used to query & set configuration values using string keys.

Todo:
Implement the callback based notification system (outlined below) which sends out notifications to interested parties whenever the value of some specific (or any) configuration key changes.

Definition at line 45 of file config-manager.h.


Member Typedef Documentation


Constructor & Destructor Documentation

Common::ConfigManager::ConfigManager (  )  [private]

Definition at line 55 of file config-manager.cpp.


Member Function Documentation

void Common::ConfigManager::addDomain ( const String domainName,
const Domain domain 
) [private]

Add a ready-made domain based on its name and contents The domain name should not already exist in the ConfigManager.

Definition at line 122 of file config-manager.cpp.

void Common::ConfigManager::addGameDomain ( const String domName  ) 

Definition at line 631 of file config-manager.cpp.

void Common::ConfigManager::addMiscDomain ( const String domName  ) 

Definition at line 645 of file config-manager.cpp.

DomainMap::iterator Common::ConfigManager::beginGameDomains (  )  [inline]

Definition at line 171 of file config-manager.h.

void Common::ConfigManager::copyFrom ( ConfigManager source  ) 

Definition at line 65 of file config-manager.cpp.

void Common::ConfigManager::defragment (  )  [static]

Definition at line 58 of file config-manager.cpp.

DomainMap::iterator Common::ConfigManager::endGameDomains (  )  [inline]

Definition at line 172 of file config-manager.h.

void Common::ConfigManager::flushToDisk (  ) 

Definition at line 259 of file config-manager.cpp.

const String & Common::ConfigManager::get ( const String key  )  const

Definition at line 467 of file config-manager.cpp.

const String & Common::ConfigManager::get ( const String key,
const String domName 
) const

Definition at line 478 of file config-manager.cpp.

Domain* Common::ConfigManager::getActiveDomain (  )  [inline]

Definition at line 155 of file config-manager.h.

const Domain* Common::ConfigManager::getActiveDomain (  )  const [inline]

Definition at line 156 of file config-manager.h.

const String& Common::ConfigManager::getActiveDomainName (  )  const [inline]

Definition at line 157 of file config-manager.h.

bool Common::ConfigManager::getBool ( const String key,
const String domName = String() 
) const

Definition at line 518 of file config-manager.cpp.

const ConfigManager::Domain * Common::ConfigManager::getDomain ( const String domName  )  const

Definition at line 368 of file config-manager.cpp.

ConfigManager::Domain * Common::ConfigManager::getDomain ( const String domName  ) 

Retrieve the config domain with the given name.

Parameters:
domName the name of the domain to retrieve
Returns:
pointer to the domain, or 0 if the domain doesn't exist.

Definition at line 392 of file config-manager.cpp.

const DomainMap& Common::ConfigManager::getGameDomains (  )  const [inline]

Definition at line 170 of file config-manager.h.

int Common::ConfigManager::getInt ( const String key,
const String domName = String() 
) const

Definition at line 497 of file config-manager.cpp.

bool Common::ConfigManager::hasGameDomain ( const String domName  )  const

Definition at line 703 of file config-manager.cpp.

bool Common::ConfigManager::hasKey ( const String key,
const String domName 
) const

Definition at line 439 of file config-manager.cpp.

bool Common::ConfigManager::hasKey ( const String key  )  const

Definition at line 420 of file config-manager.cpp.

bool Common::ConfigManager::hasMiscDomain ( const String domName  )  const

Definition at line 708 of file config-manager.cpp.

void Common::ConfigManager::loadConfigFile ( const String filename  ) 

Definition at line 105 of file config-manager.cpp.

void Common::ConfigManager::loadDefaultConfigFile (  ) 

Definition at line 84 of file config-manager.cpp.

void Common::ConfigManager::loadFromStream ( SeekableReadStream stream  )  [private]

Definition at line 159 of file config-manager.cpp.

void Common::ConfigManager::registerDefault ( const String key,
int  value 
)

Definition at line 609 of file config-manager.cpp.

void Common::ConfigManager::registerDefault ( const String key,
bool  value 
)

Definition at line 613 of file config-manager.cpp.

void Common::ConfigManager::registerDefault ( const String key,
const String value 
)

Definition at line 601 of file config-manager.cpp.

void Common::ConfigManager::registerDefault ( const String key,
const char *  value 
)

Definition at line 605 of file config-manager.cpp.

void Common::ConfigManager::removeGameDomain ( const String domName  ) 

Definition at line 652 of file config-manager.cpp.

void Common::ConfigManager::removeKey ( const String key,
const String domName 
)

Definition at line 453 of file config-manager.cpp.

void Common::ConfigManager::removeMiscDomain ( const String domName  ) 

Definition at line 662 of file config-manager.cpp.

void Common::ConfigManager::renameDomain ( const String oldName,
const String newName,
DomainMap map 
) [private]

Common private function to rename both game and misc domains.

Definition at line 684 of file config-manager.cpp.

void Common::ConfigManager::renameGameDomain ( const String oldName,
const String newName 
)

Definition at line 669 of file config-manager.cpp.

void Common::ConfigManager::renameMiscDomain ( const String oldName,
const String newName 
)

Definition at line 677 of file config-manager.cpp.

void Common::ConfigManager::set ( const String key,
const String value 
)

Definition at line 532 of file config-manager.cpp.

void Common::ConfigManager::set ( const String key,
const String value,
const String domName 
)

Definition at line 544 of file config-manager.cpp.

void Common::ConfigManager::setActiveDomain ( const String domName  ) 

Definition at line 621 of file config-manager.cpp.

void Common::ConfigManager::setBool ( const String key,
bool  value,
const String domName = String() 
)

Definition at line 593 of file config-manager.cpp.

void Common::ConfigManager::setInt ( const String key,
int  value,
const String domName = String() 
)

Definition at line 589 of file config-manager.cpp.

void Common::ConfigManager::writeDomain ( WriteStream stream,
const String name,
const Domain domain 
) [private]

Definition at line 322 of file config-manager.cpp.


Friends And Related Function Documentation

friend class Singleton< SingletonBaseType > [friend]

Definition at line 178 of file config-manager.h.


Member Data Documentation

Definition at line 203 of file config-manager.h.

Definition at line 189 of file config-manager.h.

Definition at line 190 of file config-manager.h.

Definition at line 205 of file config-manager.h.

Definition at line 187 of file config-manager.h.

Definition at line 188 of file config-manager.h.

Definition at line 186 of file config-manager.h.

char const *const Common::ConfigManager::kApplicationDomain = "residualvm" [static]

The name of the application domain (normally 'scummvm').

Definition at line 87 of file config-manager.h.

char const *const Common::ConfigManager::kTransientDomain = "__TRANSIENT" [static]

The transient (pseudo) domain.

Definition at line 90 of file config-manager.h.


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


Generated on Sat Mar 16 2019 05:05:31 for ResidualVM by doxygen 1.7.1
curved edge   curved edge