summaryrefslogtreecommitdiffstats
path: root/xmrstak/misc/utility.cpp
blob: 5177d14c23121f13e4069e4ace67acf6b1a39784 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);
					}
				);
	}
} // namespace xmrstak
OpenPOWER on IntegriCloud