mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 03:17:53 +00:00
Document Print.
This commit is contained in:
parent
e79bcfe5ab
commit
13a5b2511b
@ -13,6 +13,10 @@ namespace is usually omitted in examples.
|
||||
|
||||
.. doxygenfunction:: fmt::Format(StringRef, const Args &...)
|
||||
|
||||
.. doxygenfunction:: fmt::Print(StringRef)
|
||||
|
||||
.. doxygenfunction:: fmt::Print(std::FILE *, StringRef)
|
||||
|
||||
.. doxygenclass:: fmt::BasicWriter
|
||||
:members:
|
||||
|
||||
|
24
format.h
24
format.h
@ -1659,17 +1659,29 @@ class FileSink {
|
||||
}
|
||||
};
|
||||
|
||||
// Formats a string and prints it to stdout.
|
||||
// Example:
|
||||
// Print("Elapsed time: {0:.2f} seconds") << 1.23;
|
||||
/**
|
||||
\rst
|
||||
Formats a string and writes the result to ``stdout``.
|
||||
|
||||
**Example**::
|
||||
|
||||
Print("Elapsed time: {0:.2f} seconds") << 1.23;
|
||||
\endrst
|
||||
*/
|
||||
inline Formatter<FileSink> Print(StringRef format) {
|
||||
Formatter<FileSink> f(format, FileSink(stdout));
|
||||
return f;
|
||||
}
|
||||
|
||||
// Formats a string and prints it to a file.
|
||||
// Example:
|
||||
// Print(stderr, "Don't {}!") << "panic";
|
||||
/**
|
||||
\rst
|
||||
Formats a string and writes the result to a file.
|
||||
|
||||
**Example**::
|
||||
|
||||
Print(stderr, "Don't {}!") << "panic";
|
||||
\endrst
|
||||
*/
|
||||
inline Formatter<FileSink> Print(std::FILE *file, StringRef format) {
|
||||
Formatter<FileSink> f(format, FileSink(file));
|
||||
return f;
|
||||
|
Loading…
Reference in New Issue
Block a user