Document Print.
This commit is contained in:
1 parent
e79bcfe5ab
commit
13a5b2511b
2 files changed
+22
-6
No files matched your search
@@ -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:
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user