microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Namespaces | Classes | Functions
microfmt::json Namespace Reference

Namespaces

namespace  detail
 

Classes

struct  json_obj_view
 

Functions

void write_escaped_string (const sink &out, microfmt::string_view str) noexcept
 Writes a quoted, JSON-escaped string to out.
 
class MICROFMT_API_CLASS RELOCO_CONSUMABLE (unconsumed) RELOCO_POINTER object_writer
 RAII writer for a streaming JSON object.
 
template<typename Fn >
constexpr auto json_obj (Fn &&fn) noexcept
 Wraps an object-writing callable for use as a format argument.
 

Function Documentation

◆ json_obj()

template<typename Fn >
constexpr auto microfmt::json::json_obj ( Fn &&  fn)
constexprnoexcept

Wraps an object-writing callable for use as a format argument.

◆ RELOCO_CONSUMABLE()

class MICROFMT_API_CLASS microfmt::json::RELOCO_CONSUMABLE ( unconsumed  )

RAII writer for a streaming JSON object.

RAII writer for a streaming JSON array.

Consumed-state tracked: writes are only valid while unconsumed; end transitions the object to consumed, after which Clang's -Wconsumed flags any further key/kv/nested_* call as a compile-time diagnostic.

Consumed-state tracked: see object_writer for the state contract.

◆ write_escaped_string()

void microfmt::json::write_escaped_string ( const sink &  out,
microfmt::string_view  str 
)
inlinenoexcept

Writes a quoted, JSON-escaped string to out.