aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2003-11-05 00:57:00 +0000
committerMax Horn2003-11-05 00:57:00 +0000
commitd45b475b4800651fb334dd20a9c028925d825096 (patch)
tree8915c9d160f0f1f4181638bb880dce69feba40d7 /common
parentb65ac00de9d5ee262a62009ca2dd17f1cad48dce (diff)
downloadscummvm-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.cpp12
-rw-r--r--common/config-manager.h2
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;