diff --git a/src/util/StringView.hxx b/src/util/StringView.hxx index a56cd361e..5d782839f 100644 --- a/src/util/StringView.hxx +++ b/src/util/StringView.hxx @@ -154,6 +154,16 @@ struct BasicStringView : ConstBuffer { needle.data, needle.size); } + gcc_pure + bool StartsWith(value_type ch) const noexcept { + return !empty() && front() == ch; + } + + gcc_pure + bool EndsWith(value_type ch) const noexcept { + return !empty() && back() == ch; + } + gcc_pure int Compare(BasicStringView other) const noexcept { if (size < other.size) {