| 2 | |
| 3 | namespace util::string { |
| 4 | bool IgnoreCase::operator()(const std::string &s1, const std::string &s2) const { |
| 5 | std::string s1_lower(s1); |
| 6 | std::string s2_lower(s2); |
| 7 | std::transform(s1.begin(), s1.end(), s1_lower.begin(), ::tolower); |
| 8 | std::transform(s2.begin(), s2.end(), s2_lower.begin(), ::tolower); |
| 9 | return std::lexicographical_compare(s1_lower.begin(), s1_lower.end(), s2_lower.begin(), s2_lower.end()); |
| 10 | } |
| 11 | |
| 12 | bool IgnoreCase::operator()(const std::wstring &s1, const std::wstring &s2) const { |
| 13 | std::wstring s1_lower(s1); |