summaryrefslogtreecommitdiff
path: root/src/util/StringCompare.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/StringCompare.hxx')
-rw-r--r--src/util/StringCompare.hxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util/StringCompare.hxx b/src/util/StringCompare.hxx
index 383943c55..3a3184cd1 100644
--- a/src/util/StringCompare.hxx
+++ b/src/util/StringCompare.hxx
@@ -56,6 +56,10 @@ gcc_pure gcc_nonnull_all
bool
StringEndsWith(const char *haystack, const char *needle) noexcept;
+gcc_pure gcc_nonnull_all
+bool
+StringEndsWithIgnoreCase(const char *haystack, const char *needle) noexcept;
+
/**
* Returns the portion of the string after a prefix. If the string
* does not begin with the specified prefix, this function returns
@@ -70,6 +74,13 @@ StringAfterPrefix(const char *haystack, StringView needle) noexcept
: nullptr;
}
+gcc_pure gcc_nonnull_all
+static inline bool
+StringStartsWithIgnoreCase(const char *haystack, StringView 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.