Go to the documentation of this file.
4 #ifndef LEXY_DETAIL_STRING_VIEW_HPP_INCLUDED
5 #define LEXY_DETAIL_STRING_VIEW_HPP_INCLUDED
16 template <
typename CharT>
62 constexpr
bool empty() const noexcept
66 constexpr std::size_t
size() const noexcept
70 constexpr std::size_t
length() const noexcept
108 static constexpr std::size_t
npos = std::size_t(-1);
141 return substr(0, prefix.size()) == prefix;
154 for (
auto i = pos; i <
length(); ++i)
162 constexpr std::size_t
find(CharT c, std::size_t pos = 0) const noexcept
171 if (lhs.size() != rhs.size())
174 for (
auto a = lhs.begin(), b = rhs.begin(); a != lhs.end(); ++a, ++b)
184 return !(lhs == rhs);
199 template <
auto FnPtr, std::size_t... Indices>
202 static constexpr
auto view = FnPtr();
204 static constexpr
typename decltype(view)::
char_type value[] = {view[Indices]..., {}};
207 template <auto FnPtr>
211 #endif // LEXY_DETAIL_STRING_VIEW_HPP_INCLUDED
constexpr basic_string_view(null_terminated, const char_type *ptr, std::size_t size) noexcept
constexpr bool empty() const noexcept
constexpr friend bool operator!=(basic_string_view< CharT > lhs, basic_string_view< CharT > rhs) noexcept
string_view::value_type char_type
constexpr bool try_remove_prefix(basic_string_view prefix) noexcept
const char_type * iterator
constexpr bool starts_with(basic_string_view prefix) const noexcept
constexpr iterator begin() const noexcept
static constexpr CharT empty_string[]
constexpr iterator end() const noexcept
#define LEXY_PRECONDITION(Expr)
constexpr basic_string_view(const char_type *begin, const char_type *end) noexcept
typename _make_index_sequence< Size >::type make_index_sequence
constexpr std::size_t find(basic_string_view str, std::size_t pos=0) const noexcept
constexpr bool is_null_terminated() const noexcept
constexpr const auto * make_cstr
constexpr basic_string_view(const char_type *str) noexcept
constexpr char_type operator[](std::size_t i) const noexcept
constexpr const char_type * c_str() const noexcept
constexpr auto n() noexcept
constexpr basic_string_view substr(std::size_t pos, std::size_t length=npos) const noexcept
constexpr void remove_suffix(std::size_t n) noexcept
constexpr char_type back() const noexcept
constexpr std::size_t size() const noexcept
constexpr basic_string_view() noexcept
constexpr friend bool operator==(basic_string_view< CharT > lhs, basic_string_view< CharT > rhs) noexcept
constexpr char_type front() const noexcept
static constexpr std::size_t npos
constexpr std::size_t length() const noexcept
constexpr const char_type * data() const noexcept
constexpr basic_string_view(const char_type *ptr, std::size_t size) noexcept
constexpr std::size_t find(CharT c, std::size_t pos=0) const noexcept
constexpr void remove_prefix(std::size_t n) noexcept