Non-owning fixed-capacity output sink.
More...
#include <serialization.h>
|
|
| SpanOutputSink (std::span< std::byte > storage) |
| | Construct an empty output over caller-owned storage.
|
| |
|
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::size_t | capacity_bytes () const noexcept |
| | Return the fixed output capacity in bytes.
|
| |
|
std::span< const std::byte > | bytes () const noexcept |
| | Return the prefix written so far.
|
| |
| 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 fixed-span output.
|
| |
Non-owning fixed-capacity output sink.
The caller keeps the writable span alive and stable until the associated writer is finished.
◆ write()
| void pixie::SpanOutputSink::write |
( |
std::span< const std::byte > | bytes | ) |
|
|
inline |
Append bytes to the output.
- Exceptions
-
| std::length_error | if the fixed output capacity is insufficient. |
◆ write_at()
| void pixie::SpanOutputSink::write_at |
( |
std::size_t | position, |
|
|
std::span< const std::byte > | bytes ) |
|
inline |
Replace output bytes beginning at position.
- Exceptions
-
| std::out_of_range | if the range is outside the written prefix. |
The documentation for this class was generated from the following file: