30 #ifndef STRING_VIEW_HXX
31 #define STRING_VIEW_HXX
48 _data != nullptr ? strlen(_data) : 0) {}
59 static_assert(n > 0,
"");
60 return {_data, n - 1};
85 size = _data !=
nullptr ? strlen(_data) : 0;
gcc_pure pointer_type Find(char ch) const
static constexpr StringView Literal(const char(&_data)[n])
static constexpr StringView Literal()
bool EqualsLiteralIgnoreCase(const char(&other)[n]) const
StringView & operator=(pointer_type _data)
constexpr StringView(pointer_type _data, size_type _size)
void StripRight()
Skip all whitespace at the end.
StringView & operator=(std::nullptr_t)
const char * pointer_type
gcc_pure bool StartsWith(StringView needle) const
gcc_pure bool Equals(StringView other) const
bool EqualsLiteral(const char(&other)[n]) const
gcc_pure bool EqualsIgnoreCase(StringView other) const
static constexpr StringView Empty()
StringView(pointer_type _data)
A reference to a memory area that is read-only.
void StripLeft()
Skip all whitespace at the beginning.
constexpr StringView(std::nullptr_t n)
constexpr StringView(pointer_type _begin, pointer_type _end)