diff options
author | Max Horn | 2003-11-05 00:57:00 +0000 |
---|---|---|
committer | Max Horn | 2003-11-05 00:57:00 +0000 |
commit | d45b475b4800651fb334dd20a9c028925d825096 (patch) | |
tree | 8915c9d160f0f1f4181638bb880dce69feba40d7 /common | |
parent | b65ac00de9d5ee262a62009ca2dd17f1cad48dce (diff) | |
download | scummvm-rg350-d45b475b4800651fb334dd20a9c028925d825096.tar.gz scummvm-rg350-d45b475b4800651fb334dd20a9c028925d825096.tar.bz2 scummvm-rg350-d45b475b4800651fb334dd20a9c028925d825096.zip |
added ConfigManager::removeKey
svn-id: r11140
Diffstat (limited to 'common')
-rw-r--r-- | common/config-manager.cpp | 12 | ||||
-rw-r--r-- | common/config-manager.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/common/config-manager.cpp b/common/config-manager.cpp index 2ee1c20ced..dc29cec8c9 100644 --- a/common/config-manager.cpp +++ b/common/config-manager.cpp @@ -239,6 +239,18 @@ bool ConfigManager::hasKey(const String &key, const String &dom) const { } +void ConfigManager::removeKey(const String &key, const String &dom) { + assert(!dom.isEmpty()); + + if (_gameDomains.contains(dom)) + _gameDomains[dom].remove(key); + else if (_globalDomains.contains(dom)) + _globalDomains[dom].remove(key); + else + error("Removing key '%s' from non-existant domain '%s'", key.c_str(), dom.c_str()); +} + + #pragma mark - diff --git a/common/config-manager.h b/common/config-manager.h index bede2a3529..8147df5ebd 100644 --- a/common/config-manager.h +++ b/common/config-manager.h @@ -63,6 +63,8 @@ public: bool hasKey(const String &key) const; bool hasKey(const String &key, const String &dom) const; + void removeKey(const String &key, const String &dom); + const String & get(const String &key) const; const String & get(const String &key, const String &dom) const; int getInt(const String &key, const String &dom = String::emptyString) const; |