util/WStringCompare: reorder functions to relocate API docs

This commit is contained in:
Max Kellermann 2020-03-22 19:20:29 +01:00
parent 3888bafc1f
commit 637840264a
1 changed files with 13 additions and 4 deletions

View File

@ -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;
}
/**