6#ifndef PRISM_BUFFER_HPP
7#define PRISM_BUFFER_HPP
48[[nodiscard]]
inline std::string_view
50 return std::string_view(pm_buffer_value(buffer), pm_buffer_length(buffer));
unique_buffer make_buffer() noexcept
Allocate a new empty buffer.
std::unique_ptr< pm_buffer_t, buffer_deleter > unique_buffer
An owned buffer.
std::string_view view(const pm_buffer_t *buffer PRISM_LIFETIMEBOUND) noexcept
The bytes written to the given buffer so far.
#define PRISM_LIFETIMEBOUND
Mark a parameter that the return value points into, so that the compiler warns if a temporary is pass...
A wrapper around a contiguous block of allocated memory.
Frees a buffer with pm_buffer_free.
void operator()(pm_buffer_t *buffer) const noexcept
Frees the given buffer.