akreon-convex
Typed convex modeling, conic canonicalization, and primal-dual optimization in C++26.
Loading...
Searching...
No Matches
convex::debug::FixedBufferWriter Struct Reference

Small no-heap append-only writer for debug formatting. More...

#include <fixed_buffer_writer.hpp>

Public Member Functions

constexpr std::size_t size () const
 
constexpr bool ok () const
 
constexpr const char * c_str () const
 
void init ()
 
bool append (const char *text)
 
template<typename... Args>
bool format (const char *fmt, Args... args)
 

Public Attributes

char * out {}
 
std::size_t cap {}
 
std::size_t pos {}
 
bool truncated {}
 

Detailed Description

Small no-heap append-only writer for debug formatting.

The writer always keeps the output NUL-terminated when capacity is nonzero. ok() reports whether every append fit.

Definition at line 23 of file fixed_buffer_writer.hpp.

Member Function Documentation

◆ append()

◆ c_str()

constexpr const char * convex::debug::FixedBufferWriter::c_str ( ) const
inlineconstexpr

Definition at line 31 of file fixed_buffer_writer.hpp.

References out.

◆ format()

◆ init()

void convex::debug::FixedBufferWriter::init ( )
inline

◆ ok()

constexpr bool convex::debug::FixedBufferWriter::ok ( ) const
inlineconstexpr

Definition at line 30 of file fixed_buffer_writer.hpp.

References truncated.

◆ size()

constexpr std::size_t convex::debug::FixedBufferWriter::size ( ) const
inlineconstexpr

Definition at line 29 of file fixed_buffer_writer.hpp.

References pos.

Member Data Documentation

◆ cap

std::size_t convex::debug::FixedBufferWriter::cap {}

Definition at line 25 of file fixed_buffer_writer.hpp.

Referenced by format(), and init().

◆ out

char* convex::debug::FixedBufferWriter::out {}

Definition at line 24 of file fixed_buffer_writer.hpp.

Referenced by c_str(), format(), and init().

◆ pos

std::size_t convex::debug::FixedBufferWriter::pos {}

Definition at line 26 of file fixed_buffer_writer.hpp.

Referenced by format(), and size().

◆ truncated

bool convex::debug::FixedBufferWriter::truncated {}

Definition at line 27 of file fixed_buffer_writer.hpp.

Referenced by format(), and ok().


The documentation for this struct was generated from the following file: