summaryrefslogtreecommitdiffstats
path: root/source/Globals.h
diff options
context:
space:
mode:
authorlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-13 19:22:58 +0200
committerlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-07-13 19:22:58 +0200
commitf4b66cbbdbcf26461fb7104339d5d6460193029d (patch)
tree7c156f4a80c8a79495c6ea55a0b9f519341ce223 /source/Globals.h
parentThe gamemode is now only saved if it is different from the current gamemode. (diff)
downloadcuberite-f4b66cbbdbcf26461fb7104339d5d6460193029d.tar
cuberite-f4b66cbbdbcf26461fb7104339d5d6460193029d.tar.gz
cuberite-f4b66cbbdbcf26461fb7104339d5d6460193029d.tar.bz2
cuberite-f4b66cbbdbcf26461fb7104339d5d6460193029d.tar.lz
cuberite-f4b66cbbdbcf26461fb7104339d5d6460193029d.tar.xz
cuberite-f4b66cbbdbcf26461fb7104339d5d6460193029d.tar.zst
cuberite-f4b66cbbdbcf26461fb7104339d5d6460193029d.zip
Diffstat (limited to '')
-rw-r--r--source/Globals.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/Globals.h b/source/Globals.h
index 65db1b436..9b057d262 100644
--- a/source/Globals.h
+++ b/source/Globals.h
@@ -200,3 +200,15 @@ public:
+//Common functions
+//Taken from http://stackoverflow.com/questions/11635/case-insensitive-string-comparison-in-c
+inline bool iequals(const std::string& a, const std::string& b)
+{
+ unsigned int sz = a.size();
+ if (b.size() != sz)
+ return false;
+ for (unsigned int i = 0; i < sz; ++i)
+ if (tolower(a[i]) != tolower(b[i]))
+ return false;
+ return true;
+}