Output sink that guarantees a null-terminated string within a fixed-size buffer.
More...
|
| constexpr | c_string_sink () noexcept |
| | Constructs an empty, null-terminated string sink.
|
| |
| | ~c_string_sink ()=default |
| |
| RELOCO_BEGIN_UNSAFE_BUFFER_USAGE constexpr | c_string_sink (const c_string_sink &other) noexcept |
| |
| constexpr | c_string_sink (c_string_sink &&other) noexcept |
| |
| constexpr c_string_sink & | operator= (const c_string_sink &other) noexcept |
| |
| constexpr c_string_sink & | operator= (c_string_sink &&other) noexcept |
| |
| RELOCO_END_UNSAFE_BUFFER_USAGE sink | as_sink () &noexcept RELOCO_LIFETIMEBOUND |
| | Creates a type-erased sink adapter pointing to this instance.
|
| |
| RELOCO_BEGIN_UNSAFE_CODE constexpr const char * | c_str () const &noexcept RELOCO_LIFETIMEBOUND |
| | Returns a null-terminated C string pointer.
|
| |
| RELOCO_END_UNSAFE_CODE constexpr const char * | c_str () const &&=delete |
| |
| constexpr microfmt::string_view | view () const &noexcept RELOCO_LIFETIMEBOUND |
| | Returns a string view over the characters written (excluding null terminator).
|
| |
| constexpr microfmt::string_view | view () const &&=delete |
| |
| constexpr std::size_t | size () const noexcept |
| | Returns the length of the string in bytes (excluding null terminator).
|
| |
| RELOCO_REINITIALIZES constexpr void | reset () noexcept |
| | Resets the sink to an empty, null-terminated state.
|
| |
template<std::size_t N>
class microfmt::c_string_sink< N >
Output sink that guarantees a null-terminated string within a fixed-size buffer.
Reserves 1 byte for the trailing \0. Output is clamped to N - 1 bytes and guaranteed to be null-terminated after every write.
- Template Parameters
-
| N | Total buffer size including the null terminator (must be >= 1). |