icy

MutableBuffer

The MutableBuffer class provides a safe representation of a buffer that can be modified.

#include <buffer.h>

class MutableBuffer

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

The MutableBuffer 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

ReturnNameDescription
constexprMutableBuffer inline constexprConstruct an empty buffer.
constexprMutableBuffer inline constexprConstruct a buffer to represent the given memory range.
void *data const inline nodiscard constexpr
size_tsize const inline nodiscard constexpr
char *cstr const inline nodiscardCast the buffer as a char pointer.
std::stringstr const inlineReturns the buffer as a string.

MutableBuffer

inline constexpr

constexpr inline constexpr MutableBuffer()

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

Construct an empty buffer.


MutableBuffer

inline constexpr

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.


data

const inline nodiscard constexpr

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

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


size

const inline nodiscard constexpr

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

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


cstr

const inline nodiscard

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

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

Cast the buffer as a char pointer.


str

const inline

inline std::string str() const

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

Returns the buffer as a string.

Protected Attributes

ReturnNameDescription
void *_data
size_t_size

_data

void * _data

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


_size

size_t _size

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