From d45b475b4800651fb334dd20a9c028925d825096 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 5 Nov 2003 00:57:00 +0000 Subject: added ConfigManager::removeKey svn-id: r11140 --- common/config-manager.cpp | 12 ++++++++++++ common/config-manager.h | 2 ++ 2 files changed, 14 insertions(+) (limited to 'common') 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; -- cgit v1.2.3