CAF  0.17.2
Public Types | Public Member Functions | Static Public Attributes | List of all members
caf::string_view Class Reference

Drop-in replacement for C++17 std::string_view. More...

#include <string_view.hpp>

Inheritance diagram for caf::string_view:
caf::detail::comparable< string_view >

Public Types

using value_type = char
 
using pointer = value_type *
 
using const_pointer = const value_type *
 
using reference = value_type &
 
using const_reference = const value_type &
 
using const_iterator = const_pointer
 
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 string_view (const char *cstr, size_t length) noexcept
 
template<size_t N>
constexpr string_view (const char(&cstr)[N]) noexcept
 
constexpr string_view (const string_view &) noexcept=default
 
template<class T , class = typename std::enable_if<detail::is_string_like<T>::value>::type>
 string_view (const T &str) noexcept
 
string_viewoperator= (const string_view &) noexcept=default
 
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_iterator begin () const noexcept
 
constexpr const_iterator end () const noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr const_iterator cend () const noexcept
 
const_reverse_iterator rbegin () const noexcept
 
const_reverse_iterator rend () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
const_reverse_iterator crend () const noexcept
 
constexpr const_reference operator[] (size_type pos) const
 
const_reference at (size_type pos) const
 
constexpr const_reference front () const
 
constexpr const_reference back () const
 
constexpr const_pointer data () const noexcept
 
void remove_prefix (size_type n)
 
void remove_suffix (size_type n)
 
void assign (const_pointer data, size_type len)
 
size_type copy (pointer dest, size_type n, size_type pos=0) const
 
string_view substr (size_type pos=0, size_type n=npos) const noexcept
 
int compare (string_view s) const noexcept
 
int compare (size_type pos1, size_type n1, string_view str) const noexcept
 
int compare (size_type pos1, size_type n1, string_view str, size_type pos2, size_type n2) const noexcept
 
int compare (const_pointer str) const noexcept
 
int compare (size_type pos, size_type n, const_pointer str) const noexcept
 
int compare (size_type pos1, size_type n1, const_pointer s, size_type n2) const noexcept
 
size_type find (string_view str, size_type pos=0) const noexcept
 
size_type find (value_type ch, size_type pos=0) const noexcept
 
size_type find (const_pointer str, size_type pos, size_type n) const noexcept
 
size_type find (const_pointer str, size_type pos=0) const noexcept
 
size_type rfind (string_view str, size_type pos=npos) const noexcept
 
size_type rfind (value_type ch, size_type pos=npos) const noexcept
 
size_type rfind (const_pointer str, size_type pos, size_type n) const noexcept
 
size_type rfind (const_pointer str, size_type pos=npos) const noexcept
 
size_type find_first_of (string_view str, size_type pos=0) const noexcept
 
size_type find_first_of (value_type ch, size_type pos=0) const noexcept
 
size_type find_first_of (const_pointer str, size_type pos, size_type n) const noexcept
 
size_type find_first_of (const_pointer str, size_type pos=0) const noexcept
 
size_type find_last_of (string_view str, size_type pos=npos) const noexcept
 
size_type find_last_of (value_type ch, size_type pos=npos) const noexcept
 
size_type find_last_of (const_pointer str, size_type pos, size_type n) const noexcept
 
size_type find_last_of (const_pointer str, size_type pos=npos) const noexcept
 
size_type find_first_not_of (string_view str, size_type pos=0) const noexcept
 
size_type find_first_not_of (value_type ch, size_type pos=0) const noexcept
 
size_type find_first_not_of (const_pointer str, size_type pos, size_type n) const noexcept
 
size_type find_first_not_of (const_pointer str, size_type pos=0) const noexcept
 
size_type find_last_not_of (string_view str, size_type pos=npos) const noexcept
 
size_type find_last_not_of (value_type ch, size_type pos=npos) const noexcept
 
size_type find_last_not_of (const_pointer str, size_type pos, size_type n) const noexcept
 
size_type find_last_not_of (const_pointer str, size_type pos=npos) const noexcept
 

Static Public Attributes

static constexpr size_type npos = std::numeric_limits<size_type>::max()
 

Detailed Description

Drop-in replacement for C++17 std::string_view.


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