diff --git a/src/util/StringView.hxx b/src/util/StringView.hxx index d89fbd32d..9848619d8 100644 --- a/src/util/StringView.hxx +++ b/src/util/StringView.hxx @@ -127,6 +127,19 @@ struct BasicStringView : ConstBuffer { StringIsEqual(data, other.data, this->size); } + gcc_pure + bool StartsWithIgnoreCase(BasicStringView needle) const noexcept { + return this->size >= needle.size && + StringIsEqualIgnoreCase(data, needle.data, needle.size); + } + + gcc_pure + bool EndsWithIgnoreCase(BasicStringView needle) const noexcept { + return this->size >= needle.size && + StringIsEqualIgnoreCase(data + this->size - needle.size, + needle.data, needle.size); + } + gcc_pure bool EqualsIgnoreCase(BasicStringView other) const noexcept { return this->size == other.size &&