util/StringCompare: add StringEndsWithIgnoreCase(), StringStartsWithIgnoreCase()
This commit is contained in:
@@ -54,6 +54,11 @@ gcc_pure gcc_nonnull_all
|
||||
bool
|
||||
StringEndsWith(const wchar_t *haystack, const wchar_t *needle) noexcept;
|
||||
|
||||
gcc_pure gcc_nonnull_all
|
||||
bool
|
||||
StringEndsWithIgnoreCase(const wchar_t *haystack,
|
||||
const wchar_t *needle) noexcept;
|
||||
|
||||
/**
|
||||
* Returns the portion of the string after a prefix. If the string
|
||||
* does not begin with the specified prefix, this function returns
|
||||
@@ -68,6 +73,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);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given string ends with the specified suffix. If yes,
|
||||
* returns the position of the suffix, and nullptr otherwise.
|
||||
|
Reference in New Issue
Block a user