|
|
| nonowning_buffer (uint8_t *buffer, size_t capacity) noexcept |
|
| nonowning_buffer (uint8_t *buffer, size_t capacity, size_t size) noexcept |
|
| nonowning_buffer (nonowning_buffer const &)=default |
|
nonowning_buffer & | operator= (nonowning_buffer const &)=default |
|
| nonowning_buffer (nonowning_buffer &&) noexcept=default |
|
nonowning_buffer & | operator= (nonowning_buffer &&) noexcept=default |
| size_t | capacity () const override |
| size_t | size () const override |
|
bool | empty () const |
|
| operator bool () const |
| void | resize (size_t size) override |
| | Resizes the buffer.
|
| void | clear () override |
|
uint8_t | operator[] (size_t offset) |
| | Gets element at offset. No safety check.
|
| void | consume (size_t bytes) override |
| | Removes consumed bytes from the beginning of the buffer.
|
|
void | reset () |
|
void | append (uint8_t const *data, size_t len) override |
|
void | append (uint8_t c) |
|
void | append (std::string_view const &str) |
|
std::string_view | to_view () const |
get() exposes active bytes. get(n) prepares tail space without changing size; commit the written bytes with add(n). Requests exceeding capacity abort.
|
| uint8_t const * | get () const override |
| uint8_t * | get () override |
| uint8_t * | get (size_t bytes) override |
| void | add (size_t bytes) override |
|
virtual void | append (unsigned char const *data, size_t len)=0 |
Read and modify buffered bytes in caller-owned storage.
The supplied memory range must remain valid for the buffer's lifetime. Capacity is fixed; requests exceeding it abort. Copies and moves are shallow. Destruction leaves the supplied storage allocated and unchanged.