template<typename CharT, typename Traits = std::char_traits<CharT>>
class vccc::basic_string_view< CharT, Traits >
The class template basic_string_view describes an object that can refer to a constant contiguous sequence of CharT
with the first element of the sequence at position zero. Every specialization of vccc::basic_string_view
is a TriviallyCopyable type.
- Template Parameters
-
CharT | character type |
Traits | CharTraits class specifying the operations on the character type. Like for std::basic_string , Traits::char_type must name the same type as CharT or the program is ill-formed. |
|
|
|
constexpr | basic_string_view () noexcept |
|
constexpr | basic_string_view (const basic_string_view &other) noexcept=default |
|
constexpr | basic_string_view (const CharT *s, size_type count) |
|
constexpr | basic_string_view (const CharT *s) |
|
template<typename It , typename End , std::enable_if_t< detail::string_view_iter_ctor< It, End, CharT, size_type >::value, int > = 0> |
constexpr | basic_string_view (It first, End last) |
|
template<typename R , std::enable_if_t< detail::string_view_range_ctor< R, basic_string_view >::value, int > = 0> |
constexpr | basic_string_view (R &&r) |
|
constexpr | basic_string_view (const std::basic_string< CharT, Traits > &s) |
|
constexpr | basic_string_view (std::basic_string< CharT, Traits > &&s) |
|
| operator std::basic_string< CharT, Traits > () const |
|
constexpr | basic_string_view (std::nullptr_t)=delete |
|
|
|
constexpr basic_string_view & | operator= (const basic_string_view &other) noexcept=default |
|
|
returns an iterator to the beginning
|
constexpr const_iterator | begin () const noexcept |
|
constexpr const_iterator | cbegin () const noexcept |
|
|
returns an iterator to the end
|
constexpr const_iterator | end () const noexcept |
|
constexpr const_iterator | cend () const noexcept |
|
|
returns a reverse iterator to the beginning
|
constexpr const_reverse_iterator | rbegin () const noexcept |
|
constexpr const_reverse_iterator | crbegin () const noexcept |
|
|
returns a reverse iterator to the end
|
constexpr const_reverse_iterator | rend () const noexcept |
|
constexpr const_reverse_iterator | crend () const noexcept |
|
|
accesses the specified character
|
constexpr const_reference | operator[] (size_type pos) const |
|
|
accesses the specified character with bounds checking
|
constexpr const_reference | at (size_type pos) const |
|
|
accesses the first character
|
constexpr const_reference | front () const |
|
|
accesses the last character
|
constexpr const_reference | back () const |
|
|
returns a pointer to the first character of a view
|
constexpr const_pointer | data () const noexcept |
|
|
returns the number of characters
|
constexpr size_type | size () const noexcept |
|
constexpr size_type | length () const noexcept |
|
|
returns the maximum number of characters
|
constexpr size_type | max_size () const noexcept |
|
|
checks whether the view is empty
|
constexpr bool | empty () const noexcept |
|
|
shrinks the view by moving its start forward
|
constexpr void | remove_prefix (size_type n) |
|
|
shrinks the view by moving its end backward
|
constexpr void | remove_suffix (size_type n) |
|
|
|
constexpr void | swap (basic_string_view &other) noexcept |
|
|
|
constexpr size_type | copy (value_type *dest, size_type count, size_type pos=0) const |
|
|
|
constexpr basic_string_view | substr (size_type pos=0, size_type count=npos) const |
|
|
|
constexpr int | compare (basic_string_view other) const noexcept |
|
constexpr int | compare (size_type pos1, size_type count1, basic_string_view other) const |
|
constexpr int | compare (size_type pos1, size_type count1, basic_string_view other, size_type pos2, size_type count2) const |
|
constexpr int | compare (const CharT *s) const |
|
constexpr int | compare (size_type pos1, size_type count1, const value_type *s) const |
|
constexpr int | compare (size_type pos1, size_type count1, const value_type *s, size_type count2) const |
|
|
checks if the string view starts with the given prefix
|
constexpr bool | starts_with (basic_string_view prefix) const noexcept |
|
constexpr bool | starts_with (value_type c) const noexcept |
|
constexpr bool | starts_with (const value_type *s) const |
|
|
checks if the string view ends with the given suffix
|
constexpr bool | ends_with (basic_string_view sv) const noexcept |
|
constexpr bool | ends_with (value_type c) const noexcept |
|
constexpr bool | ends_with (const value_type *s) const |
|
|
checks if the string view contains the given substring or character
|
constexpr bool | contains (basic_string_view sv) const noexcept |
|
constexpr bool | contains (value_type c) const noexcept |
|
constexpr bool | contains (const value_type *str) const |
|
|
find characters in the view
|
constexpr size_type | find (basic_string_view sv, size_type pos=0) const noexcept |
|
constexpr size_type | find (value_type c, size_type pos=0) const noexcept |
|
constexpr size_type | find (const value_type *str, size_type pos, size_type count) const |
|
constexpr size_type | find (const value_type *str, size_type pos=0) const |
|
|
find the last occurrence of a substring
|
constexpr size_type | rfind (basic_string_view sv, size_type pos=npos) const noexcept |
|
constexpr size_type | rfind (value_type c, size_type pos=npos) const noexcept |
|
constexpr size_type | rfind (const value_type *str, size_type pos, size_type count) const |
|
constexpr size_type | rfind (const value_type *str, size_type pos=npos) const |
|
|
find first occurrence of characters
|
constexpr size_type | find_first_of (basic_string_view sv, size_type pos=0) const noexcept |
|
constexpr size_type | find_first_of (value_type c, size_type pos=0) const noexcept |
|
constexpr size_type | find_first_of (const value_type *s, size_type pos, size_type count) const |
|
constexpr size_type | find_first_of (const value_type *s, size_type pos=0) const |
|
|
find last occurrence of characters
|
constexpr size_type | find_last_of (basic_string_view sv, size_type pos=npos) const noexcept |
|
constexpr size_type | find_last_of (value_type c, size_type pos=npos) const noexcept |
|
constexpr size_type | find_last_of (const value_type *s, size_type pos, size_type count) const |
|
constexpr size_type | find_last_of (const value_type *s, size_type pos=npos) const |
|
|
find first absence of characters
|
constexpr size_type | find_first_not_of (basic_string_view sv, size_type pos=0) const noexcept |
|
constexpr size_type | find_first_not_of (value_type c, size_type pos=0) const noexcept |
|
constexpr size_type | find_first_not_of (const value_type *s, size_type pos, size_type count) const |
|
constexpr size_type | find_first_not_of (const value_type *s, size_type pos=0) const |
|
|
find last absence of characters
|
constexpr size_type | find_last_not_of (basic_string_view sv, size_type pos=npos) const noexcept |
|
constexpr size_type | find_last_not_of (value_type c, size_type pos=npos) const noexcept |
|
constexpr size_type | find_last_not_of (const value_type *s, size_type pos, size_type count) const |
|
constexpr size_type | find_last_not_of (const value_type *s, size_type pos=npos) const |
|