MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Static Public Member Functions
StringView Struct Reference

`#include <StringView.hxx>`

Inheritance diagram for StringView:
[legend]
Collaboration diagram for StringView:
[legend]

## Public Member Functions
| StringView ()=default
constexpr | StringView (pointer_type _data, size_type _size)
constexpr | StringView (pointer_type _begin, pointer_type _end)
| StringView (pointer_type _data)
constexpr | StringView (std::nullptr_t n)
void | SetEmpty ()
gcc_pure pointer_type | Find (char ch) const
StringView & | operator= (std::nullptr_t)
StringView & | operator= (pointer_type _data)
gcc_pure bool | StartsWith (StringView needle) const
gcc_pure bool | Equals (StringView other) const
template<size_t n>
bool | EqualsLiteral (const char(&other)[n]) const
gcc_pure bool | EqualsIgnoreCase (StringView other) const
template<size_t n>
bool | EqualsLiteralIgnoreCase (const char(&other)[n]) const
void | StripLeft ()
| Skip all whitespace at the beginning. More...
void | StripRight ()
| Skip all whitespace at the end. More...
void | Strip ()
Public Member Functions inherited from ConstBuffer< char >
| ConstBuffer ()=default
constexpr | ConstBuffer (std::nullptr_t)
constexpr | ConstBuffer (pointer_type _data, size_type _size)
constexpr ConstBuffer< void > | ToVoid () const
constexpr bool | IsNull () const
constexpr bool | IsEmpty () const
gcc_pure bool | Contains (U &&u) const
constexpr iterator | begin () const
constexpr iterator | end () const
constexpr const_iterator | cbegin () const
constexpr const_iterator | cend () const
reference_type | operator[] (size_type i) const
reference_type | front () const
| Returns a reference to the first element. More...
reference_type | back () const
| Returns a reference to the last element. More...
void | pop_front ()
| Remove the first element (by moving the head pointer, does not actually modify the buffer). More...
void | pop_back ()
| Remove the last element (by moving the tail pointer, does not actually modify the buffer). More...
reference_type | shift ()
| Remove the first element and return a reference to it. More...
void | skip_front (size_type n)
void | MoveFront (pointer_type new_data)
| Move the front pointer to the given address, and adjust the size attribute to retain the old end address. More...

## Static Public Member Functions
static constexpr StringView | Empty ()
template<size_t n>
static constexpr StringView | Literal (const char(&_data)[n])
static constexpr StringView | Literal ()
Static Public Member Functions inherited from ConstBuffer< char >
static constexpr ConstBuffer | Null ()
static ConstBuffer< char > | FromVoid (ConstBuffer< void > other)
| Cast a ConstBuffer<void> to a ConstBuffer<T>. More...

## Additional Inherited Members
Public Types inherited from ConstBuffer< char >
typedef size_t | size_type
typedef const char & | reference_type
typedef reference_type | const_reference_type
typedef const char * | pointer_type
typedef pointer_type | const_pointer_type
typedef pointer_type | iterator
typedef pointer_type | const_iterator
Data Fields inherited from ConstBuffer< char >
pointer_type | data
size_type | size

## Detailed Description

Definition at line 37 of file StringView.hxx.

## Constructor & Destructor Documentation

StringView::StringView | ( |  | ) |
| default

constexpr StringView::StringView | ( | pointer_type | _data,
|  | size_type | _size
| ) |  |
| inline

Definition at line 40 of file StringView.hxx.

constexpr StringView::StringView | ( | pointer_type | _begin,
|  | pointer_type | _end
| ) |  |
| inline

Definition at line 43 of file StringView.hxx.

StringView::StringView | ( | pointer_type | _data | ) |
| inline

Definition at line 46 of file StringView.hxx.

constexpr StringView::StringView | ( | std::nullptr_t | n | ) |
| inline

Definition at line 50 of file StringView.hxx.

## Member Function Documentation

static constexpr StringView StringView::Empty | ( |  | ) |
| inline static

Definition at line 53 of file StringView.hxx.

gcc_pure bool StringView::Equals | ( | StringView | other | ) | const
| inline

Definition at line 96 of file StringView.hxx.

gcc_pure bool StringView::EqualsIgnoreCase | ( | StringView | other | ) | const
| inline

Definition at line 107 of file StringView.hxx.

template<size_t n>

bool StringView::EqualsLiteral | ( | const char(&) | other[n] | ) | const
| inline

Definition at line 102 of file StringView.hxx.

template<size_t n>

bool StringView::EqualsLiteralIgnoreCase | ( | const char(&) | other[n] | ) | const
| inline

Definition at line 113 of file StringView.hxx.

gcc_pure pointer_type StringView::Find | ( | char | ch | ) | const
| inline

Definition at line 73 of file StringView.hxx.

template<size_t n>

static constexpr StringView StringView::Literal | ( | const char(&) | _data[n] | ) |
| inline static

Definition at line 58 of file StringView.hxx.

static constexpr StringView StringView::Literal | ( |  | ) |
| inline static

Definition at line 63 of file StringView.hxx.

StringView& StringView::operator= | ( | std::nullptr_t |  | ) |
| inline

Definition at line 77 of file StringView.hxx.

StringView& StringView::operator= | ( | pointer_type | _data | ) |
| inline

Definition at line 83 of file StringView.hxx.

void StringView::SetEmpty | ( |  | ) |
| inline

Definition at line 67 of file StringView.hxx.

gcc_pure bool StringView::StartsWith | ( | StringView | needle | ) | const
| inline

Definition at line 90 of file StringView.hxx.

void StringView::Strip | ( |  | ) |
| inline

Definition at line 127 of file StringView.hxx.

void StringView::StripLeft | ( |  | ) |

Skip all whitespace at the beginning.

void StringView::StripRight | ( |  | ) |

Skip all whitespace at the end.

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

- util/StringView.hxx