From 3888bafc1f1513fdf383322f10ce3e8275c04251 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 22 Mar 2020 19:15:55 +0100 Subject: [PATCH] util/StringCompare: add API documentation --- src/util/StringCompare.hxx | 6 ++++++ src/util/WStringCompare.hxx | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/util/StringCompare.hxx b/src/util/StringCompare.hxx index 436e45c3a..71088bf37 100644 --- a/src/util/StringCompare.hxx +++ b/src/util/StringCompare.hxx @@ -107,6 +107,12 @@ StringStartsWithIgnoreCase(StringView haystack, StringView needle) noexcept StringIsEqualIgnoreCase(haystack.data, 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 + * nullptr. + * This function is case-independent. + */ gcc_pure gcc_nonnull_all static inline const char * StringAfterPrefixIgnoreCase(const char *haystack, StringView needle) noexcept diff --git a/src/util/WStringCompare.hxx b/src/util/WStringCompare.hxx index d7c4d0bfe..75c01661d 100644 --- a/src/util/WStringCompare.hxx +++ b/src/util/WStringCompare.hxx @@ -91,6 +91,12 @@ StringAfterPrefix(const wchar_t *haystack, WStringView needle) noexcept : nullptr; } +/** + * Returns the portion of the string after a prefix. If the string + * does not begin with the specified prefix, this function returns + * nullptr. + * This function is case-independent. + */ gcc_pure gcc_nonnull_all static inline bool StringStartsWithIgnoreCase(const wchar_t *haystack,