![]() |
Pixie
|
Explicit owning sink for binary data collected in memory. More...
#include <serialization.h>
Public Member Functions | |
| bool | empty () const noexcept |
| Return whether no output bytes have been written. | |
| std::size_t | size_bytes () const noexcept |
| Return the number of output bytes written. | |
| std::span< const std::byte > | bytes () const noexcept |
| Return a view of all output bytes. | |
| void | reserve_bytes (std::size_t size_bytes) |
Reserve memory for at least size_bytes output bytes. | |
| void | write (std::span< const std::byte > bytes) |
Append bytes to the output. | |
| void | write_at (std::size_t position, std::span< const std::byte > bytes) |
Replace output bytes beginning at position. | |
| void | finish () noexcept |
| Complete this in-memory output. | |
| std::vector< std::byte > | take () |
| Transfer the bytes and reset this sink to an empty state. | |
Explicit owning sink for binary data collected in memory.
This sink intentionally grows with the complete output. Prefer a fixed span or file sink when bounded additional memory is required.
|
inline |
Replace output bytes beginning at position.
| std::out_of_range | if the range is outside the existing output. |