BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS > Class Template Reference

#include <bslstl_stringview.h>

Inheritance diagram for bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >:
bslstl::StringRefData< CHAR_TYPE > bslstl::StringRefImp< CHAR_TYPE >

Public Types

typedef CHAR_TRAITS traits_type
 
typedef CHAR_TYPE value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef const value_typeconst_iterator
 
typedef const_iterator iterator
 
typedef bsl::reverse_iterator< iteratorreverse_iterator
 
typedef bsl::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (basic_string_view, bsl::is_trivially_copyable)
 
BSLS_KEYWORD_CONSTEXPR basic_string_view () BSLS_KEYWORD_NOEXCEPT
 Create an empty view.
 
 basic_string_view (const basic_string_view &original)=default
 
BSLS_KEYWORD_CONSTEXPR_CPP17 basic_string_view (const CHAR_TYPE *characterString)
 
BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view (const CHAR_TYPE *characterString, size_type numChars)
 
template<class CONTG_ITER , class SENTINEL >
BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view (CONTG_ITER first, SENTINEL last, typename bsl::enable_if< BasicStringView_IsCompatibleIterator< CHAR_TYPE, CONTG_ITER >::value &&BasicStringView_IsCompatibleSentinel< SENTINEL >::value >::type *=0)
 
template<class ALLOCATOR >
 basic_string_view (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &str)
 Create a view of the specified string.
 
 ~basic_string_view ()=default
 Destroy this object.
 
basic_string_viewoperator= (const basic_string_view &rhs)=default
 
template<class ALLOCATOR >
BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_viewoperator= (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &rhs) BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 void remove_prefix (size_type numChars)
 
BSLS_KEYWORD_CONSTEXPR_CPP14 void remove_suffix (size_type numChars)
 
void swap (basic_string_view &other) BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR const_iterator begin () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR const_iterator cbegin () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR const_iterator end () const BSLS_KEYWORD_NOEXCEPT
 Return the past-the-end iterator for this view.
 
BSLS_KEYWORD_CONSTEXPR const_iterator cend () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP17 const_reverse_iterator rbegin () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP17 const_reverse_iterator crbegin () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP17 const_reverse_iterator rend () const BSLS_KEYWORD_NOEXCEPT
 Return the past-the-end reverse iterator for this view.
 
BSLS_KEYWORD_CONSTEXPR_CPP17 const_reverse_iterator crend () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR size_type size () const BSLS_KEYWORD_NOEXCEPT
 Return the length of this view.
 
BSLS_KEYWORD_CONSTEXPR size_type length () const BSLS_KEYWORD_NOEXCEPT
 Return the length of this view.
 
BSLS_KEYWORD_CONSTEXPR size_type max_size () const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR bool empty () const BSLS_KEYWORD_NOEXCEPT
 Return true if this view has length 0, and false otherwise.
 
BSLS_KEYWORD_CONSTEXPR_CPP14 const_reference operator[] (size_type position) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 const_reference at (size_type position) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 const_reference front () const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 const_reference back () const
 
BSLS_KEYWORD_CONSTEXPR const_pointer data () const BSLS_KEYWORD_NOEXCEPT
 
size_type copy (CHAR_TYPE *characterString, size_type numChars, size_type position=0) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view substr (size_type position=0, size_type numChars=npos) const
 
BSLS_KEYWORD_CONSTEXPR_CPP17 int compare (basic_string_view other) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 int compare (size_type position, size_type numChars, basic_string_view other) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 int compare (size_type lhsPosition, size_type lhsNumChars, basic_string_view other, size_type otherPosition, size_type otherNumChars) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 int compare (const CHAR_TYPE *other) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 int compare (size_type lhsPosition, size_type lhsNumChars, const CHAR_TYPE *other) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 int compare (size_type lhsPosition, size_type lhsNumChars, const CHAR_TYPE *other, size_type otherNumChars) const
 
BSLS_KEYWORD_CONSTEXPR_CPP17 bool starts_with (basic_string_view subview) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR bool starts_with (CHAR_TYPE character) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP17 bool starts_with (const CHAR_TYPE *characterString) const
 
BSLS_KEYWORD_CONSTEXPR_CPP17 bool ends_with (basic_string_view subview) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR bool ends_with (CHAR_TYPE character) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP17 bool ends_with (const CHAR_TYPE *characterString) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find (basic_string_view subview, size_type position=0) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
 
BSLS_KEYWORD_CONSTEXPR_CPP17 size_type find (const CHAR_TYPE *characterString, size_type position=0) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find (CHAR_TYPE character, size_type position=0) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type rfind (basic_string_view subview, size_type position=npos) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type rfind (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type rfind (const CHAR_TYPE *characterString, size_type position=npos) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type rfind (CHAR_TYPE character, size_type position=npos) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find_first_of (basic_string_view subview, size_type position=0) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find_first_of (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
 
BSLS_KEYWORD_CONSTEXPR_CPP17 size_type find_first_of (const CHAR_TYPE *characterString, size_type position=0) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find_first_of (CHAR_TYPE character, size_type position=0) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find_last_of (basic_string_view subview, size_type position=npos) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find_last_of (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
 
BSLS_KEYWORD_CONSTEXPR_CPP17 size_type find_last_of (const CHAR_TYPE *characterString, size_type position=npos) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find_last_of (CHAR_TYPE character, size_type position=npos) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find_first_not_of (basic_string_view subview, size_type position=0) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find_first_not_of (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
 
BSLS_KEYWORD_CONSTEXPR_CPP17 size_type find_first_not_of (const CHAR_TYPE *characterString, size_type position=0) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find_first_not_of (CHAR_TYPE character, size_type position=0) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find_last_not_of (basic_string_view subview, size_type position=npos) const BSLS_KEYWORD_NOEXCEPT
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find_last_not_of (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
 
BSLS_KEYWORD_CONSTEXPR_CPP17 size_type find_last_not_of (const CHAR_TYPE *characterString, size_type position=npos) const
 
BSLS_KEYWORD_CONSTEXPR_CPP14 size_type find_last_not_of (CHAR_TYPE character, size_type position=npos) const BSLS_KEYWORD_NOEXCEPT
 
template<class ALLOCATOR >
BSLS_KEYWORD_EXPLICIT operator std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > () const
 
template<class CONTG_ITER , class SENTINEL >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view (CONTG_ITER first, SENTINEL last, typename bsl::enable_if< BasicStringView_IsCompatibleIterator< CHAR_TYPE, CONTG_ITER >::value &&BasicStringView_IsCompatibleSentinel< SENTINEL >::value >::type *)
 
template<class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string_view (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &str)
 
template<class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS > & operator= (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &rhs) BSLS_KEYWORD_NOEXCEPT
 

Static Public Attributes

static const size_type npos = ~size_type(0)
 

Detailed Description

template<class CHAR_TYPE, class CHAR_TRAITS = char_traits<CHAR_TYPE>>
class bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >

This class template provides an STL-compliant string_view . This implementation offers strong exception guarantees (see below), with the general rule that any method that attempts to access a position outside the valid range of a string_view throws std::out_of_range.

Note that the search methods, such as find, rfind, etc, do not actually access invalid positions, so they do not throw exceptions.

More generally, this class supports an almost complete set of in-core value semantic operations, including copy construction, assignment, equality comparison (but excluding ostream printing since this component is below STL). A precise operational definition of when two objects have the same value can be found in the description of operator== for the class. This class is exception neutral with full guarantee of rollback: if an exception is thrown during the invocation of a method on a pre-existing object, the object is left unchanged. In no event is memory leaked.

See bslstl_stringview

Member Typedef Documentation

◆ const_iterator

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
typedef const value_type* bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_iterator

◆ const_pointer

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
typedef const value_type* bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_pointer

◆ const_reference

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
typedef const value_type& bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_reference

◆ const_reverse_iterator

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
typedef bsl::reverse_iterator<const_iterator> bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_reverse_iterator

◆ difference_type

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
typedef std::ptrdiff_t bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::difference_type

◆ iterator

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
typedef const_iterator bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::iterator

◆ pointer

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
typedef value_type* bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::pointer

◆ reference

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
typedef value_type& bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::reference

◆ reverse_iterator

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
typedef bsl::reverse_iterator<iterator> bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::reverse_iterator

◆ size_type

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
typedef std::size_t bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type

◆ traits_type

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
typedef CHAR_TRAITS bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::traits_type

◆ value_type

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
typedef CHAR_TYPE bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::value_type

Constructor & Destructor Documentation

◆ basic_string_view() [1/8]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::basic_string_view ( )
inline

◆ basic_string_view() [2/8]

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::basic_string_view ( const basic_string_view< CHAR_TYPE, CHAR_TRAITS > &  original)
default

Create a view that has the same value as the specified original object.

◆ basic_string_view() [3/8]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP17 bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::basic_string_view ( const CHAR_TYPE *  characterString)

Create a view of the specified null-terminated characterString (of length CHAR_TRAITS::length(characterString)).

◆ basic_string_view() [4/8]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::basic_string_view ( const CHAR_TYPE *  characterString,
size_type  numChars 
)

Create a view that has the same value as the subview of the optionally specified numChars length starting at the beginning of the specified characterString. The behavior is undefined unless characterString || (numChars == 0) and numChars <= max_size().

◆ basic_string_view() [5/8]

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
template<class CONTG_ITER , class SENTINEL >
BSLS_KEYWORD_CONSTEXPR_CPP14 bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::basic_string_view ( CONTG_ITER  first,
SENTINEL  last,
typename bsl::enable_if< BasicStringView_IsCompatibleIterator< CHAR_TYPE, CONTG_ITER >::value &&BasicStringView_IsCompatibleSentinel< SENTINEL >::value >::type *  = 0 
)

Create a view from of characters in the range starting at the specified first, a contiguous iterator, to the position immediately before the specified end, a sentinel type. The behavior is undefined unless:

  • [first, last) is a contiguous valid range, o if first is 0, then 0 == last - first, and *o the SENTINEL type is *not convertible to std::size_t. Note that contiguous iterator types also provide random access. Also note that pointers to CHAR_TYPE can be used as iterator and sentinel types.

◆ basic_string_view() [6/8]

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
template<class ALLOCATOR >
bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::basic_string_view ( const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  str)

◆ ~basic_string_view()

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::~basic_string_view ( )
default

◆ basic_string_view() [7/8]

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
template<class CONTG_ITER , class SENTINEL >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::basic_string_view ( CONTG_ITER  first,
SENTINEL  last,
typename bsl::enable_if< BasicStringView_IsCompatibleIterator< CHAR_TYPE, CONTG_ITER >::value &&BasicStringView_IsCompatibleSentinel< SENTINEL >::value >::type *   
)

◆ basic_string_view() [8/8]

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
template<class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::basic_string_view ( const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  str)

Member Function Documentation

◆ at()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_reference bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::at ( size_type  position) const

Return a reference providing non-modifiable access to the character at the specified position in this view. Throw std::out_of_range if position >= length().

◆ back()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_reference bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::back ( ) const
inline

Return a reference providing non-modifiable access to the character at the last position in this view. The behavior is undefined if this view is empty. Note that the last position is length() - 1.

◆ begin()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_iterator bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::begin ( ) const
inline

Return an iterator providing non-modifiable access to the first character of this view (or the past-the-end iterator if this view is empty).

◆ BSLMF_NESTED_TRAIT_DECLARATION()

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::BSLMF_NESTED_TRAIT_DECLARATION ( basic_string_view< CHAR_TYPE, CHAR_TRAITS >  ,
bsl::is_trivially_copyable   
)

◆ cbegin()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_iterator bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::cbegin ( ) const
inline

◆ cend()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_iterator bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::cend ( ) const
inline

◆ compare() [1/6]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP17 int bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::compare ( basic_string_view< CHAR_TYPE, CHAR_TRAITS >  other) const

Lexicographically compare this view with the specified other view, and return a negative value if this view is less than other, a positive value if it is greater than other, and 0 in case of equality. See {Lexicographical Comparisons}.

◆ compare() [2/6]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 int bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::compare ( const CHAR_TYPE *  other) const

Lexicographically compare this view with the specified null-terminated other string (of length CHAR_TRAITS::length(other)), and return a negative value if this view is less than other, a positive value if it is greater than other, and 0 in case of equality. The behavior is undefined unless other is a null-terminated string.

◆ compare() [3/6]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 int bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::compare ( size_type  lhsPosition,
size_type  lhsNumChars,
basic_string_view< CHAR_TYPE, CHAR_TRAITS >  other,
size_type  otherPosition,
size_type  otherNumChars 
) const

Lexicographically compare the subview of this view of the specified lhsNumChars length starting at the specified lhsPosition (or the suffix of this view starting at lhsPosition if lhsPosition + lhsNumChars > length()) with the subview of the specified other view of the specified otherNumChars length starting at the specified otherPosition (or the suffix of other starting at otherPosition if otherPosition + otherNumChars > other.length()). Return a negative value if the indicated subview of this view is less than the indicated subview of other, a positive value if it is greater than the indicated subview of other, and 0 in case of equality. Throw std::out_of_range if lhsPosition > length() or otherPosition > other.length(). See {Lexicographical Comparisons}.

◆ compare() [4/6]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 int bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::compare ( size_type  lhsPosition,
size_type  lhsNumChars,
const CHAR_TYPE *  other 
) const

Lexicographically compare the subview of this view of the specified lhsNumChars length starting at the specified lhsPosition (or the suffix of this view starting at lhsPosition if lhsPosition + lhsNumChars > length()) with the specified null-terminated other string (of length CHAR_TRAITS::length(other)), and return a negative value if the indicated subview of this view is less than other, a positive value if it is greater than other, and 0 in case of equality. Throw std::out_of_range if lhsPosition > length().

◆ compare() [5/6]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 int bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::compare ( size_type  lhsPosition,
size_type  lhsNumChars,
const CHAR_TYPE *  other,
size_type  otherNumChars 
) const

Lexicographically compare the subview of this view of the specified lhsNumChars length starting at the specified lhsPosition (or the suffix of this view starting at lhsPosition if lhsPosition + lhsNumChars > length()) with the specified other string of the specified otherNumChars length, and return a negative value if the indicated subview of this view is less than other, a positive value if it is greater than other, and 0 in case of equality. CHAR_TRAITS::lt is used to compare characters. Throw std::out_of_range if lhsPosition > length(). The behavior is undefined unless other || 0 == otherNumChars.

◆ compare() [6/6]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 int bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::compare ( size_type  position,
size_type  numChars,
basic_string_view< CHAR_TYPE, CHAR_TRAITS >  other 
) const

Lexicographically compare the subview of this view of the specified numChars length starting at the specified position (or the suffix of this view starting at position if position + numChars > length()) with the specified other view, and return a negative value if the indicated subview of this view is less than other, a positive value if it is greater than other, and 0 in case of equality. Throw std::out_of_range if position > length(). See {Lexicographical Comparisons}.

◆ copy()

template<class CHAR_TYPE , class CHAR_TRAITS >
basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::copy ( CHAR_TYPE *  characterString,
size_type  numChars,
size_type  position = 0 
) const

Copy from this view, starting from the optionally specified position, the specified numChars or length() - position characters, whichever is smaller, into the specified characterString buffer, and return the number of characters copied. If position is not specified, 0 is used. Throw std::out_of_range if position > length(). Note that the output characterString is not null-terminated. The behavior is undefined unless characterString has enough room to hold at least numChars or length() - position, whichever is smaller, and the characterString does not lie within the source range to be copied.

◆ crbegin()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR_CPP17 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_reverse_iterator bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::crbegin ( ) const
inline

◆ crend()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP17 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_reverse_iterator bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::crend ( ) const

◆ data()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_pointer bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::data ( ) const
inline

Return an address providing non-modifiable access to the underlying character array. Note that this array may be not null-terminated.

◆ empty()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR bool bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::empty ( ) const
inline

◆ end()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_iterator bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::end ( ) const
inline

◆ ends_with() [1/3]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP17 bool bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::ends_with ( basic_string_view< CHAR_TYPE, CHAR_TRAITS >  subview) const

Return true if this view ends with the specified subview, and false otherwise. See {Lexicographical Comparisons}.

◆ ends_with() [2/3]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR bool bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::ends_with ( CHAR_TYPE  character) const

◆ ends_with() [3/3]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP17 bool bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::ends_with ( const CHAR_TYPE *  characterString) const

Return true if this view ends with the specified characterString, and false otherwise.

◆ find() [1/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find ( basic_string_view< CHAR_TYPE, CHAR_TRAITS >  subview,
size_type  position = 0 
) const

Return the starting position of the first occurrence of the specified subview, if it can be found in this view (on or after the optionally specified position) using CHAR_TRAITS::eq to compare characters, and return npos otherwise.

◆ find() [2/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find ( CHAR_TYPE  character,
size_type  position = 0 
) const

Return the position of the first occurrence of the specified character, if such an occurrence can be found in this view (on or after the optionally specified position if such a position is specified), and return npos otherwise.

◆ find() [3/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find ( const CHAR_TYPE *  characterString,
size_type  position,
size_type  numChars 
) const

Return the starting position of the first occurrence of the specified characterString of the specified numChars length, if such a string can be found in this view (on or after the specified position) using CHAR_TRAITS::eq to compare characters, and return npos otherwise. The behavior is undefined unless characterString || (numChars == 0).

◆ find() [4/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP17 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find ( const CHAR_TYPE *  characterString,
size_type  position = 0 
) const

Return the starting position of the first occurrence of the specified null-terminated characterString, if such a string can be found in this view (on or after the optionally specified position) using CHAR_TRAITS::eq to compare characters, and return npos otherwise.

◆ find_first_not_of() [1/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_first_not_of ( basic_string_view< CHAR_TYPE, CHAR_TRAITS >  subview,
size_type  position = 0 
) const

Return the position of the first occurrence of a character not belonging to the specified subview, if such an occurrence can be found in this view (on or after the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_first_not_of() [2/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_first_not_of ( CHAR_TYPE  character,
size_type  position = 0 
) const

Return the position of the first occurrence of a character different from the specified character, if such an occurrence can be found in this view (on or after the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_first_not_of() [3/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_first_not_of ( const CHAR_TYPE *  characterString,
size_type  position,
size_type  numChars 
) const

Return the position of the first occurrence of a character not belonging to the specified characterString of the specified numChars length, if such an occurrence can be found in this view (on or after the specified position) using CHAR_TRAITS::eq to compare characters, and return npos otherwise. The behavior is undefined unless characterString || (numChars == 0).

◆ find_first_not_of() [4/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP17 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_first_not_of ( const CHAR_TYPE *  characterString,
size_type  position = 0 
) const

Return the position of the first occurrence of a character not belonging to the specified characterString, if such an occurrence can be found in this view (on or after the optionally specified position), and return npos otherwise.

◆ find_first_of() [1/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_first_of ( basic_string_view< CHAR_TYPE, CHAR_TRAITS >  subview,
size_type  position = 0 
) const

Return the position of the first occurrence of a character belonging to the specified subview, if such an occurrence can be found in this view (on or after the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_first_of() [2/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_first_of ( CHAR_TYPE  character,
size_type  position = 0 
) const

Return the position of the first occurrence of the specified character, if such an occurrence can be found in this view (on or after the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_first_of() [3/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_first_of ( const CHAR_TYPE *  characterString,
size_type  position,
size_type  numChars 
) const

Return the position of the first occurrence of a character belonging to the specified characterString of the specified numChars length, if such a string can be found in this view (on or after the specified position) using CHAR_TRAITS::eq to compare characters, and return npos otherwise. The behavior is undefined unless characterString || (numChars == 0).

◆ find_first_of() [4/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP17 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_first_of ( const CHAR_TYPE *  characterString,
size_type  position = 0 
) const

Return the position of the first occurrence of a character belonging to the specified characterString, if such an occurrence can be found in this view (on or after the optionally specified position), and return npos otherwise.

◆ find_last_not_of() [1/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_last_not_of ( basic_string_view< CHAR_TYPE, CHAR_TRAITS >  subview,
size_type  position = npos 
) const

Return the position of the last occurrence of a character not belonging to the specified subview, if such an occurrence can be found in this view (on or before the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_last_not_of() [2/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_last_not_of ( CHAR_TYPE  character,
size_type  position = npos 
) const

Return the position of the last occurrence of a character different from the specified character, if such an occurrence can be found in this view (on or before the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_last_not_of() [3/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_last_not_of ( const CHAR_TYPE *  characterString,
size_type  position,
size_type  numChars 
) const

Return the position of the last occurrence of a character not belonging to the specified characterString of the specified numChars length, if such an occurrence can be found in this view (on or after the specified position) using CHAR_TRAITS::eq to compare characters, and return npos otherwise. The behavior is undefined unless characterString || (numChars == 0).

◆ find_last_not_of() [4/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP17 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_last_not_of ( const CHAR_TYPE *  characterString,
size_type  position = npos 
) const

Return the position of the last occurrence of a character not belonging to the specified characterString, if such an occurrence can be found in this view (on or after the optionally specified position), and return npos otherwise.

◆ find_last_of() [1/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_last_of ( basic_string_view< CHAR_TYPE, CHAR_TRAITS >  subview,
size_type  position = npos 
) const

Return the position of the last occurrence of a character belonging to the specified subview, if such an occurrence can be found in this view (on or before the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_last_of() [2/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_last_of ( CHAR_TYPE  character,
size_type  position = npos 
) const

Return the position of the last occurrence of the specified character, if such an occurrence can be found in this view (on or before the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_last_of() [3/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_last_of ( const CHAR_TYPE *  characterString,
size_type  position,
size_type  numChars 
) const

Return the position of the last occurrence of a character belonging to the specified characterString of the specified numChars length, if such a string can be found in this view (on or after the specified position) using CHAR_TRAITS::eq to compare characters, and return npos otherwise. The behavior is undefined unless characterString || (numChars == 0).

◆ find_last_of() [4/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP17 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::find_last_of ( const CHAR_TYPE *  characterString,
size_type  position = npos 
) const

Return the position of the last occurrence of a character belonging to the specified characterString, if such an occurrence can be found in this view (on or after the optionally specified position), and return npos otherwise.

◆ front()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_reference bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::front ( ) const
inline

Return a reference providing non-modifiable access to the character at the first position in this view. The behavior is undefined if this view is empty.

◆ length()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::length ( ) const
inline

◆ max_size()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::max_size ( ) const
inline

Return the maximal possible length of this view. Note that requests to create a view longer than this number of characters are guaranteed to raise an std::length_error exception.

◆ operator std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >()

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
template<class ALLOCATOR >
BSLS_KEYWORD_EXPLICIT bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::operator std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > ( ) const
inline

Convert this const object to a string type native to the compiler`s library, instantiated with the same character type and traits type. The return string will contain the same sequence of characters as this object and will have a default-constructed allocator.

◆ operator=() [1/3]

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
basic_string_view & bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::operator= ( const basic_string_view< CHAR_TYPE, CHAR_TRAITS > &  rhs)
default

Assign to this view the value of the specified rhs object, and return a reference providing modifiable access to this view.

◆ operator=() [2/3]

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
template<class ALLOCATOR >
BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view & bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::operator= ( const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  rhs)

Assign to this view the value of the specified rhs object, and return a reference providing modifiable access to this view.

◆ operator=() [3/3]

template<class CHAR_TYPE , class CHAR_TRAITS = char_traits<CHAR_TYPE>>
template<class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS > & bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::operator= ( const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  rhs)

◆ operator[]()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_reference bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::operator[] ( size_type  position) const
inline

Return a reference providing non-modifiable access to the character at the specified position in this view. The behavior is undefined unless position < length().

◆ rbegin()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR_CPP17 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_reverse_iterator bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::rbegin ( ) const
inline

Return a reverse iterator providing non-modifiable access to the last character of this view (or the past-the-end reverse iterator if this view is empty).

◆ remove_prefix()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR_CPP14 void bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::remove_prefix ( size_type  numChars)

Move the start of this view forward by the specified numChars. The behavior is undefined unless numChars <= length().

◆ remove_suffix()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR_CPP14 void bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::remove_suffix ( size_type  numChars)

Move the end of this view back by the specified numChars. The behavior is undefined unless numChars <= length().

◆ rend()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP17 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::const_reverse_iterator bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::rend ( ) const

◆ rfind() [1/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::rfind ( basic_string_view< CHAR_TYPE, CHAR_TRAITS >  subview,
size_type  position = npos 
) const

Return the starting position of the last occurrence of the specified subview within this view, if such a sequence can be found in this view (on or before the optionally specified position if such a position is specified) using CHAR_TRAITS::eq to compare characters, and return npos otherwise.

◆ rfind() [2/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::rfind ( CHAR_TYPE  character,
size_type  position = npos 
) const

Return the position of the last occurrence of the specified character, if such an occurrence can be found in this view (on or before the optionally specified position if such a position is specified), and return npos otherwise.

◆ rfind() [3/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::rfind ( const CHAR_TYPE *  characterString,
size_type  position,
size_type  numChars 
) const

Return the starting position of the last occurrence of the specified characterString of the specified numChars length, if such a string can be found in this view (on or after the specified position) using CHAR_TRAITS::eq to compare characters, and return npos otherwise. The behavior is undefined unless characterString || (numChars == 0).

◆ rfind() [4/4]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::rfind ( const CHAR_TYPE *  characterString,
size_type  position = npos 
) const

Return the starting position of the last occurrence of the specified null-terminated characterString, if such a string can be found in this view (on or after the optionally specified position) using CHAR_TRAITS::eq to compare characters, and return npos otherwise.

◆ size()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_KEYWORD_CONSTEXPR basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size ( ) const
inline

◆ starts_with() [1/3]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP17 bool bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::starts_with ( basic_string_view< CHAR_TYPE, CHAR_TRAITS >  subview) const

Return true if this view starts with the specified subview, and false otherwise. See {Lexicographical Comparisons}.

◆ starts_with() [2/3]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR bool bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::starts_with ( CHAR_TYPE  character) const

Return true if this view starts with the specified character, and false otherwise.

◆ starts_with() [3/3]

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP17 bool bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::starts_with ( const CHAR_TYPE *  characterString) const

Return true if this view starts with the specified characterString, and false otherwise.

◆ substr()

template<class CHAR_TYPE , class CHAR_TRAITS >
BSLS_PLATFORM_AGGRESSIVE_INLINE BSLS_KEYWORD_CONSTEXPR_CPP14 basic_string_view< CHAR_TYPE, CHAR_TRAITS > bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::substr ( size_type  position = 0,
size_type  numChars = npos 
) const

Return a view whose value is the subview starting at the optionally specified position in this view, of length the optionally specified numChars or length() - position, whichever is smaller. If position is not specified, 0 is used (i.e., the subview is from the beginning of this view). If numChars is not specified, npos is used (i.e., the entire suffix from position to the end of the view is returned). Throw std::out_of_range if position > length().

◆ swap()

template<class CHAR_TYPE , class CHAR_TRAITS >
void bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::swap ( basic_string_view< CHAR_TYPE, CHAR_TRAITS > &  other)

Exchange the value of this view with the value of the specified other object.

Member Data Documentation

◆ npos

template<class CHAR_TYPE , class CHAR_TRAITS >
const basic_string_view< CHAR_TYPE, CHAR_TRAITS >::size_type bsl::basic_string_view< CHAR_TYPE, CHAR_TRAITS >::npos = ~size_type(0)
static

Value used to denote "not-a-position", guaranteed to be outside the range [0 .. max_size()].


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