aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/config-file.h3
-rw-r--r--common/config-manager.h19
2 files changed, 17 insertions, 5 deletions
diff --git a/common/config-file.h b/common/config-file.h
index 8b8b135232..57501b5c73 100644
--- a/common/config-file.h
+++ b/common/config-file.h
@@ -51,7 +51,8 @@ namespace Common {
*/
class ConfigFile {
public:
- typedef Map<String, bool, IgnoreCaseComparator> StringSet;
+ typedef Map<String, bool, IgnoreCase_Less> StringSet;
+ //typedef HashMap<String, bool, IgnoreCase_Hash, IgnoreCase_EqualTo> StringSet;
struct KeyValue {
String key;
diff --git a/common/config-manager.h b/common/config-manager.h
index f34328e420..452b95d3c6 100644
--- a/common/config-manager.h
+++ b/common/config-manager.h
@@ -27,16 +27,26 @@
#include "common/array.h"
//#include "common/config-file.h"
#include "common/map.h"
+#include "common/hashmap.h"
#include "common/singleton.h"
#include "common/str.h"
namespace Common {
-struct IgnoreCaseComparator {
- int operator()(const String& x, const String& y) const { return scumm_stricmp(x.c_str(), y.c_str()); }
+struct IgnoreCase_Less {
+ bool operator()(const String& x, const String& y) const { return scumm_stricmp(x.c_str(), y.c_str()) < 0; }
};
-typedef Map<String, String, IgnoreCaseComparator> StringMap;
+struct IgnoreCase_EqualTo {
+ bool operator()(const String& x, const String& y) const { return scumm_stricmp(x.c_str(), y.c_str()) == 0; }
+};
+
+struct IgnoreCase_Hash {
+ uint operator()(const String& x) const { return hashit_lower(x.c_str()); }
+};
+
+typedef Map<String, String, IgnoreCase_Less> StringMap;
+//typedef HashMap<String, String, IgnoreCase_Hash, IgnoreCase_EqualTo> StringMap;
/**
* The (singleton) configuration manager, used to query & set configuration
@@ -66,7 +76,8 @@ public:
bool hasKVComment(const String &key) const;
};
- typedef Map<String, Domain, IgnoreCaseComparator> DomainMap;
+ typedef Map<String, Domain, IgnoreCase_Less> DomainMap;
+ //typedef HashMap<String, Domain, IgnoreCase_Hash, IgnoreCase_EqualTo> DomainMap;
#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG) || defined(__GP32__))
/** The name of the application domain (normally 'scummvm'). */