DAW string_view
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
daw::sv2 Namespace Reference

Namespaces

namespace  string_view_literals
 

Classes

struct  any_of_t
 A predicate type used in the find based routine to return true when the element is one of the specified characters. More...
 
struct  basic_string_view
 The class template basic_string_view describes an object that can refer to a constant contiguous sequence of char-like objects with the first element of the sequence at position zero. More...
 
struct  nodiscard_t
 Tag type for specifying that the searched for term/item is not to be removed from string_view. More...
 
struct  none_of_t
 A predicate type used in the find based routine to return true when the element is none of the specified characters. More...
 

Typedefs

using string_view = basic_string_view< char >
 
using u16string_view = basic_string_view< char16_t >
 
using u32string_view = basic_string_view< char32_t >
 
using wstring_view = basic_string_view< wchar_t >
 

Enumerations

enum class  string_view_bounds_type { pointer , size }
 How is the end of range stored in string_view. More...
 

Functions

template<typename CharT , std::size_t N>
 basic_string_view (CharT const (&)[N]) -> basic_string_view< CharT, default_string_view_bounds_type >
 
template<typename CharT >
 basic_string_view (CharT const *s, std::size_t count) -> basic_string_view< CharT >
 

Variables

template<auto needle, auto... needles>
static constexpr any_of_t< decltype(needle), needle, needles... > any_of { }
 
constexpr string_view_bounds_type default_string_view_bounds_type
 
constexpr nodiscard_t nodiscard = nodiscard_t{ }
 
template<auto needle, auto... needles>
static constexpr none_of_t< decltype(needle), needle, needles... > none_of { }
 

Typedef Documentation

◆ string_view

◆ u16string_view

using daw::sv2::u16string_view = typedef basic_string_view<char16_t>

◆ u32string_view

using daw::sv2::u32string_view = typedef basic_string_view<char32_t>

◆ wstring_view

using daw::sv2::wstring_view = typedef basic_string_view<wchar_t>

Enumeration Type Documentation

◆ string_view_bounds_type

How is the end of range stored in string_view.

Enumerator
pointer 

Store the end of range as a pointer. This is optimal for code where calls to methods like remove_prefix dominate.

size 

Store the end of range as a size_type. This is optimal for where calls to size( ) or remove_suffix like calls dominate.

Function Documentation

◆ basic_string_view() [1/2]

template<typename CharT , std::size_t N>
daw::sv2::basic_string_view ( CharT   const(&)[N]) -> basic_string_view< CharT, default_string_view_bounds_type >

◆ basic_string_view() [2/2]

template<typename CharT >
daw::sv2::basic_string_view ( CharT const *  s,
std::size_t  count 
) -> basic_string_view< CharT >

Variable Documentation

◆ any_of

template<auto needle, auto... needles>
constexpr any_of_t<decltype( needle ), needle, needles...> daw::sv2::any_of { }
inlinestaticconstexpr

◆ default_string_view_bounds_type

constexpr string_view_bounds_type daw::sv2::default_string_view_bounds_type
inlineconstexpr
Initial value:
=
string_view_bounds_type::pointer

◆ nodiscard

constexpr nodiscard_t daw::sv2::nodiscard = nodiscard_t{ }
inlineconstexpr

◆ none_of

template<auto needle, auto... needles>
constexpr none_of_t<decltype( needle ), needle, needles...> daw::sv2::none_of { }
inlinestaticconstexpr