proxygen
|
Functions | |
template<class FormatCallback > | |
void | formatString (StringPiece val, FormatArg &arg, FormatCallback &cb) |
template<class FormatCallback > | |
void | formatNumber (StringPiece val, int prefixLen, FormatArg &arg, FormatCallback &cb) |
template<class FormatCallback , class Derived , bool containerMode, class... Args> | |
void | formatFormatter (const BaseFormatter< Derived, containerMode, Args... > &formatter, FormatArg &arg, FormatCallback &cb) |
Utilities for all format value specializations.
void folly::format_value::formatFormatter | ( | const BaseFormatter< Derived, containerMode, Args... > & | formatter, |
FormatArg & | arg, | ||
FormatCallback & | cb | ||
) |
Format a Formatter object recursively. Behaves just like formatString(fmt.str(), arg, cb); but avoids creating a temporary string if possible.
Definition at line 380 of file Format-inl.h.
References folly::FormatArg::align, folly::BaseFormatter< Derived, containerMode, Args >::fbstr(), formatString(), max, min, folly::FormatArg::precision, and folly::FormatArg::width.
Referenced by folly::FormatValue< KeyValue >::format(), and folly::vformat().
void folly::format_value::formatNumber | ( | StringPiece | val, |
int | prefixLen, | ||
FormatArg & | arg, | ||
FormatCallback & | cb | ||
) |
Format a number in "val"; the first prefixLen characters form the prefix (sign, "0x" base prefix, etc) which must be left-aligned if the alignment is Align::PAD_AFTER_SIGN. Treats Align::DEFAULT as Align::LEFT. Ignores arg.precision, as that has a different meaning for numbers (not "maximum field width")
Definition at line 357 of file Format-inl.h.
References folly::Range< Iter >::advance(), folly::FormatArg::align, testing::Args(), formatString(), max, folly::FormatArg::precision, folly::Range< Iter >::subpiece(), and folly::FormatArg::width.
Referenced by folly::FormatValue< T, typename std::enable_if< std::is_integral< T >::value &&!std::is_same< T, bool >::value >::type >::doFormat(), folly::FormatValue< double >::format(), and folly::vformat().
void folly::format_value::formatString | ( | StringPiece | val, |
FormatArg & | arg, | ||
FormatCallback & | cb | ||
) |
Format a string in "val", obeying appropriate alignment, padding, width, and precision. Treats Align::DEFAULT as Align::LEFT, and Align::PAD_AFTER_SIGN as Align::RIGHT; use formatNumber for number-specific formatting.
Definition at line 298 of file Format-inl.h.
References folly::FormatArg::align, folly::Range< Iter >::data(), folly::FormatArg::fill, min, folly::FormatArg::precision, folly::Range< Iter >::reset(), folly::Range< Iter >::size(), and folly::FormatArg::width.
Referenced by folly::FormatValue< bool >::format(), formatFormatter(), formatNumber(), and folly::vformat().