diff options
Diffstat (limited to 'common/config-manager.h')
-rw-r--r-- | common/config-manager.h | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/common/config-manager.h b/common/config-manager.h index d43a7bec51..14f911f69d 100644 --- a/common/config-manager.h +++ b/common/config-manager.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -24,7 +24,6 @@ #define COMMON_CONFIG_MANAGER_H #include "common/array.h" -//#include "common/config-file.h" #include "common/hashmap.h" #include "common/singleton.h" #include "common/str.h" @@ -47,12 +46,33 @@ class ConfigManager : public Singleton<ConfigManager> { public: - class Domain : public StringMap { + class Domain { private: + StringMap _entries; StringMap _keyValueComments; String _domainComment; public: + typedef StringMap::const_iterator const_iterator; + const_iterator begin() const { return _entries.begin(); } + const_iterator end() const { return _entries.end(); } + + bool empty() const { return _entries.empty(); } + + bool contains(const String &key) const { return _entries.contains(key); } + + String &operator[](const String &key) { return _entries[key]; } + const String &operator[](const String &key) const { return _entries[key]; } + + void setVal(const String &key, const String &value) { _entries.setVal(key, value); } + + String &getVal(const String &key) { return _entries.getVal(key); } + const String &getVal(const String &key) const { return _entries.getVal(key); } + + void clear() { _entries.clear(); } + + void erase(const String &key) { _entries.erase(key); } + void setDomainComment(const String &comment); const String &getDomainComment() const; @@ -143,7 +163,8 @@ public: bool hasMiscDomain(const String &domName) const; const DomainMap & getGameDomains() const { return _gameDomains; } - DomainMap & getGameDomains() { return _gameDomains; } + DomainMap::iterator beginGameDomains() { return _gameDomains.begin(); } + DomainMap::iterator endGameDomains() { return _gameDomains.end(); } static void defragment(); // move in memory to reduce fragmentation void copyFrom(ConfigManager &source); |