Output sink that writes formatted characters into a fixed-size contiguous memory buffer.
More...
#include <microfmt.hpp>
|
| constexpr | span_sink (span< char > buf RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS) noexcept |
| | Constructs a span sink over a microfmt::span of character storage.
|
| |
| sink | as_sink () noexcept RELOCO_LIFETIMEBOUND |
| | Creates a type-erased sink adapter pointing to this instance.
|
| |
| constexpr microfmt::string_view | view () const noexcept RELOCO_LIFETIMEBOUND |
| | Returns a string view over the characters written so far.
|
| |
| constexpr size_t | size () const noexcept |
| | Returns the total number of characters written so far.
|
| |
| constexpr size_t | available () const noexcept |
| | Returns the remaining unwritten capacity in the buffer.
|
| |
| RELOCO_REINITIALIZES constexpr void | reset () noexcept |
| | Resets the write offset back to the beginning of the buffer.
|
| |
Output sink that writes formatted characters into a fixed-size contiguous memory buffer.
Wraps an externally provided buffer (via microfmt::span or std::span) and exposes a non-owning, zero-allocation sink interface. Writes that exceed the remaining capacity are truncated safely.
◆ span_sink()
| constexpr microfmt::span_sink::span_sink |
( |
span< char > buf RELOCO_LIFETIMEBOUND |
RELOCO_LIFETIME_CAPTURE_BY_THIS | ) |
|
|
inlineexplicitconstexprnoexcept |
Constructs a span sink over a microfmt::span of character storage.
- Parameters
-
| buf | The target character buffer view. |
◆ as_sink()
| sink microfmt::span_sink::as_sink |
( |
| ) |
|
|
inlinenoexcept |
Creates a type-erased sink adapter pointing to this instance.
- Returns
- A lightweight sink struct configured with a callback to append to this buffer.
◆ available()
| constexpr size_t microfmt::span_sink::available |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns the remaining unwritten capacity in the buffer.
- Returns
- Available space in bytes.
◆ reset()
| RELOCO_REINITIALIZES constexpr void microfmt::span_sink::reset |
( |
| ) |
|
|
inlineconstexprnoexcept |
Resets the write offset back to the beginning of the buffer.
◆ size()
| constexpr size_t microfmt::span_sink::size |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns the total number of characters written so far.
- Returns
- Current write offset in bytes.
◆ view()
| constexpr microfmt::string_view microfmt::span_sink::view |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns a string view over the characters written so far.
- Returns
- Non-owning view of the formatted output.
The documentation for this class was generated from the following file: