diff options
| author | Tilka <tilkax@gmail.com> | 2025-08-10 05:09:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-10 05:09:25 +0100 |
| commit | a07974e2c3e691bcde34e181c0d25aecbd0081c5 (patch) | |
| tree | 892505b4b3bc7f44c6daed9bfacbcd33465d6b72 /Source/Core/Common/StringUtil.cpp | |
| parent | 5a6c5e2639578978d230a30fcf2d212cf7ce85b1 (diff) | |
| parent | f8b85edd0cdf87c9f9a8507258b7989023d028bf (diff) | |
Merge pull request #13846 from JoshuaVandaele/better-xcb
Qt: Better wayland detection to enforce xcb
Diffstat (limited to 'Source/Core/Common/StringUtil.cpp')
| -rw-r--r-- | Source/Core/Common/StringUtil.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index 935db75d2f..bfd03be9ff 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -669,6 +669,22 @@ bool CaseInsensitiveEquals(std::string_view a, std::string_view b) a, b, [](char ca, char cb) { return Common::ToLower(ca) == Common::ToLower(cb); }); } +bool CaseInsensitiveContains(std::string_view haystack, std::string_view needle) +{ + if (needle.empty()) + return true; + + for (size_t i = 0; i + needle.size() <= haystack.size(); ++i) + { + if (std::ranges::equal(needle, haystack.substr(i, needle.size()), + [](char a, char b) { return Common::ToLower(a) == Common::ToLower(b); })) + { + return true; + } + } + return false; +} + bool CaseInsensitiveLess::operator()(std::string_view a, std::string_view b) const { return std::ranges::lexicographical_compare( |
