summaryrefslogtreecommitdiffstats
path: root/xmrstak/misc/utility.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xmrstak/misc/utility.cpp')
-rw-r--r--xmrstak/misc/utility.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/xmrstak/misc/utility.cpp b/xmrstak/misc/utility.cpp
new file mode 100644
index 0000000..3b1369a
--- /dev/null
+++ b/xmrstak/misc/utility.cpp
@@ -0,0 +1,21 @@
+#include <string>
+#include <algorithm>
+
+
+namespace xmrstak
+{
+ bool strcmp_i(const std::string& str1, const std::string& str2)
+ {
+ if(str1.size() != str2.size())
+ return false;
+ else
+ return (str1.empty() | str2.empty()) ?
+ false :
+ std::equal(str1.begin(), str1.end(),str2.begin(),
+ [](char c1, char c2)
+ {
+ return ::tolower(c1) == ::tolower(c2);
+ }
+ );
+ }
+} // namepsace xmrstak
OpenPOWER on IntegriCloud