Skip to content

ENH: provided a flexible string formatting

Provide the possibility of sprintf-style formatting for basic primitives (int, float) in the Foam::name() globals. Example syntax,

word outname = name("%08d", intval);

instead of

std::ostringstream oss;
oss << std::setfill('0') << std::setw(8) << intval;
word outname = oss.str();