#include <bdlt_formatutil.h>
template<class t_CHAR>
class bdlt::FormatUtil< t_CHAR >
This class serves as a namespace for some static functions that are useful in creating specializations of bsl::formatter to support bsl::format.
See bdlt_formatutil
|
| template<class t_ITERATOR > |
| static t_ITERATOR | writeSecondFraction (t_ITERATOR out, int precision, t_CHAR decimalChar, int millisecond, int microsecond) |
| |
| template<class t_ITERATOR > |
| static t_ITERATOR | writeZeroPaddedDigits (t_ITERATOR out, int value, int numDigits=2) |
| |
◆ StringView
◆ writeSecondFraction()
template<class t_CHAR >
template<class t_ITERATOR >
| t_ITERATOR bdlt::FormatUtil< t_CHAR >::writeSecondFraction |
( |
t_ITERATOR |
out, |
|
|
int |
precision, |
|
|
t_CHAR |
decimalChar, |
|
|
int |
millisecond, |
|
|
int |
microsecond |
|
) |
| |
|
static |
Write the fraction of a second from the timeCache to d_out, where the precision is the number of digits of precision wanted. Use decimalChar (expected to be '.' or ',') as a decimal point, and if precision == 0 output nothing. If 6 < precision, write '0' characters following the first 6 digits.
- Precondition
- The behavior is undefined unless
0 <= millisecond < 1000, 0 <= microsecond < 1000, and 0 <= precision.
◆ writeZeroPaddedDigits()
template<class t_CHAR >
template<class t_ITERATOR >
| t_ITERATOR bdlt::FormatUtil< t_CHAR >::writeZeroPaddedDigits |
( |
t_ITERATOR |
out, |
|
|
int |
value, |
|
|
int |
numDigits = 2 |
|
) |
| |
|
inlinestatic |
Write the specified value in decimal to the specified out. Always write the specified numDigits digits, '0'-padding to the left if necessary. Return the iterator after output is done.
- Precondition
- The behavior is undefined unless
2 <= numDigits <= 6 and 0 <= value < pow(10, numDigits).
The documentation for this class was generated from the following file: