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

Formatter for sbintime_view values. More...

#include <bintime.hpp>

Public Member Functions

constexpr void parse (format_parse_context &ctx) noexcept
 Parses precision and unit flags from the format specifier.
 
void format (const sbintime_view< T > &sv, const sink &out) const noexcept
 Renders an sbintime_t as sec.frac with optional s unit.
 

Public Attributes

time_precision precision {time_precision::us}
 Fractional-second precision used when rendering.
 
bool show_unit {true}
 Set to false (via r/R) to suppress the trailing s unit.
 

Detailed Description

template<typename T>
struct microfmt::formatter< sbintime_view< T > >

Formatter for sbintime_view values.

Accepts the m/3, u/6, n/9 precision suffixes and the r/R flag to suppress the trailing s unit.

Template Parameters
TIntegral storage type of the wrapped sbintime_t.

Member Function Documentation

◆ format()

template<typename T >
void microfmt::formatter< sbintime_view< T > >::format ( const sbintime_view< T > &  sv,
const sink &  out 
) const
inlinenoexcept

Renders an sbintime_t as sec.frac with optional s unit.

Parameters
svThe view holding the raw 32.32 fixed-point value.
outDestination sink.

◆ parse()

template<typename T >
constexpr void microfmt::formatter< sbintime_view< T > >::parse ( format_parse_context &  ctx)
inlineconstexprnoexcept

Parses precision and unit flags from the format specifier.

Parameters
ctxFormat parse context exposing the specifier text.

Member Data Documentation

◆ precision

template<typename T >
time_precision microfmt::formatter< sbintime_view< T > >::precision {time_precision::us}

Fractional-second precision used when rendering.

◆ show_unit

template<typename T >
bool microfmt::formatter< sbintime_view< T > >::show_unit {true}

Set to false (via r/R) to suppress the trailing s unit.


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