Writes a formatted string to an arbitrary sink object (implementing the absl::FormatRawSink interface), using a format string and zero or more additional arguments.
Synopsis
Declared in <absl/strings/str_format.h>
template<typename... Args>
bool
Format(
FormatRawSink raw_sink,
FormatSpec<Args...> const& format,
Args const&... args);
Description
By default, std::string, std::ostream, and absl::Cord are supported as destination objects. If a std::string is used the formatted string is appended to it.
absl::Format() is a generic version of absl::StrAppendFormat(), for custom sinks. The format string, like format strings for StrFormat(), is checked at compile‐time.
On failure, this function returns false and the state of the sink is unspecified.
Return Value
true on success, false on error.
Parameters
Name |
Description |
raw_sink |
The sink that receives the formatted output. |
format |
The format string. |
args |
The arguments substituted into the format string. |
Created with MrDocs