Embedded Template Library 1.0
Loading...
Searching...
No Matches
etl::basic_string_view< T, TTraits > Class Template Reference

String view. More...

#include <string_view.h>

Public Types

enum  { npos = etl::integral_limits<size_t>::max }
 
typedef T value_type
 
typedef TTraits traits_type
 
typedef size_t size_type
 
typedef const Tconst_reference
 
typedef const Tconst_pointer
 
typedef const Tconst_iterator
 
typedef ETL_OR_STD::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

ETL_CONSTEXPR basic_string_view () ETL_NOEXCEPT
 Default constructor.
 
ETL_CONSTEXPR basic_string_view (const etl::ibasic_string< T > &str)
 Construct from string.
 
ETL_CONSTEXPR14 ETL_EXPLICIT_STRING_FROM_CHAR basic_string_view (const T *begin_)
 Construct from T*.
 
ETL_CONSTEXPR basic_string_view (const T *begin_, const T *end_)
 Construct from pointer range.
 
ETL_CONSTEXPR basic_string_view (const T *begin_, size_t size_)
 Construct from pointer/size.
 
ETL_CONSTEXPR basic_string_view (const basic_string_view &other) ETL_NOEXCEPT
 Copy constructor.
 
ETL_CONSTEXPR const_reference front () const
 Returns a const reference to the first element.
 
ETL_CONSTEXPR const_reference back () const
 Returns a const reference to the last element.
 
ETL_CONSTEXPR const_pointer data () const
 Returns a const pointer to the first element of the internal storage.
 
ETL_CONSTEXPR const_iterator begin () const
 Returns a const iterator to the beginning of the array.
 
ETL_CONSTEXPR const_iterator cbegin () const
 Returns a const iterator to the beginning of the array.
 
ETL_CONSTEXPR const_iterator end () const
 Returns a const iterator to the end of the array.
 
ETL_CONSTEXPR const_iterator cend () const
 
ETL_CONSTEXPR const_reverse_iterator rbegin () const
 Returns a const reverse iterator to the reverse beginning of the array.
 
ETL_CONSTEXPR const_reverse_iterator crbegin () const
 Returns a const reverse iterator to the reverse beginning of the array.
 
ETL_CONSTEXPR const_reverse_iterator rend () const
 Returns a const reverse iterator to the end of the array.
 
ETL_CONSTEXPR const_reverse_iterator crend () const
 Returns a const reverse iterator to the end of the array.
 
ETL_CONSTEXPR bool empty () const
 Returns true if the array size is zero.
 
ETL_CONSTEXPR size_t size () const
 Returns the size of the array.
 
ETL_CONSTEXPR size_t length () const
 Returns the size of the array.
 
ETL_CONSTEXPR size_t max_size () const
 Returns the maximum possible size of the array.
 
ETL_CONSTEXPR14 etl::basic_string_view< T, TTraits > & operator= (const etl::basic_string_view< T, TTraits > &other)
 Assign from a view.
 
ETL_CONSTEXPR14 void assign (const_pointer begin_, const_pointer end_)
 Assign from iterators.
 
ETL_CONSTEXPR14 void assign (const_pointer begin_, size_t size_)
 Assign from iterator and size.
 
ETL_CONSTEXPR const_reference operator[] (size_t i) const
 Returns a const reference to the indexed value.
 
const_reference at (size_t i) const
 Returns a const reference to the indexed value.
 
ETL_CONSTEXPR14 void swap (basic_string_view &other) ETL_NOEXCEPT
 Swaps with another basic_string_view.
 
ETL_CONSTEXPR14 size_type copy (T *destination, size_type count, size_type position=0) const
 Copies characters.
 
ETL_CONSTEXPR14 basic_string_view substr (size_type position=0, size_type count=npos) const
 Returns a substring.
 
ETL_CONSTEXPR14 void remove_prefix (size_type n)
 Shrinks the view by moving its start forward.
 
ETL_CONSTEXPR14 void remove_suffix (size_type n)
 Shrinks the view by moving its end backward.
 
ETL_CONSTEXPR14 int compare (basic_string_view< T, TTraits > view) const
 Compares two views.
 
ETL_CONSTEXPR14 int compare (size_type position, size_type count, basic_string_view view) const
 
ETL_CONSTEXPR14 int compare (size_type position1, size_type count1, basic_string_view view, size_type position2, size_type count2) const
 
ETL_CONSTEXPR14 int compare (const T *text) const
 
ETL_CONSTEXPR14 int compare (size_type position, size_type count, const T *text) const
 
ETL_CONSTEXPR14 int compare (size_type position, size_type count1, const T *text, size_type count2) const
 
ETL_CONSTEXPR14 bool starts_with (etl::basic_string_view< T, TTraits > view) const
 Checks if the string view starts with the given prefix.
 
ETL_CONSTEXPR14 bool starts_with (T c) const
 
ETL_CONSTEXPR14 bool starts_with (const T *text) const
 
ETL_CONSTEXPR14 bool ends_with (etl::basic_string_view< T, TTraits > view) const
 Checks if the string view ends with the given suffix.
 
ETL_CONSTEXPR14 bool ends_with (T c) const
 
ETL_CONSTEXPR14 bool ends_with (const T *text) const
 
ETL_CONSTEXPR14 size_type find (etl::basic_string_view< T, TTraits > view, size_type position=0) const
 Find characters in the view.
 
ETL_CONSTEXPR14 size_type find (T c, size_type position=0) const
 
ETL_CONSTEXPR14 size_type find (const T *text, size_type position, size_type count) const
 
ETL_CONSTEXPR14 size_type find (const T *text, size_type position=0) const
 
ETL_CONSTEXPR14 size_type rfind (etl::basic_string_view< T, TTraits > view, size_type position=npos) const
 Find the last occurrence of a substring.
 
ETL_CONSTEXPR14 size_type rfind (T c, size_type position=npos) const
 
ETL_CONSTEXPR14 size_type rfind (const T *text, size_type position, size_type count) const
 
ETL_CONSTEXPR14 size_type rfind (const T *text, size_type position=npos) const
 
ETL_CONSTEXPR14 size_type find_first_of (etl::basic_string_view< T, TTraits > view, size_type position=0) const
 Find first occurrence of characters.
 
ETL_CONSTEXPR14 size_type find_first_of (T c, size_type position=0) const
 
ETL_CONSTEXPR14 size_type find_first_of (const T *text, size_type position, size_type count) const
 
ETL_CONSTEXPR14 size_type find_first_of (const T *text, size_type position=0) const
 
ETL_CONSTEXPR14 size_type find_last_of (etl::basic_string_view< T, TTraits > view, size_type position=npos) const
 Find last occurrence of characters.
 
ETL_CONSTEXPR14 size_type find_last_of (T c, size_type position=npos) const
 
ETL_CONSTEXPR14 size_type find_last_of (const T *text, size_type position, size_type count) const
 
ETL_CONSTEXPR14 size_type find_last_of (const T *text, size_type position=npos) const
 
ETL_CONSTEXPR14 size_type find_first_not_of (etl::basic_string_view< T, TTraits > view, size_type position=0) const
 Find first absence of characters.
 
ETL_CONSTEXPR14 size_type find_first_not_of (T c, size_type position=0) const
 
ETL_CONSTEXPR14 size_type find_first_not_of (const T *text, size_type position, size_type count) const
 
ETL_CONSTEXPR14 size_type find_first_not_of (const T *text, size_type position=0) const
 
ETL_CONSTEXPR14 size_type find_last_not_of (etl::basic_string_view< T, TTraits > view, size_type position=npos) const
 Find last absence of characters.
 
ETL_CONSTEXPR14 size_type find_last_not_of (T c, size_type position=npos) const
 
ETL_CONSTEXPR14 size_type find_last_not_of (const T *text, size_type position, size_type count) const
 
ETL_CONSTEXPR14 size_type find_last_not_of (const T *text, size_type position=npos) const
 

Friends

ETL_CONSTEXPR14 bool operator== (const etl::basic_string_view< T, TTraits > &lhs, const etl::basic_string_view< T, TTraits > &rhs)
 Equality for string_view.
 
ETL_CONSTEXPR14 bool operator!= (const etl::basic_string_view< T, TTraits > &lhs, const etl::basic_string_view< T, TTraits > &rhs)
 Inequality for string_view.
 
ETL_CONSTEXPR14 bool operator< (const etl::basic_string_view< T, TTraits > &lhs, const etl::basic_string_view< T, TTraits > &rhs)
 Less-than for string_view.
 
ETL_CONSTEXPR14 bool operator> (const etl::basic_string_view< T, TTraits > &lhs, const etl::basic_string_view< T, TTraits > &rhs)
 Greater-than for string_view.
 
ETL_CONSTEXPR14 bool operator<= (const etl::basic_string_view< T, TTraits > &lhs, const etl::basic_string_view< T, TTraits > &rhs)
 Less-than-equal for string_view.
 
ETL_CONSTEXPR14 bool operator>= (const etl::basic_string_view< T, TTraits > &lhs, const etl::basic_string_view< T, TTraits > &rhs)
 Greater-than-equal for string_view.
 

Detailed Description

template<typename T, typename TTraits = etl::char_traits<T>>
class etl::basic_string_view< T, TTraits >

String view.


The documentation for this class was generated from the following file: