mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Common: Add utility function for case-insensitive string comparison.
This commit is contained in:
@ -704,4 +704,12 @@ void ToUpper(std::string* str)
|
||||
{
|
||||
std::transform(str->begin(), str->end(), str->begin(), [](char c) { return Common::ToUpper(c); });
|
||||
}
|
||||
|
||||
bool CaseInsensitiveEquals(std::string_view a, std::string_view b)
|
||||
{
|
||||
if (a.size() != b.size())
|
||||
return false;
|
||||
return std::equal(a.begin(), a.end(), b.begin(),
|
||||
[](char ca, char cb) { return Common::ToLower(ca) == Common::ToLower(cb); });
|
||||
}
|
||||
} // namespace Common
|
||||
|
Reference in New Issue
Block a user