Open 3D Engine AzCore API Reference  22.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
AZStd::basic_string_view< Element, Traits > Class Template Reference

#include <string_view.h>

Public Types

using traits_type = Traits
 
using value_type = Element
 
using pointer = value_type *
 
using const_pointer = const value_type *
 
using reference = value_type &
 
using const_reference = const value_type &
 
using size_type = size_t
 
using difference_type = ptrdiff_t
 
using iterator = const value_type *
 
using const_iterator = const value_type *
 
using reverse_iterator = AZStd::reverse_iterator< iterator >
 
using const_reverse_iterator = AZStd::reverse_iterator< const_iterator >
 

Public Member Functions

constexpr basic_string_view (const_pointer s)
 
constexpr basic_string_view (const_pointer s, size_type count)
 
template<typename It , typename End , typename = AZStd::enable_if_t< contiguous_iterator<It> && sized_sentinel_for<End, It> && is_same_v<iter_value_t<It>, value_type> && !is_convertible_v<End, size_type>>>
constexpr basic_string_view (It first, End last)
 
template<typename R , typename = enable_if_t<conjunction_v< bool_constant<!same_as<remove_cvref_t<R>, basic_string_view>>, bool_constant<!convertible_to<R, const_pointer>> >>, typename = enable_if_t<conjunction_v< bool_constant<ranges::contiguous_range<R>>, bool_constant<ranges::sized_range<R>>, bool_constant<same_as<ranges::range_value_t<R>, value_type>>, bool_constant<!Internal::convertible_to_string_view<Element, Traits, R>>, bool_constant<Internal::range_trait_type_matches<Element, Traits, R>> >>>
constexpr basic_string_view (R &&r)
 
constexpr basic_string_view (const basic_string_view &) noexcept=default
 
constexpr basic_string_view (basic_string_view &&other)
 
constexpr basic_string_view (AZStd::nullptr_t)=delete
 
constexpr const_reference operator[] (size_type index) const
 
constexpr value_type at (size_type index) const
 Returns value, not reference. If index is out of bounds, 0 is returned (can't be reference).
 
constexpr const_reference front () const
 
constexpr const_reference back () const
 
constexpr const_pointer data () const
 
constexpr size_type length () const
 
constexpr size_type size () const
 
constexpr size_type max_size () const
 
constexpr bool empty () const
 
constexpr void remove_prefix (size_type n)
 
constexpr void remove_suffix (size_type n)
 
constexpr basic_string_viewoperator= (const basic_string_view &s) noexcept=default
 
constexpr void swap (basic_string_view &s) noexcept
 
constexpr iterator begin () const noexcept
 
constexpr iterator end () const noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr const_iterator cend () const noexcept
 
constexpr reverse_iterator rbegin () const noexcept
 
constexpr reverse_iterator rend () const noexcept
 
constexpr const_reverse_iterator crbegin () const noexcept
 
constexpr const_reverse_iterator crend () const noexcept
 
constexpr size_type copy (pointer dest, size_type count, size_type pos=0) const
 
constexpr basic_string_view substr (size_type pos=0, size_type count=npos) const
 
constexpr int compare (basic_string_view other) const
 
constexpr int compare (size_type pos1, size_type count1, basic_string_view other) const
 
constexpr int compare (size_type pos1, size_type count1, basic_string_view sv, size_type pos2, size_type count2) const
 
constexpr int compare (const_pointer s) const
 
constexpr int compare (size_type pos1, size_type count1, const_pointer s) const
 
constexpr int compare (size_type pos1, size_type count1, const_pointer s, size_type count2) const
 
constexpr bool starts_with (basic_string_view prefix) const
 
constexpr bool starts_with (value_type prefix) const
 
constexpr bool starts_with (const_pointer prefix) const
 
constexpr bool ends_with (basic_string_view suffix) const
 
constexpr bool ends_with (value_type suffix) const
 
constexpr bool ends_with (const_pointer suffix) const
 
constexpr bool contains (basic_string_view other) const
 
constexpr bool contains (value_type c) const
 
constexpr bool contains (const_pointer s) const
 
constexpr size_type find (basic_string_view other, size_type pos=0) const
 
constexpr size_type find (value_type c, size_type pos=0) const
 
constexpr size_type find (const_pointer s, size_type pos, size_type count) const
 
constexpr size_type find (const_pointer s, size_type pos=0) const
 
constexpr size_type rfind (basic_string_view s, size_type pos=npos) const
 
constexpr size_type rfind (value_type c, size_type pos=npos) const
 
constexpr size_type rfind (const_pointer s, size_type pos, size_type count) const
 
constexpr size_type rfind (const_pointer s, size_type pos=npos) const
 
constexpr size_type find_first_of (basic_string_view s, size_type pos=0) const
 
constexpr size_type find_first_of (value_type c, size_type pos=0) const
 
constexpr size_type find_first_of (const_pointer s, size_type pos, size_type count) const
 
constexpr size_type find_first_of (const_pointer s, size_type pos=0) const
 
constexpr size_type find_last_of (basic_string_view s, size_type pos=npos) const
 
constexpr size_type find_last_of (value_type c, size_type pos=npos) const
 
constexpr size_type find_last_of (const_pointer s, size_type pos, size_type count) const
 
constexpr size_type find_last_of (const_pointer s, size_type pos=npos) const
 
constexpr size_type find_first_not_of (basic_string_view s, size_type pos=0) const
 
constexpr size_type find_first_not_of (value_type c, size_type pos=0) const
 
constexpr size_type find_first_not_of (const_pointer s, size_type pos, size_type count) const
 
constexpr size_type find_first_not_of (const_pointer s, size_type pos=0) const
 
constexpr size_type find_last_not_of (basic_string_view s, size_type pos=npos) const
 
constexpr size_type find_last_not_of (value_type c, size_type pos=npos) const
 
constexpr size_type find_last_not_of (const_pointer s, size_type pos, size_type count) const
 
constexpr size_type find_last_not_of (const_pointer s, size_type pos=npos) const
 

Static Public Attributes

static constexpr size_type npos = size_type(-1)
 

Friends

constexpr bool operator== (basic_string_view s1, basic_string_view s2) noexcept
 
constexpr friend bool operator!= (basic_string_view s1, basic_string_view s2) noexcept
 
constexpr friend bool operator< (basic_string_view lhs, basic_string_view rhs) noexcept
 
constexpr friend bool operator> (basic_string_view lhs, basic_string_view rhs) noexcept
 
constexpr friend bool operator<= (basic_string_view lhs, basic_string_view rhs) noexcept
 
constexpr friend bool operator>= (basic_string_view lhs, basic_string_view rhs) noexcept
 

Detailed Description

template<class Element, class Traits = AZStd::char_traits<Element>>
class AZStd::basic_string_view< Element, Traits >

Immutable string wrapper based on std::string_view. When we operate on const char* we don't know if this points to NULL terminated string or just a char array. to have a clear distinction between them we provide this wrapper.


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