mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-20 17:03:05 +00:00
Use the new capabilities of class Map to make the ConfigManager case insensitive when it comes to comparing config keys/domains
svn-id: r11171
This commit is contained in:
parent
83a55fa7e8
commit
105728adee
@ -192,7 +192,7 @@ void ConfigManager::writeDomain(FILE *file, const String &name, const Domain &do
|
||||
|
||||
fprintf(file, "[%s]\n", name.c_str());
|
||||
|
||||
StringMap::ConstIterator x;
|
||||
Domain::ConstIterator x;
|
||||
for (x = domain.begin(); x != domain.end(); ++x) {
|
||||
const String &value = x->_value;
|
||||
if (!value.isEmpty())
|
||||
|
@ -40,23 +40,21 @@ namespace Common {
|
||||
* of some specific (or any) configuration key changes.
|
||||
*/
|
||||
class ConfigManager : public Singleton<ConfigManager> {
|
||||
struct IgnoreCaseComperator {
|
||||
int operator()(const String& x, const String& y) const { return scumm_stricmp(x.c_str(), y.c_str()); }
|
||||
};
|
||||
|
||||
public:
|
||||
class Domain : public StringMap {
|
||||
// friend class ConfigManager;
|
||||
class Domain : public Map<String, String, IgnoreCaseComperator> {
|
||||
public:
|
||||
const String &get(const String &key) const {
|
||||
Node *node = findNode(_root, key);
|
||||
return node ? node->_value : String::emptyString;
|
||||
}
|
||||
/*
|
||||
void set(const String &key, const String &value);
|
||||
void set(const String &key, int value);
|
||||
void set(const String &key, bool value);
|
||||
*/
|
||||
};
|
||||
|
||||
typedef Map<String, Domain> DomainMap;
|
||||
|
||||
typedef Map<String, Domain, IgnoreCaseComperator> DomainMap;
|
||||
|
||||
/** The name of the application domain (normally 'scummvm'). */
|
||||
static const String kApplicationDomain;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user