MPD: AllocatedString< T > Class Template Reference

MPD 0.20.15

Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes
AllocatedString< T > Class Template Reference

A string pointer whose memory is managed by this class. More...

`#include <Util.hxx>`

## Public Types
typedef StringPointer< T >::value_type | value_type
typedef StringPointer< T >::reference_type | reference_type
typedef StringPointer< T >::const_reference_type | const_reference_type
typedef StringPointer< T >::pointer_type | pointer_type
typedef StringPointer< T >::const_pointer_type | const_pointer_type
typedef size_t | size_type

## Public Member Functions
| AllocatedString (std::nullptr_t n)
| AllocatedString (AllocatedString &&src)
| ~AllocatedString ()
AllocatedString & | operator= (AllocatedString &&src)
constexpr bool | operator== (std::nullptr_t) const
constexpr bool | operator!= (std::nullptr_t) const
constexpr bool | IsNull () const
constexpr const_pointer_type | c_str () const
bool | empty () const
reference_type | operator[] (size_type i)
const reference_type | operator[] (size_type i) const
pointer_type | Steal ()
AllocatedString | Clone () const

## Static Public Member Functions
static AllocatedString | Donate (pointer_type value)
static AllocatedString | Null ()
static AllocatedString | Empty ()
static AllocatedString | Duplicate (const_pointer_type src)
static AllocatedString | Duplicate (const_pointer_type begin, const_pointer_type end)
static AllocatedString | Duplicate (const_pointer_type begin, size_type length)

## Static Public Attributes
static constexpr value_type | SENTINEL = '\0'

## Detailed Description

### template<typename T = char>
class AllocatedString< T >

A string pointer whose memory is managed by this class.

Unlike std::string, this object can hold a "nullptr" special value.

Definition at line 29 of file Util.hxx.

## Member Typedef Documentation

## ◆ const_pointer_type

template<typename T = char>

typedef StringPointer<T>::const_pointer_type AllocatedString< T >::const_pointer_type

Definition at line 50 of file AllocatedString.hxx.

## ◆ const_reference_type

template<typename T = char>

typedef StringPointer<T>::const_reference_type AllocatedString< T >::const_reference_type

Definition at line 48 of file AllocatedString.hxx.

## ◆ pointer_type

template<typename T = char>

typedef StringPointer<T>::pointer_type AllocatedString< T >::pointer_type

Definition at line 49 of file AllocatedString.hxx.

## ◆ reference_type

template<typename T = char>

typedef StringPointer<T>::reference_type AllocatedString< T >::reference_type

Definition at line 47 of file AllocatedString.hxx.

## ◆ size_type

template<typename T = char>

typedef size_t AllocatedString< T >::size_type

Definition at line 51 of file AllocatedString.hxx.

## ◆ value_type

template<typename T = char>

typedef StringPointer<T>::value_type AllocatedString< T >::value_type

Definition at line 46 of file AllocatedString.hxx.

## Constructor & Destructor Documentation

## ◆ AllocatedString() [1/2]

template<typename T = char>

AllocatedString< T >::AllocatedString | ( | std::nullptr_t | n | ) |
| inline

Definition at line 62 of file AllocatedString.hxx.

## ◆ AllocatedString() [2/2]

template<typename T = char>

AllocatedString< T >::AllocatedString | ( | AllocatedString< T > && | src | ) |
| inline

Definition at line 64 of file AllocatedString.hxx.

## ◆ ~AllocatedString()

template<typename T = char>

AllocatedString< T >::~AllocatedString | ( |  | ) |
| inline

Definition at line 67 of file AllocatedString.hxx.

## Member Function Documentation

## ◆ c_str()

template<typename T = char>

constexpr const_pointer_type AllocatedString< T >::c_str | ( |  | ) | const
| inline

Definition at line 118 of file AllocatedString.hxx.

## ◆ Clone()

template<typename T = char>

AllocatedString AllocatedString< T >::Clone | ( |  | ) | const
| inline

Definition at line 140 of file AllocatedString.hxx.

## ◆ Donate()

template<typename T = char>

static AllocatedString AllocatedString< T >::Donate | ( | pointer_type | value | ) |
| inlinestatic

Definition at line 71 of file AllocatedString.hxx.

## ◆ Duplicate() [1/3]

template<typename T = char>

static AllocatedString AllocatedString< T >::Duplicate | ( | const_pointer_type | src | ) |
| static

## ◆ Duplicate() [2/3]

template<typename T = char>

static AllocatedString AllocatedString< T >::Duplicate | ( | const_pointer_type | begin,
|  | const_pointer_type | end
| ) |  |
| inlinestatic

Definition at line 87 of file AllocatedString.hxx.

## ◆ Duplicate() [3/3]

template<typename T = char>

static AllocatedString AllocatedString< T >::Duplicate | ( | const_pointer_type | begin,
|  | size_type | length
| ) |  |
| inlinestatic

Definition at line 94 of file AllocatedString.hxx.

## ◆ Empty()

template<typename T = char>

static AllocatedString AllocatedString< T >::Empty | ( |  | ) |
| inlinestatic

Definition at line 79 of file AllocatedString.hxx.

## ◆ empty()

template<typename T = char>

bool AllocatedString< T >::empty | ( |  | ) | const
| inline

Definition at line 122 of file AllocatedString.hxx.

## ◆ IsNull()

template<typename T = char>

constexpr bool AllocatedString< T >::IsNull | ( |  | ) | const
| inline

Definition at line 114 of file AllocatedString.hxx.

## ◆ Null()

template<typename T = char>

static AllocatedString AllocatedString< T >::Null | ( |  | ) |
| inlinestatic

Definition at line 75 of file AllocatedString.hxx.

## ◆ operator!=()

template<typename T = char>

constexpr bool AllocatedString< T >::operator!= | ( | std::nullptr_t |  | ) | const
| inline

Definition at line 110 of file AllocatedString.hxx.

## ◆ operator=()

template<typename T = char>

AllocatedString& AllocatedString< T >::operator= | ( | AllocatedString< T > && | src | ) |
| inline

Definition at line 101 of file AllocatedString.hxx.

## ◆ operator==()

template<typename T = char>

constexpr bool AllocatedString< T >::operator== | ( | std::nullptr_t |  | ) | const
| inline

Definition at line 106 of file AllocatedString.hxx.

## ◆ operator[]() [1/2]

template<typename T = char>

reference_type AllocatedString< T >::operator[] | ( | size_type | i | ) |
| inline

Definition at line 126 of file AllocatedString.hxx.

## ◆ operator[]() [2/2]

template<typename T = char>

const reference_type AllocatedString< T >::operator[] | ( | size_type | i | ) | const
| inline

Definition at line 130 of file AllocatedString.hxx.

## ◆ Steal()

template<typename T = char>

pointer_type AllocatedString< T >::Steal | ( |  | ) |
| inline

Definition at line 134 of file AllocatedString.hxx.

## Field Documentation

## ◆ SENTINEL

template<typename T = char>

constexpr value_type AllocatedString< T >::SENTINEL = '\0'
| static

Definition at line 53 of file AllocatedString.hxx.

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

- lib/icu/Util.hxx
- util/AllocatedString.hxx