summaryrefslogtreecommitdiff
path: root/Source/Core/Common/StringUtil.cpp
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2023-02-28 01:17:05 +0100
committerGitHub <noreply@github.com>2023-02-28 01:17:05 +0100
commit73aaa01648dba5f9d13db9e21bfb29d41b1b8f81 (patch)
tree1a5fd580e407584646c65e3ca577cc0f219342fc /Source/Core/Common/StringUtil.cpp
parent7586fc8134cee5c0d428b7ca2bf0e6d1cf103cf3 (diff)
parenta0974c18cd4a445940c737bf52904db3fc56c39e (diff)
Merge pull request #11444 from AdmiralCurtiss/riivolution-linux-host-fs
RiivolutionPatcher: Use capitalization of file that exists in the host file system if possible.
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
-rw-r--r--Source/Core/Common/StringUtil.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp
index 1277a18f72..113d7b781a 100644
--- a/Source/Core/Common/StringUtil.cpp
+++ b/Source/Core/Common/StringUtil.cpp
@@ -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