microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
microfmt::formatter< reloco::duration > Struct Reference

Formatter for reloco::duration. More...

#include <reloco.hpp>

Public Member Functions

constexpr void parse (format_parse_context &ctx) noexcept
 
void format (const reloco::duration &value, const sink &out) const noexcept
 

Public Attributes

uint8_t precision {9}
 Fractional-digit precision (default 9 = nanoseconds).
 
bool show_unit {true}
 Set to false (via r/R) for raw seconds without s suffix.
 

Detailed Description

Formatter for reloco::duration.

Renders sec.frac with a trailing s unit, mirroring formatters/posix_time.hpp's timespec/timeval formatters (which reloco::duration shares its (seconds, subsec_nanoseconds) representation with). Accepts the same m/3, u/6, n/9 fractional-precision suffixes and the r/R flag to suppress the trailing s unit.

Member Function Documentation

◆ format()

void microfmt::formatter< reloco::duration >::format ( const reloco::duration &  value,
const sink &  out 
) const
inlinenoexcept

◆ parse()

constexpr void microfmt::formatter< reloco::duration >::parse ( format_parse_context &  ctx)
inlineconstexprnoexcept

Member Data Documentation

◆ precision

uint8_t microfmt::formatter< reloco::duration >::precision {9}

Fractional-digit precision (default 9 = nanoseconds).

◆ show_unit

bool microfmt::formatter< reloco::duration >::show_unit {true}

Set to false (via r/R) for raw seconds without s suffix.


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