summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-02-03 18:08:07 +0000
committersmatz <smatz@openttd.org>2009-02-03 18:08:07 +0000
commit5ad1cd32b2f630f413646131fbdfbae85b3c72f8 (patch)
tree92c36bf040777addb4a1d7b1f21a0042daf33e26 /src/core
parentd23db8306e55b6cd471d848c6825c78c5269f5f9 (diff)
downloadopenttd-5ad1cd32b2f630f413646131fbdfbae85b3c72f8.tar.xz
(svn r15324) -Codechange: unify the class used for comparing of strings for std::map
Diffstat (limited to 'src/core')
-rw-r--r--src/core/string_compare_type.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/string_compare_type.hpp b/src/core/string_compare_type.hpp
new file mode 100644
index 000000000..c4bb71819
--- /dev/null
+++ b/src/core/string_compare_type.hpp
@@ -0,0 +1,15 @@
+/* $Id$ */
+
+/** @file string_compare_type.hpp Comparator class for "const char *" so it can be used as a key for std::map */
+
+#ifndef STRING_COMPARE_TYPE_HPP
+#define STRING_COMPARE_TYPE_HPP
+
+struct StringCompare {
+ bool operator () (const char *a, const char *b) const
+ {
+ return strcmp(a, b) < 0;
+ }
+};
+
+#endif /* STRING_COMPARE_TYPE_HPP */