# MutableBuffer

<a id="mutablebuffer-6"></a>

# MutableBuffer

```cpp
#include <buffer.h>

class MutableBuffer
```

Defined in src/base/include/icy/buffer.h:40

The [MutableBuffer](#mutablebuffer-6) class provides a safe representation of a buffer that can be modified. It does not own the underlying data, and so is cheap to copy or assign.

## Public Methods

| Return | Name | Description |
|--------|------|-------------|
| `constexpr` | [`MutableBuffer`](#mutablebuffer-7) `inline` `constexpr` | Construct an empty buffer. |
| `constexpr` | [`MutableBuffer`](#mutablebuffer-8) `inline` `constexpr` | Construct a buffer to represent the given memory range. |
| `void *` | [`data`](#data) `const` `inline` `nodiscard` `constexpr` |  |
| `size_t` | [`size`](#size) `const` `inline` `nodiscard` `constexpr` |  |
| `char *` | [`cstr`](#cstr) `const` `inline` `nodiscard` | Cast the buffer as a char pointer. |
| `std::string` | [`str`](#str) `const` `inline` | Returns the buffer as a string. |

---

<a id="mutablebuffer-7"></a>

### MutableBuffer

`inline` `constexpr`

```cpp
constexpr inline constexpr MutableBuffer()
```

Defined in src/base/include/icy/buffer.h:44

Construct an empty buffer.

---

<a id="mutablebuffer-8"></a>

### MutableBuffer

`inline` `constexpr`

```cpp
constexpr inline constexpr MutableBuffer(void * data, size_t size)
```

Defined in src/base/include/icy/buffer.h:51

Construct a buffer to represent the given memory range.

---

<a id="data"></a>

### data

`const` `inline` `nodiscard` `constexpr`

```cpp
[[nodiscard]] constexpr inline void * data() const
```

Defined in src/base/include/icy/buffer.h:57

---

<a id="size"></a>

### size

`const` `inline` `nodiscard` `constexpr`

```cpp
[[nodiscard]] constexpr inline size_t size() const
```

Defined in src/base/include/icy/buffer.h:58

---

<a id="cstr"></a>

### cstr

`const` `inline` `nodiscard`

```cpp
[[nodiscard]] inline char * cstr() const
```

Defined in src/base/include/icy/buffer.h:61

Cast the buffer as a char pointer.

---

<a id="str"></a>

### str

`const` `inline`

```cpp
inline std::string str() const
```

Defined in src/base/include/icy/buffer.h:64

Returns the buffer as a string.

## Protected Attributes

| Return | Name | Description |
|--------|------|-------------|
| `void *` | [`_data`](#_data)  |  |
| `size_t` | [`_size`](#_size)  |  |

---

<a id="_data"></a>

### _data

```cpp
void * _data
```

Defined in src/base/include/icy/buffer.h:67

---

<a id="_size"></a>

### _size

```cpp
size_t _size
```

Defined in src/base/include/icy/buffer.h:68
