|
microfmt
Zero-allocation C++ formatting for constrained environments
|
Output sink that writes formatted characters into a FreeBSD-style sbuf. More...
#include <sbuf_sink.hpp>
Public Member Functions | |
| constexpr | sbuf_sink (SBufT *sb RELOCO_LIFETIMEBOUND RELOCO_LIFETIME_CAPTURE_BY_THIS) noexcept |
| Constructs an sbuf sink over an existing buffer pointer. | |
| sink | as_sink () const noexcept RELOCO_LIFETIMEBOUND |
| Creates a type-erased sink adapter pointing to this instance. | |
| constexpr SBufT * | native_handle () const noexcept |
| Returns the underlying sbuf pointer. | |
Output sink that writes formatted characters into a FreeBSD-style sbuf.
Wraps an externally provided sbuf-like pointer and exposes a non-owning, zero-allocation sink interface. Writes are appended safely using the environment's sbuf_bcat function.
By being templated on the buffer type, this class introduces zero hard dependencies on <sys/sbuf.h> unless instantiated.
| SBufT | The opaque buffer struct (typically struct sbuf). |
|
inlineexplicitconstexprnoexcept |
Constructs an sbuf sink over an existing buffer pointer.
| sb | The target sbuf pointer. |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
Returns the underlying sbuf pointer.