HDK
|
Functions | |
template<typename Str , typename... Args> | |
std::string | format (const Str &fmt, Args &&...args) |
format() constructs formatted strings. Note that this is in transition!
Strutil::old::format() uses printf conventions and matches format() used in OIIO 1.x. It is equivalent to Strutil::sprintf().
std::string s = Strutil::old::sprintf ("blah %d %g", (int)foo, (float)bar);
Strutil::fmt::format() uses "Python" conventions, in the style of string formatting used by C++20 std::format and implemented today in the {fmt} package (https://github.com/fmtlib/fmt). For example:
std::string s = Strutil::format ("blah {} {}", (int)foo, (float)bar);
Straight-up Strutil::format is today aliased to old::format for the sake of back-compatibility, but will someday be switched to fmt::format.
Recommended strategy for users:
|
inline |