MySQL  8.0.19
Source Code Documentation
stdx::basic_string_view< charT, traits > Class Template Reference

#include <string_view.h>

Public Types

enum  : size_type { npos = size_type(-1) }
 
using traits_type = traits
 
using value_type = charT
 
using pointer = const value_type *
 
using const_pointer = const value_type *
 
using reference = const value_type &
 
using const_reference = const value_type &
 
using const_iterator = const value_type *
 
using iterator = const_iterator
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using reverse_iterator = const_reverse_iterator
 
using size_type = size_t
 
using difference_type = ptrdiff_t
 

Public Member Functions

constexpr basic_string_view () noexcept
 
constexpr basic_string_view (const basic_string_view &rhs) noexcept=default
 
constexpr basic_string_viewoperator= (const basic_string_view &) noexcept=default
 
template<typename Allocator >
constexpr basic_string_view (const std::basic_string< value_type, traits_type, Allocator > &str) noexcept
 
constexpr STDX_NONNULL basic_string_view (const_pointer data)
 
constexpr STDX_NONNULL basic_string_view (const_pointer data, size_type len)
 
constexpr const_iterator begin () const noexcept
 
constexpr const_iterator end () const noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr const_iterator cend () const noexcept
 
constexpr const_reverse_iterator rbegin () const noexcept
 
constexpr const_reverse_iterator rend () const noexcept
 
constexpr const_reverse_iterator crbegin () const noexcept
 
constexpr const_reverse_iterator crend () const noexcept
 
constexpr size_type size () const noexcept
 
constexpr size_type length () const noexcept
 
constexpr size_type max_size () const noexcept
 
constexpr bool empty () const noexcept
 
constexpr const_reference operator[] (size_type pos) const noexcept
 
constexpr const_reference at (size_type pos) const
 
constexpr const_reference front () const noexcept
 first element. More...
 
constexpr const_reference back () const noexcept
 last element. More...
 
constexpr const_pointer data () const noexcept
 pointer to underlaying data. More...
 
void clear () noexcept
 
void remove_prefix (size_type n)
 
void remove_suffix (size_type n)
 
void swap (basic_string_view &s) noexcept
 
template<class Allocator >
 operator std::basic_string< charT, traits, Allocator > () const
 
size_type copy (charT *s, size_type n, size_type pos=0) const
 copy into external buffer. More...
 
constexpr basic_string_view substr (size_type pos=0, size_type n=npos) const
 get substring of a string_view. More...
 
constexpr int compare (basic_string_view s) const noexcept
 
constexpr int compare (size_t pos1, size_type n1, basic_string_view s) const
 
constexpr int compare (size_t pos1, size_type n1, basic_string_view s, size_type pos2, size_type n2) const
 
constexpr int compare (const value_type *s) const
 
constexpr int compare (size_t pos1, size_type n1, const value_type *s) const
 
constexpr int compare (size_t pos1, size_type n1, const value_type *s, size_type pos2, size_type n2) const
 
size_type find (basic_string_view str, size_type pos=0) const noexcept
 

Private Attributes

const value_typeptr_
 
size_type length_
 

Member Typedef Documentation

◆ const_iterator

template<class charT , class traits = std::char_traits<charT>>
using stdx::basic_string_view< charT, traits >::const_iterator = const value_type *

◆ const_pointer

template<class charT , class traits = std::char_traits<charT>>
using stdx::basic_string_view< charT, traits >::const_pointer = const value_type *

◆ const_reference

template<class charT , class traits = std::char_traits<charT>>
using stdx::basic_string_view< charT, traits >::const_reference = const value_type &

◆ const_reverse_iterator

template<class charT , class traits = std::char_traits<charT>>
using stdx::basic_string_view< charT, traits >::const_reverse_iterator = std::reverse_iterator<const_iterator>

◆ difference_type

template<class charT , class traits = std::char_traits<charT>>
using stdx::basic_string_view< charT, traits >::difference_type = ptrdiff_t

◆ iterator

template<class charT , class traits = std::char_traits<charT>>
using stdx::basic_string_view< charT, traits >::iterator = const_iterator

◆ pointer

template<class charT , class traits = std::char_traits<charT>>
using stdx::basic_string_view< charT, traits >::pointer = const value_type *

◆ reference

template<class charT , class traits = std::char_traits<charT>>
using stdx::basic_string_view< charT, traits >::reference = const value_type &

◆ reverse_iterator

template<class charT , class traits = std::char_traits<charT>>
using stdx::basic_string_view< charT, traits >::reverse_iterator = const_reverse_iterator

◆ size_type

template<class charT , class traits = std::char_traits<charT>>
using stdx::basic_string_view< charT, traits >::size_type = size_t

◆ traits_type

template<class charT , class traits = std::char_traits<charT>>
using stdx::basic_string_view< charT, traits >::traits_type = traits

◆ value_type

template<class charT , class traits = std::char_traits<charT>>
using stdx::basic_string_view< charT, traits >::value_type = charT

Member Enumeration Documentation

◆ anonymous enum

template<class charT , class traits = std::char_traits<charT>>
anonymous enum : size_type
Enumerator
npos 

Constructor & Destructor Documentation

◆ basic_string_view() [1/5]

template<class charT , class traits = std::char_traits<charT>>
constexpr stdx::basic_string_view< charT, traits >::basic_string_view ( )
inlineconstexprnoexcept

◆ basic_string_view() [2/5]

template<class charT , class traits = std::char_traits<charT>>
constexpr stdx::basic_string_view< charT, traits >::basic_string_view ( const basic_string_view< charT, traits > &  rhs)
constexprdefaultnoexcept

◆ basic_string_view() [3/5]

template<class charT , class traits = std::char_traits<charT>>
template<typename Allocator >
constexpr stdx::basic_string_view< charT, traits >::basic_string_view ( const std::basic_string< value_type, traits_type, Allocator > &  str)
inlineconstexprnoexcept

◆ basic_string_view() [4/5]

template<class charT , class traits = std::char_traits<charT>>
constexpr STDX_NONNULL stdx::basic_string_view< charT, traits >::basic_string_view ( const_pointer  data)
inlineconstexpr

◆ basic_string_view() [5/5]

template<class charT , class traits = std::char_traits<charT>>
constexpr STDX_NONNULL stdx::basic_string_view< charT, traits >::basic_string_view ( const_pointer  data,
size_type  len 
)
inlineconstexpr

Member Function Documentation

◆ at()

template<class charT , class traits = std::char_traits<charT>>
constexpr const_reference stdx::basic_string_view< charT, traits >::at ( size_type  pos) const
inlineconstexpr

◆ back()

template<class charT , class traits = std::char_traits<charT>>
constexpr const_reference stdx::basic_string_view< charT, traits >::back ( ) const
inlineconstexprnoexcept

last element.

  • Requires: !empty()
Returns
ref to last element

◆ begin()

template<class charT , class traits = std::char_traits<charT>>
constexpr const_iterator stdx::basic_string_view< charT, traits >::begin ( ) const
inlineconstexprnoexcept

◆ cbegin()

template<class charT , class traits = std::char_traits<charT>>
constexpr const_iterator stdx::basic_string_view< charT, traits >::cbegin ( ) const
inlineconstexprnoexcept

◆ cend()

template<class charT , class traits = std::char_traits<charT>>
constexpr const_iterator stdx::basic_string_view< charT, traits >::cend ( ) const
inlineconstexprnoexcept

◆ clear()

template<class charT , class traits = std::char_traits<charT>>
void stdx::basic_string_view< charT, traits >::clear ( )
inlinenoexcept

◆ compare() [1/6]

template<class charT , class traits = std::char_traits<charT>>
constexpr int stdx::basic_string_view< charT, traits >::compare ( basic_string_view< charT, traits >  s) const
inlineconstexprnoexcept

◆ compare() [2/6]

template<class charT , class traits = std::char_traits<charT>>
constexpr int stdx::basic_string_view< charT, traits >::compare ( const value_type s) const
inlineconstexpr

◆ compare() [3/6]

template<class charT , class traits = std::char_traits<charT>>
constexpr int stdx::basic_string_view< charT, traits >::compare ( size_t  pos1,
size_type  n1,
basic_string_view< charT, traits >  s 
) const
inlineconstexpr

◆ compare() [4/6]

template<class charT , class traits = std::char_traits<charT>>
constexpr int stdx::basic_string_view< charT, traits >::compare ( size_t  pos1,
size_type  n1,
basic_string_view< charT, traits >  s,
size_type  pos2,
size_type  n2 
) const
inlineconstexpr

◆ compare() [5/6]

template<class charT , class traits = std::char_traits<charT>>
constexpr int stdx::basic_string_view< charT, traits >::compare ( size_t  pos1,
size_type  n1,
const value_type s 
) const
inlineconstexpr

◆ compare() [6/6]

template<class charT , class traits = std::char_traits<charT>>
constexpr int stdx::basic_string_view< charT, traits >::compare ( size_t  pos1,
size_type  n1,
const value_type s,
size_type  pos2,
size_type  n2 
) const
inlineconstexpr

◆ copy()

template<class charT , class traits = std::char_traits<charT>>
size_type stdx::basic_string_view< charT, traits >::copy ( charT *  s,
size_type  n,
size_type  pos = 0 
) const
inline

copy into external buffer.

if n > characters available: rest of string

Parameters
spointer to start of destination
ncharacter-length of s
posstart position
Exceptions
std::out_of_rangeif pos > size()

◆ crbegin()

template<class charT , class traits = std::char_traits<charT>>
constexpr const_reverse_iterator stdx::basic_string_view< charT, traits >::crbegin ( ) const
inlineconstexprnoexcept

◆ crend()

template<class charT , class traits = std::char_traits<charT>>
constexpr const_reverse_iterator stdx::basic_string_view< charT, traits >::crend ( ) const
inlineconstexprnoexcept

◆ data()

template<class charT , class traits = std::char_traits<charT>>
constexpr const_pointer stdx::basic_string_view< charT, traits >::data ( ) const
inlineconstexprnoexcept

pointer to underlaying data.

may not be null-terminated.

◆ empty()

template<class charT , class traits = std::char_traits<charT>>
constexpr bool stdx::basic_string_view< charT, traits >::empty ( ) const
inlineconstexprnoexcept

◆ end()

template<class charT , class traits = std::char_traits<charT>>
constexpr const_iterator stdx::basic_string_view< charT, traits >::end ( ) const
inlineconstexprnoexcept

◆ find()

template<class charT , class traits = std::char_traits<charT>>
size_type stdx::basic_string_view< charT, traits >::find ( basic_string_view< charT, traits >  str,
size_type  pos = 0 
) const
inlinenoexcept

◆ front()

template<class charT , class traits = std::char_traits<charT>>
constexpr const_reference stdx::basic_string_view< charT, traits >::front ( ) const
inlineconstexprnoexcept

first element.

  • Requires: !empty()
Returns
ref to first element

◆ length()

template<class charT , class traits = std::char_traits<charT>>
constexpr size_type stdx::basic_string_view< charT, traits >::length ( ) const
inlineconstexprnoexcept

◆ max_size()

template<class charT , class traits = std::char_traits<charT>>
constexpr size_type stdx::basic_string_view< charT, traits >::max_size ( ) const
inlineconstexprnoexcept

◆ operator std::basic_string< charT, traits, Allocator >()

template<class charT , class traits = std::char_traits<charT>>
template<class Allocator >
stdx::basic_string_view< charT, traits >::operator std::basic_string< charT, traits, Allocator > ( ) const
inlineexplicit

◆ operator=()

template<class charT , class traits = std::char_traits<charT>>
constexpr basic_string_view& stdx::basic_string_view< charT, traits >::operator= ( const basic_string_view< charT, traits > &  )
constexprdefaultnoexcept

◆ operator[]()

template<class charT , class traits = std::char_traits<charT>>
constexpr const_reference stdx::basic_string_view< charT, traits >::operator[] ( size_type  pos) const
inlineconstexprnoexcept

◆ rbegin()

template<class charT , class traits = std::char_traits<charT>>
constexpr const_reverse_iterator stdx::basic_string_view< charT, traits >::rbegin ( ) const
inlineconstexprnoexcept

◆ remove_prefix()

template<class charT , class traits = std::char_traits<charT>>
void stdx::basic_string_view< charT, traits >::remove_prefix ( size_type  n)
inline

◆ remove_suffix()

template<class charT , class traits = std::char_traits<charT>>
void stdx::basic_string_view< charT, traits >::remove_suffix ( size_type  n)
inline

◆ rend()

template<class charT , class traits = std::char_traits<charT>>
constexpr const_reverse_iterator stdx::basic_string_view< charT, traits >::rend ( ) const
inlineconstexprnoexcept

◆ size()

template<class charT , class traits = std::char_traits<charT>>
constexpr size_type stdx::basic_string_view< charT, traits >::size ( ) const
inlineconstexprnoexcept

◆ substr()

template<class charT , class traits = std::char_traits<charT>>
constexpr basic_string_view stdx::basic_string_view< charT, traits >::substr ( size_type  pos = 0,
size_type  n = npos 
) const
inlineconstexpr

get substring of a string_view.

if n > characters available: rest of string

Parameters
posstart position
nlength of substring from start position
Exceptions
std::out_of_rangeif pos > size()

◆ swap()

template<class charT , class traits = std::char_traits<charT>>
void stdx::basic_string_view< charT, traits >::swap ( basic_string_view< charT, traits > &  s)
inlinenoexcept

Member Data Documentation

◆ length_

template<class charT , class traits = std::char_traits<charT>>
size_type stdx::basic_string_view< charT, traits >::length_
private

◆ ptr_

template<class charT , class traits = std::char_traits<charT>>
const value_type* stdx::basic_string_view< charT, traits >::ptr_
private

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