aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Utilities
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-01-17 20:02:19 +0100
committerShauren <shauren.trinity@gmail.com>2015-01-17 20:03:39 +0100
commit58d75eda3a0fea8f64d434adb7707b2dfd953089 (patch)
tree82d3bf88772319e902c82f37df35c8eee53ae043 /src/server/shared/Utilities
parent17039cd92255d85edff14171397a326c6eeffd06 (diff)
Core/Commands: Added "createGameAccount" argument to .bnetaccount create command (default true) to opt out of creating the initial game account
Diffstat (limited to 'src/server/shared/Utilities')
-rw-r--r--src/server/shared/Utilities/Util.cpp7
-rw-r--r--src/server/shared/Utilities/Util.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp
index ff54237d10a..9a3d612a54b 100644
--- a/src/server/shared/Utilities/Util.cpp
+++ b/src/server/shared/Utilities/Util.cpp
@@ -24,6 +24,7 @@
#include "Errors.h" // for ASSERT
#include <stdarg.h>
#include <boost/thread/tss.hpp>
+#include <boost/algorithm/string/case_conv.hpp>
#if COMPILER == COMPILER_GNU
#include <sys/socket.h>
@@ -605,3 +606,9 @@ void HexStrToByteArray(std::string const& str, uint8* out, bool reverse /*= fals
out[j++] = strtoul(buffer, NULL, 16);
}
}
+
+bool StringToBool(std::string const& str)
+{
+ std::string lowerStr = boost::algorithm::to_lower_copy(str);
+ return lowerStr == "1" || lowerStr == "true" || lowerStr == "yes";
+}
diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h
index 4e613ecd170..26e7ef76d04 100644
--- a/src/server/shared/Utilities/Util.h
+++ b/src/server/shared/Utilities/Util.h
@@ -370,6 +370,8 @@ uint32 CreatePIDFile(const std::string& filename);
std::string ByteArrayToHexStr(uint8 const* bytes, uint32 length, bool reverse = false);
void HexStrToByteArray(std::string const& str, uint8* out, bool reverse = false);
+bool StringToBool(std::string const& str);
+
// simple class for not-modifyable list
template <typename T>
class HookList