Base module
ConstBuffer
The ConstBuffer class provides a safe representation of a buffer that cannot be modified. It does not own the underlying data, and so is cheap to copy or assign.
ConstBuffer
#include <icy/buffer.h>The ConstBuffer class provides a safe representation of a buffer that cannot be modified. It does not own the underlying data, and so is cheap to copy or assign.
Public Methods
| Return | Name | Description |
|---|---|---|
constexpr | ConstBuffer inline | Construct an empty buffer. |
constexpr | ConstBuffer inline | Construct a buffer to represent the given memory range. |
constexpr | ConstBuffer inline | Construct a non-modifiable buffer from a modifiable one. |
constexpr const void * | data const inline | |
constexpr size_t | size const inline | |
const char * | cstr const inline | Cast the buffer as a const char pointer. |
std::string | str const inline | Returns the buffer as a string. |
ConstBuffer
inline
inline constexpr ConstBuffer()Construct an empty buffer.
ConstBuffer
inline
inline constexpr ConstBuffer(const void * data, size_t size)Construct a buffer to represent the given memory range.
ConstBuffer
inline
inline constexpr ConstBuffer(const MutableBuffer & b)Construct a non-modifiable buffer from a modifiable one.
data
const inline
inline constexpr const void * data() constsize
const inline
inline constexpr size_t size() constcstr
const inline
inline const char * cstr() constCast the buffer as a const char pointer.
str
const inline
inline std::string str() constReturns the buffer as a string.
Protected Attributes
_data
const void * _data_size
size_t _size