E-MailRelay

Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
G::string_view Class Reference

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

`#include <gstringview.h>`

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

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

## Static Public Member Functions
static constexpr std::size_t | strlen_imp (const char *p, std::size_t n=0U) noexcept

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

## Detailed Description

A class like c++17's std::string_view.

There is an implicit conversion constructor from std::string since std::string has its convertion operator "operator sv()".

Definition at line 69 of file gstringview.h.

## Member Typedef Documentation

## ◆ const_iterator

using G::string_view::const_iterator = const char *

Definition at line 74 of file gstringview.h.

## ◆ difference_type

using G::string_view::difference_type = std::ptrdiff_t

Definition at line 76 of file gstringview.h.

## ◆ iterator

using G::string_view::iterator = const char *

Definition at line 73 of file gstringview.h.

## ◆ size_type

using G::string_view::size_type = std::size_t

Definition at line 75 of file gstringview.h.

## ◆ traits

using G::string_view::traits = std::char_traits<char>

Definition at line 72 of file gstringview.h.

## ◆ value_type

using G::string_view::value_type = char

Definition at line 77 of file gstringview.h.

## Constructor & Destructor Documentation

## ◆ string_view() [1/4]

constexpr G::string_view::string_view | ( | const char * | p,
|  | std::size_t | n
| ) |  |
| inline constexpr noexcept

Definition at line 82 of file gstringview.h.

## ◆ string_view() [2/4]

constexpr G::string_view::string_view | ( | const char * | p,
|  | std::nothrow_t |
| ) |  |
| inline constexpr noexcept

Definition at line 83 of file gstringview.h.

## ◆ string_view() [3/4]

G::string_view::string_view | ( | const char * | p | ) |
| inline noexcept

Definition at line 84 of file gstringview.h.

## ◆ string_view() [4/4]

G::string_view::string_view | ( | const std::string & | s | ) |
| inline noexcept

Definition at line 85 of file gstringview.h.

## Member Function Documentation

## ◆ at()

const char & G::string_view::at | ( | std::size_t | i | ) | const
| inline

Definition at line 92 of file gstringview.h.

## ◆ begin()

const char * G::string_view::begin | ( |  | ) | const
| inline noexcept

Definition at line 93 of file gstringview.h.

## ◆ cbegin()

const char * G::string_view::cbegin | ( |  | ) | const
| inline noexcept

Definition at line 94 of file gstringview.h.

## ◆ cend()

const char * G::string_view::cend | ( |  | ) | const
| inline noexcept

Definition at line 96 of file gstringview.h.

## ◆ compare() [1/2]

int G::string_view::compare | ( | const string_view & | other | ) | const
| inline noexcept

Definition at line 97 of file gstringview.h.

## ◆ compare() [2/2]

int G::string_view::compare | ( | std::size_t | pos,
|  | std::size_t | count,
|  | string_view | other
| ) |  | const
| inline noexcept

Definition at line 101 of file gstringview.h.

## ◆ data()

constexpr const char * G::string_view::data | ( |  | ) | const
| inline constexpr noexcept

Definition at line 88 of file gstringview.h.

## ◆ empty()

constexpr bool G::string_view::empty | ( |  | ) | const
| inline constexpr noexcept

Definition at line 89 of file gstringview.h.

## ◆ end()

const char * G::string_view::end | ( |  | ) | const
| inline noexcept

Definition at line 95 of file gstringview.h.

## ◆ find() [1/3]

std::size_t G::string_view::find | ( | char | c,
|  | std::size_t | pos = `0U`
| ) |  | const
| noexcept

Definition at line 92 of file gstringview.cpp.

## ◆ find() [2/3]

std::size_t G::string_view::find | ( | const char * | substr_p,
|  | std::size_t | pos,
|  | std::size_t | substr_n
| ) |  | const

Definition at line 105 of file gstringview.cpp.

## ◆ find() [3/3]

std::size_t G::string_view::find | ( | string_view | substr,
|  | std::size_t | pos = `0U`
| ) |  | const

Definition at line 110 of file gstringview.cpp.

## ◆ find_first_not_of() [1/3]

std::size_t G::string_view::find_first_not_of | ( | char | c,
|  | std::size_t | pos = `0U`
| ) |  | const
| noexcept

Definition at line 141 of file gstringview.cpp.

## ◆ find_first_not_of() [2/3]

std::size_t G::string_view::find_first_not_of | ( | const char * | chars,
|  | std::size_t | pos,
|  | std::size_t | chars_size
| ) |  | const
| noexcept

Definition at line 154 of file gstringview.cpp.

## ◆ find_first_not_of() [3/3]

std::size_t G::string_view::find_first_not_of | ( | string_view | chars,
|  | std::size_t | pos = `0U`
| ) |  | const
| noexcept

Definition at line 159 of file gstringview.cpp.

## ◆ find_first_of() [1/2]

std::size_t G::string_view::find_first_of | ( | const char * | chars,
|  | std::size_t | pos,
|  | std::size_t | chars_size
| ) |  | const
| noexcept

Definition at line 119 of file gstringview.cpp.

## ◆ find_first_of() [2/2]

std::size_t G::string_view::find_first_of | ( | string_view | chars,
|  | std::size_t | pos = `0U`
| ) |  | const
| noexcept

Definition at line 124 of file gstringview.cpp.

## ◆ find_last_not_of() [1/2]

std::size_t G::string_view::find_last_not_of | ( | const char * | chars,
|  | std::size_t | pos,
|  | std::size_t | chars_size
| ) |  | const
| noexcept

Definition at line 205 of file gstringview.cpp.

## ◆ find_last_not_of() [2/2]

std::size_t G::string_view::find_last_not_of | ( | string_view | chars,
|  | std::size_t | pos = `std::string::npos`
| ) |  | const
| noexcept

Definition at line 210 of file gstringview.cpp.

## ◆ find_last_of() [1/2]

std::size_t G::string_view::find_last_of | ( | const char * | chars,
|  | std::size_t | pos,
|  | std::size_t | chars_size
| ) |  | const
| noexcept

Definition at line 179 of file gstringview.cpp.

## ◆ find_last_of() [2/2]

std::size_t G::string_view::find_last_of | ( | string_view | chars,
|  | std::size_t | pos = `std::string::npos`
| ) |  | const
| noexcept

Definition at line 184 of file gstringview.cpp.

## ◆ length()

constexpr std::size_t G::string_view::length | ( |  | ) | const
| inline constexpr noexcept

Definition at line 87 of file gstringview.h.

## ◆ operator!=()

bool G::string_view::operator!= | ( | const string_view & | other | ) | const
| inline noexcept

Definition at line 103 of file gstringview.h.

## ◆ operator<()

bool G::string_view::operator< | ( | const string_view & | other | ) | const
| inline noexcept

Definition at line 104 of file gstringview.h.

## ◆ operator<=()

bool G::string_view::operator<= | ( | const string_view & | other | ) | const
| inline noexcept

Definition at line 105 of file gstringview.h.

## ◆ operator==()

bool G::string_view::operator== | ( | const string_view & | other | ) | const
| inline noexcept

Definition at line 102 of file gstringview.h.

## ◆ operator>()

bool G::string_view::operator> | ( | const string_view & | other | ) | const
| inline noexcept

Definition at line 106 of file gstringview.h.

## ◆ operator>=()

bool G::string_view::operator>= | ( | const string_view & | other | ) | const
| inline noexcept

Definition at line 107 of file gstringview.h.

## ◆ operator[]()

constexpr const char & G::string_view::operator[] | ( | std::size_t | i | ) | const
| inline constexpr noexcept

Definition at line 91 of file gstringview.h.

## ◆ rfind()

std::size_t G::string_view::rfind | ( | char | c,
|  | std::size_t | pos = `std::string::npos`
| ) |  | const
| noexcept

Definition at line 231 of file gstringview.cpp.

## ◆ size()

constexpr std::size_t G::string_view::size | ( |  | ) | const
| inline constexpr noexcept

Definition at line 86 of file gstringview.h.

## ◆ strlen_imp()

static constexpr std::size_t G::string_view::strlen_imp | ( | const char * | p,
|  | std::size_t | n = `0U`
| ) |  |
| inline static constexpr noexcept

Definition at line 81 of file gstringview.h.

## ◆ substr()

G::string_view G::string_view::substr | ( | std::size_t | pos,
|  | std::size_t | count = `npos`
| ) |  | const

Definition at line 82 of file gstringview.cpp.

## ◆ swap()

void G::string_view::swap | ( | string_view & | other | ) |
| inline noexcept

Definition at line 90 of file gstringview.h.

## Member Data Documentation

## ◆ npos

constexpr std::size_t G::string_view::npos = std::size_t(-1)
| static constexpr

Definition at line 78 of file gstringview.h.

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

- /tmp/slackdce/slackrepo.HKsbdz/build_emailrelay/emailrelay-2.6/src/glib/gstringview.h
- /tmp/slackdce/slackrepo.HKsbdz/build_emailrelay/emailrelay-2.6/src/glib/gstringview.cpp