The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
utils::basic_string_view< charT, traits > Class Template Reference

#include <string_view.hpp>

Public Types

typedef traits traits_type
 
typedef charT value_type
 
typedef charT * pointer
 
typedef const charT * const_pointer
 
typedef charT & reference
 
typedef const charT & const_reference
 
typedef const_pointer const_iterator
 
typedef const_iterator iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 
typedef const_reverse_iterator reverse_iterator
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 

Public Member Functions

BOOST_CONSTEXPR basic_string_view () BOOST_NOEXCEPT
 
BOOST_CONSTEXPR basic_string_view (const basic_string_view &rhs) BOOST_NOEXCEPT=default
 
basic_string_viewoperator= (const basic_string_view &rhs) BOOST_NOEXCEPT=default
 
template<typename Allocator >
 basic_string_view (const std::basic_string< charT, traits, Allocator > &str) BOOST_NOEXCEPT
 
BOOST_CONSTEXPR basic_string_view (const charT *str)
 
BOOST_CONSTEXPR basic_string_view (const charT *str, size_type len)
 
BOOST_CONSTEXPR const_iterator begin () const BOOST_NOEXCEPT
 
BOOST_CONSTEXPR const_iterator cbegin () const BOOST_NOEXCEPT
 
BOOST_CONSTEXPR const_iterator end () const BOOST_NOEXCEPT
 
BOOST_CONSTEXPR const_iterator cend () const BOOST_NOEXCEPT
 
const_reverse_iterator rbegin () const BOOST_NOEXCEPT
 
const_reverse_iterator crbegin () const BOOST_NOEXCEPT
 
const_reverse_iterator rend () const BOOST_NOEXCEPT
 
const_reverse_iterator crend () const BOOST_NOEXCEPT
 
BOOST_CONSTEXPR size_type size () const BOOST_NOEXCEPT
 
BOOST_CONSTEXPR size_type length () const BOOST_NOEXCEPT
 
BOOST_CONSTEXPR size_type max_size () const BOOST_NOEXCEPT
 
BOOST_CONSTEXPR bool empty () const BOOST_NOEXCEPT
 
BOOST_CONSTEXPR const_reference operator[] (size_type pos) const BOOST_NOEXCEPT
 
const_reference at (size_t pos) const
 
BOOST_CONSTEXPR const_reference front () const
 
BOOST_CONSTEXPR const_reference back () const
 
BOOST_CONSTEXPR const_pointer data () const BOOST_NOEXCEPT
 
void clear () BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR void remove_prefix (size_type n)
 
BOOST_CXX14_CONSTEXPR void remove_suffix (size_type n)
 
BOOST_CXX14_CONSTEXPR void swap (basic_string_view &s) BOOST_NOEXCEPT
 
template<typename Allocator >
 operator std::basic_string< charT, traits, Allocator > () const
 
template<typename Allocator = std::allocator<charT>>
std::basic_string< charT,
traits, Allocator > 
to_string (const Allocator &a=Allocator()) const
 
size_type copy (charT *s, size_type n, size_type pos=0) const
 
BOOST_CXX14_CONSTEXPR
basic_string_view 
substr (size_type pos, size_type n=npos) const
 
BOOST_CXX14_CONSTEXPR int compare (basic_string_view x) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR int compare (size_type pos1, size_type n1, basic_string_view x) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR int compare (size_type pos1, size_type n1, basic_string_view x, size_type pos2, size_type n2) const
 
BOOST_CXX14_CONSTEXPR int compare (const charT *x) const
 
BOOST_CXX14_CONSTEXPR int compare (size_type pos1, size_type n1, const charT *x) const
 
BOOST_CXX14_CONSTEXPR int compare (size_type pos1, size_type n1, const charT *x, size_type n2) const
 
BOOST_CONSTEXPR bool starts_with (charT c) const BOOST_NOEXCEPT
 
BOOST_CONSTEXPR bool starts_with (basic_string_view x) const BOOST_NOEXCEPT
 
BOOST_CONSTEXPR bool ends_with (charT c) const BOOST_NOEXCEPT
 
BOOST_CONSTEXPR bool ends_with (basic_string_view x) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find (basic_string_view s, size_type pos=0) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find (charT c, size_type pos=0) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find (const charT *s, size_type pos, size_type n) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find (const charT *s, size_type pos=0) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type rfind (basic_string_view s, size_type pos=npos) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type rfind (charT c, size_type pos=npos) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type rfind (const charT *s, size_type pos, size_type n) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type rfind (const charT *s, size_type pos=npos) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_first_of (basic_string_view s, size_type pos=0) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_first_of (charT c, size_type pos=0) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_first_of (const charT *s, size_type pos, size_type n) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_first_of (const charT *s, size_type pos=0) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_last_of (basic_string_view s, size_type pos=npos) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_last_of (charT c, size_type pos=npos) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_last_of (const charT *s, size_type pos, size_type n) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_last_of (const charT *s, size_type pos=npos) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_first_not_of (basic_string_view s, size_type pos=0) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_first_not_of (charT c, size_type pos=0) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_first_not_of (const charT *s, size_type pos, size_type n) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_first_not_of (const charT *s, size_type pos=0) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_last_not_of (basic_string_view s, size_type pos=npos) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_last_not_of (charT c, size_type pos=npos) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_last_not_of (const charT *s, size_type pos, size_type n) const BOOST_NOEXCEPT
 
BOOST_CXX14_CONSTEXPR size_type find_last_not_of (const charT *s, size_type pos=npos) const BOOST_NOEXCEPT
 

Static Public Attributes

static
BOOST_CONSTEXPR_OR_CONST
size_type 
npos = size_type(-1)
 

Private Member Functions

template<typename r_iter >
size_type reverse_distance (r_iter first, r_iter last) const BOOST_NOEXCEPT
 
template<typename Iterator >
Iterator find_not_of (Iterator first, Iterator last, basic_string_view s) const BOOST_NOEXCEPT
 

Private Attributes

const charT * ptr_
 
std::size_t len_
 

Detailed Description

template<typename charT, typename traits>
class utils::basic_string_view< charT, traits >

Definition at line 64 of file string_view.hpp.

Member Typedef Documentation

template<typename charT, typename traits>
typedef const_pointer utils::basic_string_view< charT, traits >::const_iterator

Definition at line 76 of file string_view.hpp.

template<typename charT, typename traits>
typedef const charT* utils::basic_string_view< charT, traits >::const_pointer

Definition at line 73 of file string_view.hpp.

template<typename charT, typename traits>
typedef const charT& utils::basic_string_view< charT, traits >::const_reference

Definition at line 75 of file string_view.hpp.

template<typename charT, typename traits>
typedef std::reverse_iterator<const_iterator> utils::basic_string_view< charT, traits >::const_reverse_iterator

Definition at line 78 of file string_view.hpp.

template<typename charT, typename traits>
typedef std::ptrdiff_t utils::basic_string_view< charT, traits >::difference_type

Definition at line 81 of file string_view.hpp.

template<typename charT, typename traits>
typedef const_iterator utils::basic_string_view< charT, traits >::iterator

Definition at line 77 of file string_view.hpp.

template<typename charT, typename traits>
typedef charT* utils::basic_string_view< charT, traits >::pointer

Definition at line 72 of file string_view.hpp.

template<typename charT, typename traits>
typedef charT& utils::basic_string_view< charT, traits >::reference

Definition at line 74 of file string_view.hpp.

template<typename charT, typename traits>
typedef const_reverse_iterator utils::basic_string_view< charT, traits >::reverse_iterator

Definition at line 79 of file string_view.hpp.

template<typename charT, typename traits>
typedef std::size_t utils::basic_string_view< charT, traits >::size_type

Definition at line 80 of file string_view.hpp.

template<typename charT, typename traits>
typedef traits utils::basic_string_view< charT, traits >::traits_type

Definition at line 70 of file string_view.hpp.

template<typename charT, typename traits>
typedef charT utils::basic_string_view< charT, traits >::value_type

Definition at line 71 of file string_view.hpp.

Constructor & Destructor Documentation

template<typename charT, typename traits>
BOOST_CONSTEXPR utils::basic_string_view< charT, traits >::basic_string_view ( )
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR utils::basic_string_view< charT, traits >::basic_string_view ( const basic_string_view< charT, traits > &  rhs)
default
template<typename charT, typename traits>
template<typename Allocator >
utils::basic_string_view< charT, traits >::basic_string_view ( const std::basic_string< charT, traits, Allocator > &  str)
inline

Definition at line 95 of file string_view.hpp.

template<typename charT, typename traits>
BOOST_CONSTEXPR utils::basic_string_view< charT, traits >::basic_string_view ( const charT *  str)
inline

Definition at line 105 of file string_view.hpp.

template<typename charT, typename traits>
BOOST_CONSTEXPR utils::basic_string_view< charT, traits >::basic_string_view ( const charT *  str,
size_type  len 
)
inline

Definition at line 108 of file string_view.hpp.

Member Function Documentation

template<typename charT, typename traits>
const_reference utils::basic_string_view< charT, traits >::at ( size_t  pos) const
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR const_reference utils::basic_string_view< charT, traits >::back ( ) const
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR const_iterator utils::basic_string_view< charT, traits >::begin ( ) const
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR const_iterator utils::basic_string_view< charT, traits >::cbegin ( ) const
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR const_iterator utils::basic_string_view< charT, traits >::cend ( ) const
inline
template<typename charT, typename traits>
void utils::basic_string_view< charT, traits >::clear ( )
inline

Definition at line 139 of file string_view.hpp.

References utils::basic_string_view< charT, traits >::len_.

template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR int utils::basic_string_view< charT, traits >::compare ( basic_string_view< charT, traits >  x) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR int utils::basic_string_view< charT, traits >::compare ( size_type  pos1,
size_type  n1,
basic_string_view< charT, traits >  x 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR int utils::basic_string_view< charT, traits >::compare ( size_type  pos1,
size_type  n1,
basic_string_view< charT, traits >  x,
size_type  pos2,
size_type  n2 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR int utils::basic_string_view< charT, traits >::compare ( const charT *  x) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR int utils::basic_string_view< charT, traits >::compare ( size_type  pos1,
size_type  n1,
const charT *  x 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR int utils::basic_string_view< charT, traits >::compare ( size_type  pos1,
size_type  n1,
const charT *  x,
size_type  n2 
) const
inline
template<typename charT, typename traits>
size_type utils::basic_string_view< charT, traits >::copy ( charT *  s,
size_type  n,
size_type  pos = 0 
) const
inline
template<typename charT, typename traits>
const_reverse_iterator utils::basic_string_view< charT, traits >::crbegin ( ) const
inline
template<typename charT, typename traits>
const_reverse_iterator utils::basic_string_view< charT, traits >::crend ( ) const
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR const_pointer utils::basic_string_view< charT, traits >::data ( ) const
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR bool utils::basic_string_view< charT, traits >::empty ( ) const
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR const_iterator utils::basic_string_view< charT, traits >::end ( ) const
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR bool utils::basic_string_view< charT, traits >::ends_with ( charT  c) const
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR bool utils::basic_string_view< charT, traits >::ends_with ( basic_string_view< charT, traits >  x) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find ( basic_string_view< charT, traits >  s,
size_type  pos = 0 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find ( charT  c,
size_type  pos = 0 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find ( const charT *  s,
size_type  pos,
size_type  n 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find ( const charT *  s,
size_type  pos = 0 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_first_not_of ( basic_string_view< charT, traits >  s,
size_type  pos = 0 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_first_not_of ( charT  c,
size_type  pos = 0 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_first_not_of ( const charT *  s,
size_type  pos,
size_type  n 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_first_not_of ( const charT *  s,
size_type  pos = 0 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_first_of ( basic_string_view< charT, traits >  s,
size_type  pos = 0 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_first_of ( charT  c,
size_type  pos = 0 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_first_of ( const charT *  s,
size_type  pos,
size_type  n 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_first_of ( const charT *  s,
size_type  pos = 0 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_last_not_of ( basic_string_view< charT, traits >  s,
size_type  pos = npos 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_last_not_of ( charT  c,
size_type  pos = npos 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_last_not_of ( const charT *  s,
size_type  pos,
size_type  n 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_last_not_of ( const charT *  s,
size_type  pos = npos 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_last_of ( basic_string_view< charT, traits >  s,
size_type  pos = npos 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_last_of ( charT  c,
size_type  pos = npos 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_last_of ( const charT *  s,
size_type  pos,
size_type  n 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::find_last_of ( const charT *  s,
size_type  pos = npos 
) const
inline
template<typename charT, typename traits>
template<typename Iterator >
Iterator utils::basic_string_view< charT, traits >::find_not_of ( Iterator  first,
Iterator  last,
basic_string_view< charT, traits >  s 
) const
inlineprivate
template<typename charT, typename traits>
BOOST_CONSTEXPR const_reference utils::basic_string_view< charT, traits >::front ( ) const
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR size_type utils::basic_string_view< charT, traits >::length ( ) const
inline

Definition at line 123 of file string_view.hpp.

References utils::basic_string_view< charT, traits >::len_.

template<typename charT, typename traits>
BOOST_CONSTEXPR size_type utils::basic_string_view< charT, traits >::max_size ( ) const
inline

Definition at line 124 of file string_view.hpp.

References utils::basic_string_view< charT, traits >::len_.

template<typename charT, typename traits>
template<typename Allocator >
utils::basic_string_view< charT, traits >::operator std::basic_string< charT, traits, Allocator > ( ) const
inlineexplicit
template<typename charT, typename traits>
basic_string_view& utils::basic_string_view< charT, traits >::operator= ( const basic_string_view< charT, traits > &  rhs)
default
template<typename charT, typename traits>
BOOST_CONSTEXPR const_reference utils::basic_string_view< charT, traits >::operator[] ( size_type  pos) const
inline

Definition at line 128 of file string_view.hpp.

References utils::basic_string_view< charT, traits >::ptr_.

template<typename charT, typename traits>
const_reverse_iterator utils::basic_string_view< charT, traits >::rbegin ( ) const
inline

Definition at line 116 of file string_view.hpp.

References utils::basic_string_view< charT, traits >::end().

template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR void utils::basic_string_view< charT, traits >::remove_prefix ( size_type  n)
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR void utils::basic_string_view< charT, traits >::remove_suffix ( size_type  n)
inline

Definition at line 148 of file string_view.hpp.

References utils::basic_string_view< charT, traits >::len_, and n.

template<typename charT, typename traits>
const_reverse_iterator utils::basic_string_view< charT, traits >::rend ( ) const
inline
template<typename charT, typename traits>
template<typename r_iter >
size_type utils::basic_string_view< charT, traits >::reverse_distance ( r_iter  first,
r_iter  last 
) const
inlineprivate
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::rfind ( basic_string_view< charT, traits >  s,
size_type  pos = npos 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::rfind ( charT  c,
size_type  pos = npos 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::rfind ( const charT *  s,
size_type  pos,
size_type  n 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR size_type utils::basic_string_view< charT, traits >::rfind ( const charT *  s,
size_type  pos = npos 
) const
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR size_type utils::basic_string_view< charT, traits >::size ( ) const
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR bool utils::basic_string_view< charT, traits >::starts_with ( charT  c) const
inline
template<typename charT, typename traits>
BOOST_CONSTEXPR bool utils::basic_string_view< charT, traits >::starts_with ( basic_string_view< charT, traits >  x) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR basic_string_view utils::basic_string_view< charT, traits >::substr ( size_type  pos,
size_type  n = npos 
) const
inline
template<typename charT, typename traits>
BOOST_CXX14_CONSTEXPR void utils::basic_string_view< charT, traits >::swap ( basic_string_view< charT, traits > &  s)
inline
template<typename charT, typename traits>
template<typename Allocator = std::allocator<charT>>
std::basic_string<charT, traits, Allocator> utils::basic_string_view< charT, traits >::to_string ( const Allocator &  a = Allocator()) const
inline

Member Data Documentation

template<typename charT, typename traits>
std::size_t utils::basic_string_view< charT, traits >::len_
private
template<typename charT, typename traits>
BOOST_CONSTEXPR_OR_CONST size_type utils::basic_string_view< charT, traits >::npos = size_type(-1)
static
template<typename charT, typename traits>
const charT* utils::basic_string_view< charT, traits >::ptr_
private

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