Format a value into a stream, delegating to operator<< by default.
Synopsis
Declared in <tinyformat.h>
template<typename T>
void
formatValue(
std::ostream& out,
char const* fmtBegin,
char const* fmtEnd,
int ntrunc,
T const& value);
Description
Users may override this for their own types. When this function is called, the stream flags will have been modified according to the format string. The format specification is provided in the range [fmtBegin, fmtEnd). For] truncating conversions, ntrunc is set to the desired maximum number of characters, for example "%.7s" calls formatValue with ntrunc = 7.
By default, formatValue() uses the usual stream insertion operator operator<< to format the type T, with special cases for the %c and %p conversions.
Parameters
Name |
Description |
out |
Stream to write the formatted value to. |
fmtBegin |
Pointer to the first character of the format specification. |
fmtEnd |
Pointer past the last character of the format specification. |
ntrunc |
Maximum number of characters to emit for truncating conversions, or negative for none. |
value |
Value to format. |
Created with MrDocs