22 #ifndef COMMON_CONFIG_MANAGER_H 23 #define COMMON_CONFIG_MANAGER_H 25 #include "common/array.h" 26 #include "common/hashmap.h" 27 #include "common/path.h" 28 #include "common/singleton.h" 29 #include "common/str.h" 30 #include "common/hash-str.h" 45 class SeekableReadStream;
66 typedef StringMap::const_iterator const_iterator;
67 const_iterator
begin()
const {
return _entries.begin(); }
68 const_iterator
end()
const {
return _entries.end(); }
126 static char const *
const kCloudDomain;
233 friend class Singleton<SingletonBaseType>;
236 bool loadFallbackConfigFile(
const Path &filename);
238 void addDomain(
const String &domainName,
const Domain &domain);
240 void renameDomain(
const String &oldName,
const String &newName, DomainMap &map);
243 DomainMap _gameDomains;
244 DomainMap _miscDomains;
269 #define ConfMan Common::ConfigManager::instance() void clear(bool shrinkArray=0)
Definition: hashmap.h:427
const String & operator[](const String &key) const
Definition: config-manager.h:80
void setBool(const String &key, bool value, const String &domName=String())
HashMap< String, Domain, IgnoreCase_Hash, IgnoreCase_EqualTo > DomainMap
Definition: config-manager.h:108
static char const *const kKeymapperDomain
Definition: config-manager.h:117
Val & getVal(const Key &key)
Definition: hashmap.h:633
const Domain * getActiveDomain() const
Definition: config-manager.h:207
const String & getDomainComment() const
DomainMap::iterator endGameDomains()
Definition: config-manager.h:225
Domain * getDomain(const String &domName)
const String & getVal(const String &key) const
Definition: config-manager.h:86
bool loadConfigFile(const Path &filename, const Path &fallbackFilename)
void copyFrom(ConfigManager &source)
void addGameDomain(const String &domName)
String & getVal(const String &key)
Definition: config-manager.h:85
bool hasGameDomain(const String &domName) const
const String & getKVComment(const String &key) const
DomainMap::iterator beginGameDomains()
Definition: config-manager.h:224
const String & getActiveDomainName() const
Definition: config-manager.h:208
void addMiscDomain(const String &domName)
void setAndFlush(const String &key, const Common::String &value)
void removeMiscDomain(const String &domName)
bool loadDefaultConfigFile(const Path &fallbackFilename)
static char const *const kTransientDomain
Definition: config-manager.h:114
void renameMiscDomain(const String &oldName, const String &newName)
const DomainMap & getGameDomains() const
Definition: config-manager.h:223
bool hasKVComment(const String &key) const
void setInt(const String &key, int value, const String &domName=String())
bool isKeyTemporary(const String &key) const
bool getBool(const String &key, const String &domName=String()) const
Definition: algorithm.h:29
bool empty() const
Definition: hashmap.h:299
bool tryGetVal(const Key &key, Val &out) const
Definition: hashmap.h:688
void setFloat(const String &key, float value, const String &domName=String())
Definition: config-manager.h:59
void registerDefault(const String &key, const String &value)
int getInt(const String &key, const String &domName=String()) const
const Path & getCustomConfigFileName()
Definition: config-manager.h:227
bool contains(const Key &key) const
Definition: hashmap.h:594
void setDomainComment(const String &comment)
bool hasKey(const String &key) const
Domain * getActiveDomain()
Definition: config-manager.h:206
void removeKey(const String &key, const String &domName)
bool hasDefault(const String &key) const
bool hasMiscDomain(const String &domName) const
void removeGameDomain(const String &domName)
void erase(iterator entry)
Definition: hashmap.h:710
void clear()
Definition: config-manager.h:95
Path getPath(const String &key, const String &domName=String()) const
void setVal(const String &key, const String &value)
Definition: config-manager.h:82
bool contains(const String &key) const
Definition: config-manager.h:72
Definition: config-manager.h:55
void renameGameDomain(const String &oldName, const String &newName)
static char const *const kSessionDomain
Definition: config-manager.h:122
void setPath(const String &key, const Path &value, const String &domName=String())
Val & getOrCreateVal(const Key &key)
Definition: hashmap.h:622
void setKVComment(const String &key, const String &comment)
void setActiveDomain(const String &domName)
static char const *const kApplicationDomain
Definition: config-manager.h:111
const_iterator begin() const
Definition: config-manager.h:67
const String & getValOrDefault(const String &key) const
Definition: config-manager.h:92
void erase(const String &key)
Definition: config-manager.h:97
const_iterator end() const
Definition: config-manager.h:68
float getFloat(const String &key, const String &domName=String()) const
Definition: singleton.h:42
bool empty() const
Definition: config-manager.h:70