diff options
author | Max Kellermann <max@musicpd.org> | 2020-03-22 19:20:29 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-03-22 19:20:29 +0100 |
commit | 637840264a5ae9f04ef6674500ed0dc24e9457c2 (patch) | |
tree | db814f0e8dd26c25fc0e32b9b46a082be35277cd /src/util | |
parent | 3888bafc1f1513fdf383322f10ce3e8275c04251 (diff) |
util/WStringCompare: reorder functions to relocate API docs
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/WStringCompare.hxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/util/WStringCompare.hxx b/src/util/WStringCompare.hxx index 75c01661d..4b3a83f55 100644 --- a/src/util/WStringCompare.hxx +++ b/src/util/WStringCompare.hxx @@ -91,6 +91,14 @@ StringAfterPrefix(const wchar_t *haystack, WStringView needle) noexcept : nullptr; } +gcc_pure gcc_nonnull_all +static inline bool +StringStartsWithIgnoreCase(const wchar_t *haystack, + WStringView needle) noexcept +{ + return StringIsEqualIgnoreCase(haystack, needle.data, needle.size); +} + /** * Returns the portion of the string after a prefix. If the string * does not begin with the specified prefix, this function returns @@ -98,11 +106,12 @@ StringAfterPrefix(const wchar_t *haystack, WStringView needle) noexcept * This function is case-independent. */ gcc_pure gcc_nonnull_all -static inline bool -StringStartsWithIgnoreCase(const wchar_t *haystack, - WStringView needle) noexcept +static inline const wchar_t * +StringAfterPrefixIgnoreCase(const wchar_t *haystack, WStringView needle) noexcept { - return StringIsEqualIgnoreCase(haystack, needle.data, needle.size); + return StringStartsWithIgnoreCase(haystack, needle) + ? haystack + needle.size + : nullptr; } /** |