E-MailRelay

Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
G::basic_string_view< Tchar > Class Template Reference

A class template like c++17's std::basic_string_view. More...

`#include <gstringview.h>`

## Public Types
using | traits = std::char_traits< Tchar >
using | iterator = const Tchar *
using | const_iterator = const Tchar *
using | size_type = std::size_t
using | difference_type = std::ptrdiff_t
using | value_type = Tchar

## Public Member Functions
constexpr | basic_string_view (const Tchar *p, std::size_t n) noexcept
| basic_string_view (const Tchar *p) noexcept
constexpr | basic_string_view (const Tchar *p, std::nullptr_t) noexcept
constexpr std::size_t | size () const noexcept
constexpr std::size_t | length () const noexcept
constexpr const Tchar * | data () const noexcept
constexpr bool | empty () const noexcept
void | swap (basic_string_view< Tchar > &other) noexcept
constexpr const Tchar & | operator[] (std::size_t i) const
const Tchar & | at (std::size_t i) const
const Tchar * | begin () const noexcept
const Tchar * | cbegin () const noexcept
const Tchar * | end () const noexcept
const Tchar * | cend () const noexcept
bool | operator== (const basic_string_view< Tchar > &other) const noexcept
bool | operator!= (const basic_string_view< Tchar > &other) const noexcept
bool | operator< (const basic_string_view< Tchar > &other) const noexcept
bool | operator<= (const basic_string_view< Tchar > &other) const noexcept
bool | operator> (const basic_string_view< Tchar > &other) const noexcept
bool | operator>= (const basic_string_view< Tchar > &other) const noexcept
int | compare (const basic_string_view< Tchar > &other) const noexcept
string_view | substr (std::size_t pos, std::size_t count=npos) const
std::size_t | find (Tchar c) const noexcept
std::size_t | find (const Tchar *substr_p, std::size_t pos, std::size_t substr_n) const
std::size_t | find (basic_string_view< Tchar > substr, std::size_t pos=0U) const
std::size_t | find_first_of (const Tchar *chars, std::size_t pos, std::size_t chars_size) const noexcept
std::size_t | find_first_of (basic_string_view< Tchar > chars, std::size_t pos=0U) const noexcept
std::size_t | find_first_not_of (const Tchar *chars, std::size_t pos, std::size_t chars_size) const noexcept
std::size_t | find_first_not_of (basic_string_view< Tchar > chars, std::size_t pos=0U) const noexcept
std::basic_string< Tchar > | sv_to_string_imp () const

## Static Public Member Functions
static constexpr bool | same (basic_string_view a, basic_string_view b) noexcept

## Static Public Attributes
static constexpr std::size_t | npos = std::size_t(-1)

## Detailed Description

template<typename Tchar>
class G::basic_string_view< Tchar >

A class template like c++17's std::basic_string_view.

Compared to std::basic_string_view there is an extra free function for conversion to std::basic_string (G::sv_to_string()) and an extra constructor overload for constinit initialisation:

static constinit G::string_view sv( "foo" , nullptr ) ;
G::basic_string_view
A class template like c++17's std::basic_string_view.
Definition: gstringview.h:73

Definition at line 72 of file gstringview.h.

## Member Typedef Documentation

## ◆ const_iterator

template<typename Tchar >

using G::basic_string_view< Tchar >::const_iterator = const Tchar *

Definition at line 77 of file gstringview.h.

## ◆ difference_type

template<typename Tchar >

using G::basic_string_view< Tchar >::difference_type = std::ptrdiff_t

Definition at line 79 of file gstringview.h.

## ◆ iterator

template<typename Tchar >

using G::basic_string_view< Tchar >::iterator = const Tchar *

Definition at line 76 of file gstringview.h.

## ◆ size_type

template<typename Tchar >

using G::basic_string_view< Tchar >::size_type = std::size_t

Definition at line 78 of file gstringview.h.

## ◆ traits

template<typename Tchar >

using G::basic_string_view< Tchar >::traits = std::char_traits<Tchar>

Definition at line 75 of file gstringview.h.

## ◆ value_type

template<typename Tchar >

using G::basic_string_view< Tchar >::value_type = Tchar

Definition at line 80 of file gstringview.h.

## Constructor & Destructor Documentation

## ◆ basic_string_view() [1/3]

template<typename Tchar >

constexpr G::basic_string_view< Tchar >::basic_string_view | ( | const Tchar * | p,
|  | std::size_t | n
| ) |  |
| inline constexpr noexcept

Definition at line 83 of file gstringview.h.

## ◆ basic_string_view() [2/3]

template<typename Tchar >

G::basic_string_view< Tchar >::basic_string_view | ( | const Tchar * | p | ) |
| inline noexcept

Definition at line 88 of file gstringview.h.

## ◆ basic_string_view() [3/3]

template<typename Tchar >

constexpr G::basic_string_view< Tchar >::basic_string_view | ( | const Tchar * | p,
|  | std::nullptr_t |
| ) |  |
| inline constexpr noexcept

Definition at line 93 of file gstringview.h.

## Member Function Documentation

## ◆ at()

template<typename Tchar >

const Tchar & G::basic_string_view< Tchar >::at | ( | std::size_t | i | ) | const
| inline

Definition at line 108 of file gstringview.h.

## ◆ begin()

template<typename Tchar >

const Tchar * G::basic_string_view< Tchar >::begin | ( |  | ) | const
| inline noexcept

Definition at line 109 of file gstringview.h.

## ◆ cbegin()

template<typename Tchar >

const Tchar * G::basic_string_view< Tchar >::cbegin | ( |  | ) | const
| inline noexcept

Definition at line 110 of file gstringview.h.

## ◆ cend()

template<typename Tchar >

const Tchar * G::basic_string_view< Tchar >::cend | ( |  | ) | const
| inline noexcept

Definition at line 112 of file gstringview.h.

## ◆ compare()

template<typename Tchar >

int G::basic_string_view< Tchar >::compare | ( | const basic_string_view< Tchar > & | other | ) | const
| inline noexcept

Definition at line 119 of file gstringview.h.

## ◆ data()

template<typename Tchar >

constexpr const Tchar * G::basic_string_view< Tchar >::data | ( |  | ) | const
| inline constexpr noexcept

Definition at line 104 of file gstringview.h.

## ◆ empty()

template<typename Tchar >

constexpr bool G::basic_string_view< Tchar >::empty | ( |  | ) | const
| inline constexpr noexcept

Definition at line 105 of file gstringview.h.

## ◆ end()

template<typename Tchar >

const Tchar * G::basic_string_view< Tchar >::end | ( |  | ) | const
| inline noexcept

Definition at line 111 of file gstringview.h.

## ◆ find() [1/3]

template<typename Tchar >

std::size_t G::basic_string_view< Tchar >::find | ( | basic_string_view< Tchar > | substr,
|  | std::size_t | pos = `0U`
| ) |  | const
| inline

Definition at line 145 of file gstringview.h.

## ◆ find() [2/3]

template<typename Tchar >

std::size_t G::basic_string_view< Tchar >::find | ( | const Tchar * | substr_p,
|  | std::size_t | pos,
|  | std::size_t | substr_n
| ) |  | const
| inline

Definition at line 141 of file gstringview.h.

## ◆ find() [3/3]

template<typename Tchar >

std::size_t G::basic_string_view< Tchar >::find | ( | Tchar | c | ) | const
| inline noexcept

Definition at line 129 of file gstringview.h.

## ◆ find_first_not_of() [1/2]

template<typename Tchar >

std::size_t G::basic_string_view< Tchar >::find_first_not_of | ( | basic_string_view< Tchar > | chars,
|  | std::size_t | pos = `0U`
| ) |  | const
| inline noexcept

Definition at line 177 of file gstringview.h.

## ◆ find_first_not_of() [2/2]

template<typename Tchar >

std::size_t G::basic_string_view< Tchar >::find_first_not_of | ( | const Tchar * | chars,
|  | std::size_t | pos,
|  | std::size_t | chars_size
| ) |  | const
| inline noexcept

Definition at line 173 of file gstringview.h.

## ◆ find_first_of() [1/2]

template<typename Tchar >

std::size_t G::basic_string_view< Tchar >::find_first_of | ( | basic_string_view< Tchar > | chars,
|  | std::size_t | pos = `0U`
| ) |  | const
| inline noexcept

Definition at line 157 of file gstringview.h.

## ◆ find_first_of() [2/2]

template<typename Tchar >

std::size_t G::basic_string_view< Tchar >::find_first_of | ( | const Tchar * | chars,
|  | std::size_t | pos,
|  | std::size_t | chars_size
| ) |  | const
| inline noexcept

Definition at line 153 of file gstringview.h.

## ◆ length()

template<typename Tchar >

constexpr std::size_t G::basic_string_view< Tchar >::length | ( |  | ) | const
| inline constexpr noexcept

Definition at line 103 of file gstringview.h.

## ◆ operator!=()

template<typename Tchar >

bool G::basic_string_view< Tchar >::operator!= | ( | const basic_string_view< Tchar > & | other | ) | const
| inline noexcept

Definition at line 114 of file gstringview.h.

## ◆ operator<()

template<typename Tchar >

bool G::basic_string_view< Tchar >::operator< | ( | const basic_string_view< Tchar > & | other | ) | const
| inline noexcept

Definition at line 115 of file gstringview.h.

## ◆ operator<=()

template<typename Tchar >

bool G::basic_string_view< Tchar >::operator<= | ( | const basic_string_view< Tchar > & | other | ) | const
| inline noexcept

Definition at line 116 of file gstringview.h.

## ◆ operator==()

template<typename Tchar >

bool G::basic_string_view< Tchar >::operator== | ( | const basic_string_view< Tchar > & | other | ) | const
| inline noexcept

Definition at line 113 of file gstringview.h.

## ◆ operator>()

template<typename Tchar >

bool G::basic_string_view< Tchar >::operator> | ( | const basic_string_view< Tchar > & | other | ) | const
| inline noexcept

Definition at line 117 of file gstringview.h.

## ◆ operator>=()

template<typename Tchar >

bool G::basic_string_view< Tchar >::operator>= | ( | const basic_string_view< Tchar > & | other | ) | const
| inline noexcept

Definition at line 118 of file gstringview.h.

## ◆ operator[]()

template<typename Tchar >

constexpr const Tchar & G::basic_string_view< Tchar >::operator[] | ( | std::size_t | i | ) | const
| inline constexpr

Definition at line 107 of file gstringview.h.

## ◆ same()

template<typename Tchar >

static constexpr bool G::basic_string_view< Tchar >::same | ( | basic_string_view< Tchar > | a,
|  | basic_string_view< Tchar > | b
| ) |  |
| inline static constexpr noexcept

Definition at line 98 of file gstringview.h.

## ◆ size()

template<typename Tchar >

constexpr std::size_t G::basic_string_view< Tchar >::size | ( |  | ) | const
| inline constexpr noexcept

Definition at line 102 of file gstringview.h.

## ◆ substr()

template<typename Tchar >

string_view G::basic_string_view< Tchar >::substr | ( | std::size_t | pos,
|  | std::size_t | count = `npos`
| ) |  | const
| inline

Definition at line 124 of file gstringview.h.

## ◆ sv_to_string_imp()

template<typename Tchar >

std::basic_string< Tchar > G::basic_string_view< Tchar >::sv_to_string_imp | ( |  | ) | const
| inline

Definition at line 196 of file gstringview.h.

## ◆ swap()

template<typename Tchar >

void G::basic_string_view< Tchar >::swap | ( | basic_string_view< Tchar > & | other | ) |
| inline noexcept

Definition at line 106 of file gstringview.h.

## Member Data Documentation

## ◆ npos

template<typename Tchar >

constexpr std::size_t G::basic_string_view< Tchar >::npos = std::size_t(-1)
| static constexpr

Definition at line 81 of file gstringview.h.

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

- /usr/src/slapt-src-x86_64/network/emailrelay/emailrelay-2.3/src/glib/gstringview.h