Append to the end of this buffer, using a printf() style format specifier.
Declared in <folly/io/Cursor.h>
void
printf(char const* fmt, ...);
methodset Appending
Note that folly/Format.h provides nicer and more type-safe mechanisms for formatting strings, which should generally be preferred over printf-style formatting. Appender objects can be used directly as an output argument for Formatter objects. For example:
Appender app(&iobuf); format("{} {}", "hello", "world")(app);
However, printf-style strings are still needed when dealing with existing third-party code in some cases.
This will always add a nul-terminating character after the end of the output. However, the buffer data length will only be updated to include the data itself. The nul terminator will be the first byte in the buffer tailroom.
This method may throw exceptions on error.
| Name | Description |
|---|---|
| fmt | The printf-style format string. |