Valkyrie 2026
Loading...
Searching...
No Matches
valor::EigenUnit::detail::UnitFormatSpec Struct Reference

Parses a shared format spec used by UnitVector, UnitMap, ConstUnitMap. More...

#include <valkyrie/util/eigenunit/Common.h>

Public Member Functions

template<typename ParseContext>
constexpr auto parse (ParseContext &ctx)
 Parses the format specifier string.
std::string format_value (double v) const
 Formats a single double value according to the spec.

Public Attributes

int precision = -1
 Desired decimal precision. -1 for default.
bool values_only = false
 If true, only values are printed (no unit abbreviations).

Detailed Description

Parses a shared format spec used by UnitVector, UnitMap, ConstUnitMap.

Member Function Documentation

◆ format_value()

std::string valor::EigenUnit::detail::UnitFormatSpec::format_value ( double v) const
inline

Formats a single double value according to the spec.

Parameters
vThe value to format.
Returns
The formatted string.

◆ parse()

template<typename ParseContext>
auto valor::EigenUnit::detail::UnitFormatSpec::parse ( ParseContext & ctx)
inlineconstexpr

Parses the format specifier string.

Parameters
ctxThe parse context.
Returns
Iterator to the end of the format spec.

The documentation for this struct was generated from the following file:
  • src/main/include/valkyrie/util/eigenunit/Common.h