mirror of
https://github.com/jwinterm/xmr-stak.git
synced 2026-10-18 05:51:45 +02:00
- rename all `xmr` to `monero` - be insensitive while check for set currency - add function to compate two strings insensitive
22 lines
411 B
C++
22 lines
411 B
C++
#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
|