|
constexpr | basic_string_view () noexcept=default |
| Default constructor. Constructs an empty basic_string_view. After construction, data() is equal to nullptr, and size() is equal to 0.
|
|
constexpr | basic_string_view (basic_string_view const &other) noexcept=default |
| Copy constructor. Constructs a view of the same content as other. After construction, data() is equal to other.data(), and size() is equal to other.size().
|
|
constexpr | basic_string_view (Char const *str) |
| Constructs a view of the null-terminated character string pointed to by s, not including the terminating null character. The length of the view is determined as if by Traits::length(s). The behavior is undefined if [s, s+Traits::length(s)) is not a valid range. After construction, data() is equal to s, and size() is equal to Traits::length(s).
|
|
constexpr | basic_string_view (Char const *str, size_type size) |
| Constructs a view of the first count characters of the character array starting with the element pointed by s. s can contain null characters. The behavior is undefined if [s, s+count) is not a valid range (even though the constructor may not access any of the elements of this range). After construction, data() is equal to s, and size() is equal to count.
|
|
template<typename Iter >
requires (detail::RandomAccessIterator<Iter>) |
constexpr | basic_string_view (Iter first, Iter last) |
| Constructs a basic_string_view over the range [first, last). The behavior is undefined if [first, last) is not a valid range.
|
|
constexpr | basic_string_view (nullptr_t)=delete |
|
| ~basic_string_view () noexcept=default |
|
constexpr auto | back () const -> const_reference |
| Returns reference to the last character in the view.
|
|
constexpr auto | begin () const noexcept -> const_iterator |
| Returns an iterator to the first character of the view.
|
|
constexpr auto | cbegin () const noexcept -> const_iterator |
| Returns an iterator to the first character of the view.
|
|
constexpr auto | cend () const noexcept -> const_iterator |
| Returns an iterator to the character following the last character of the view. This character acts as a placeholder, attempting to access it results in undefined behavior.
|
|
constexpr auto | compare (basic_string_view v) const noexcept -> int |
| Compares two character sequences.
|
|
constexpr auto | compare (Char const *s) const -> int |
| Compares two character sequences. Equivalent to compare(basic_string_view(s)).
|
|
constexpr auto | compare (size_type pos1, size_type count1, basic_string_view v) const -> int |
| Compares two character sequences. Equivalent to substr(pos1, count1).compare(v).
|
|
constexpr auto | compare (size_type pos1, size_type count1, basic_string_view v, size_type pos2, size_type count2) const -> int |
| Compares two character sequences. Equivalent to substr(pos1, count1).compare(v.substr(pos2, count2))
|
|
constexpr auto | compare (size_type pos1, size_type count1, Char const *s) const -> int |
| Compares two character sequences. Equivalent to substr(pos1, count1).compare(basic_string_view(s)).
|
|
constexpr auto | compare (size_type pos1, size_type count1, Char const *s, size_type count2) const -> int |
| Compares two character sequences. Equivalent to substr(pos1, count1).compare(basic_string_view(s, count2)).
|
|
constexpr auto | contains (basic_string_view sv) const noexcept -> bool |
| Checks if the string contains the given substring.
|
|
constexpr auto | contains (Char c) const noexcept -> bool |
| Checks if the string contains the given substring.
|
|
constexpr auto | contains (Char const *s) const -> bool |
| Checks if the string contains the given substring.
|
|
constexpr auto | copy (Char *dest, size_type count, size_type pos=0) const -> size_type |
| Copies the substring [pos, pos + rcount) to the character array pointed to by dest, where rcount is the smaller of count and size() - pos. Equivalent to Traits::copy(dest, data() + pos, rcount).
|
|
constexpr auto | crbegin () const noexcept -> const_reverse_iterator |
| Returns a reverse iterator to the first character of the reversed view. It corresponds to the last character of the non-reversed view.
|
|
constexpr auto | crend () const noexcept -> const_reverse_iterator |
| Returns a reverse iterator to the character following the last character of the reversed view.
|
|
constexpr auto | data () const noexcept -> const_pointer |
| Returns a pointer to the underlying character array. The pointer is such that the range [data(); data() + size()) is valid and the values in it correspond to the values of the view.
|
|
constexpr auto | empty () const noexcept -> bool |
| Checks if the view has no characters, i.e. whether size() == 0.
|
|
constexpr auto | end () const noexcept -> const_iterator |
| Returns an iterator to the character following the last character of the view. This character acts as a placeholder, attempting to access it results in undefined behavior.
|
|
constexpr auto | ends_with (basic_string_view sv) const noexcept -> bool |
| Checks if the string view ends with the given suffix, where the prefix is a string view.
|
|
constexpr auto | ends_with (Char c) const noexcept -> bool |
| Checks if the string view ends with the given suffix, where the prefix is a single character.
|
|
constexpr auto | ends_with (Char const *str) const -> bool |
| Checks if the string view ends with the given suffix, where the the prefix is a null-terminated character string.
|
|
constexpr auto | find (basic_string_view v, size_type pos=0) const noexcept -> size_type |
| Finds the first substring equal to the given character sequence. Finds the first occurence of v in this view, starting at position pos.
|
|
constexpr auto | find (Char ch, size_type pos=0) const noexcept -> size_type |
| Finds the first substring equal to the given character sequence. Equivalent to find(basic_string_view(etl::addressof(ch), 1), pos)
|
|
constexpr auto | find (Char const *s, size_type pos, size_type count) const -> size_type |
| Finds the first substring equal to the given character sequence. Equivalent to find(basic_string_view(s, count), pos)
|
|
constexpr auto | find (Char const *s, size_type pos=0) const -> size_type |
| Finds the first substring equal to the given character sequence. Equivalent to find(basic_string_view(s), pos)
|
|
constexpr auto | find_first_not_of (basic_string_view sv, size_type pos=0) const noexcept -> size_type |
| Finds the first character not equal to any of the characters in the given character sequence.
|
|
constexpr auto | find_first_not_of (Char c, size_type pos=0) const noexcept -> size_type |
| Finds the first character not equal to any of the characters in the given character sequence.
|
|
constexpr auto | find_first_not_of (Char const *s, size_type pos, size_type count) const -> size_type |
| Finds the first character not equal to any of the characters in the given character sequence.
|
|
constexpr auto | find_first_not_of (Char const *s, size_type pos=0) const -> size_type |
| Finds the first character not equal to any of the characters in the given character sequence.
|
|
constexpr auto | find_first_of (basic_string_view v, size_type pos=0) const noexcept -> size_type |
| Finds the first character equal to any of the characters in the given character sequence. Finds the first occurence of any of the characters of v in this view, starting at position pos.
|
|
constexpr auto | find_first_of (Char c, size_type pos=0) const noexcept -> size_type |
| Finds the first character equal to any of the characters in the given character sequence. Equivalent to find_first_of(basic_string_view(&c, 1), pos)
|
|
constexpr auto | find_first_of (Char const *s, size_type pos, size_type count) const -> size_type |
| Finds the first character equal to any of the characters in the given character sequence. Equivalent to find_first_of(basic_string_view(s, count), pos)
|
|
constexpr auto | find_first_of (Char const *s, size_type pos=0) const -> size_type |
| Finds the first character equal to any of the characters in the given character sequence. Equivalent to find_first_of(basic_string_view(s), pos)
|
|
constexpr auto | find_last_not_of (basic_string_view v, size_type pos=npos) const noexcept -> size_type |
| Finds the last character not equal to any of the characters of v in this view, starting at position pos.
|
|
constexpr auto | find_last_not_of (Char c, size_type pos=npos) const noexcept -> size_type |
| Finds the last character not equal to any of the characters in the given character sequence. Equivalent to find_last_not_of(basic_string_view(&c, 1), pos).
|
|
constexpr auto | find_last_not_of (const_pointer s, size_type pos, size_type count) const -> size_type |
| Finds the last character not equal to any of the characters in the given character sequence. Equivalent to find_last_not_of(basic_string_view(s, count), pos).
|
|
constexpr auto | find_last_not_of (const_pointer s, size_type pos=npos) const -> size_type |
| Finds the last character not equal to any of the characters in the given character sequence. Equivalent to find_last_not_of(basic_string_view(s), pos)
|
|
constexpr auto | find_last_of (basic_string_view v, size_type pos=npos) const noexcept -> size_type |
| Finds the last character equal to one of characters in the given character sequence. Exact search algorithm is not specified. The search considers only the interval [0; pos]. If the character is not present in the interval, npos will be returned. Finds the last occurence of any of the characters of v in this view, ending at position pos.
|
|
constexpr auto | find_last_of (Char c, size_type pos=npos) const noexcept -> size_type |
| Finds the last character equal to one of characters in the given character sequence. Exact search algorithm is not specified. The search considers only the interval [0; pos]. If the character is not present in the interval, npos will be returned. Equivalent to find_last_of(basic_string_view(&c, 1), pos).
|
|
constexpr auto | find_last_of (Char const *s, size_type pos, size_type count) const -> size_type |
| Finds the last character equal to one of characters in the given character sequence. Exact search algorithm is not specified. The search considers only the interval [0; pos]. If the character is not present in the interval, npos will be returned. Equivalent to find_last_of(basic_string_view(s, count), pos).
|
|
constexpr auto | find_last_of (Char const *s, size_type pos=npos) const -> size_type |
| Finds the last character equal to one of characters in the given character sequence. Exact search algorithm is not specified. The search considers only the interval [0; pos]. If the character is not present in the interval, npos will be returned. Equivalent to find_last_of(basic_string_view(s), pos).
|
|
constexpr auto | front () const -> const_reference |
| Returns reference to the first character in the view.
|
|
constexpr auto | length () const noexcept -> size_type |
| Returns the number of Char elements in the view, i.e. etl::distance(begin(), end()).
|
|
constexpr auto | max_size () const noexcept -> size_type |
| The largest possible number of char-like objects that can be referred to by a basic_string_view.
|
|
constexpr auto | operator= (basic_string_view const &view) noexcept -> basic_string_view &=default |
| Replaces the view with that of view.
|
|
constexpr auto | operator[] (size_type pos) const -> const_reference |
| Returns a const reference to the character at specified location pos .
|
|
constexpr auto | rbegin () const noexcept -> const_reverse_iterator |
| Returns a reverse iterator to the first character of the reversed view. It corresponds to the last character of the non-reversed view.
|
|
constexpr auto | remove_prefix (size_type n) -> void |
| Moves the start of the view forward by n characters.
|
|
constexpr auto | remove_suffix (size_type n) -> void |
| Moves the end of the view back by n characters.
|
|
constexpr auto | rend () const noexcept -> const_reverse_iterator |
| Returns a reverse iterator to the character following the last character of the reversed view.
|
|
constexpr auto | rfind (basic_string_view sv, size_type pos=npos) const noexcept -> size_type |
| Finds the last substring equal to the given character sequence. Finds the last occurence of v in this view, starting at position pos.
|
|
constexpr auto | rfind (Char c, size_type pos=npos) const noexcept -> size_type |
| Finds the last substring equal to the given character sequence. Equivalent to rfind(basic_string_view(&c, 1), pos).
|
|
constexpr auto | rfind (Char const *s, size_type pos, size_type count) const noexcept -> size_type |
| Finds the last substring equal to the given character sequence. Equivalent to rfind(basic_string_view(s, count), pos).
|
|
constexpr auto | rfind (Char const *s, size_type pos=npos) const noexcept -> size_type |
| Finds the last substring equal to the given character sequence. Equivalent to rfind(basic_string_view(s), pos).
|
|
constexpr auto | size () const noexcept -> size_type |
| Returns the number of Char elements in the view, i.e. etl::distance(begin(), end()).
|
|
constexpr auto | starts_with (basic_string_view sv) const noexcept -> bool |
| Checks if the string view begins with the given prefix, where the prefix is a string view.
|
|
constexpr auto | starts_with (Char c) const noexcept -> bool |
| Checks if the string view begins with the given prefix, where the prefix is a single character.
|
|
constexpr auto | starts_with (Char const *str) const -> bool |
| Checks if the string view begins with the given prefix, where the the prefix is a null-terminated character string.
|
|
constexpr auto | substr (size_type pos=0, size_type count=npos) const -> basic_string_view |
| Returns a view of the substring [pos, pos + rcount), where rcount is the smaller of count and size() - pos.
|
|
constexpr auto | swap (basic_string_view &v) noexcept -> void |
| Exchanges the view with that of v.
|
|