From 12802f12e30f57c2a9eefca2c1a5955275c95127 Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Thu, 26 Oct 2017 20:58:27 +0200 Subject: rename `xmr` to `monero` - rename all `xmr` to `monero` - be insensitive while check for set currency - add function to compate two strings insensitive --- xmrstak/misc/utility.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 xmrstak/misc/utility.cpp (limited to 'xmrstak/misc/utility.cpp') 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 +#include + + +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 -- cgit v1.1