summaryrefslogtreecommitdiff
path: root/src/util/WStringAPI.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-09-12 17:15:23 +0200
committerMax Kellermann <max@musicpd.org>2017-09-12 17:17:13 +0200
commitebdb7c8de25f81dbc4f5ef1afdf684ccf3059b8e (patch)
tree50061c1eac1d7eb4e030599b7d5deb19028a3cd3 /src/util/WStringAPI.hxx
parent1fda842ee63e789ef3daee8828c6513c5cf9837c (diff)
util/WStringAPI: add StringIsEqualIgnoreCase() overload
Diffstat (limited to 'src/util/WStringAPI.hxx')
-rw-r--r--src/util/WStringAPI.hxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/util/WStringAPI.hxx b/src/util/WStringAPI.hxx
index f69aaf6d1..6ed788927 100644
--- a/src/util/WStringAPI.hxx
+++ b/src/util/WStringAPI.hxx
@@ -134,6 +134,25 @@ StringIsEqual(const wchar_t *a, const wchar_t *b, size_t length) noexcept
return wcsncmp(a, b, length) == 0;
}
+#ifdef _WIN32
+
+gcc_pure gcc_nonnull_all
+static inline bool
+StringIsEqualIgnoreCase(const wchar_t *a, const wchar_t *b) noexcept
+{
+ return _wcsicmp(a, b) == 0;
+}
+
+gcc_pure gcc_nonnull_all
+static inline bool
+StringIsEqualIgnoreCase(const wchar_t *a, const wchar_t *b,
+ size_t size) noexcept
+{
+ return _wcsnicmp(a, b, size) == 0;
+}
+
+#endif
+
#ifndef __BIONIC__
gcc_malloc gcc_nonnull_all