mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 21:16:56 +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::Format(StringRef, const Args &...)
|
||||||
|
|
||||||
|
.. doxygenfunction:: fmt::Print(StringRef)
|
||||||
|
|
||||||
|
.. doxygenfunction:: fmt::Print(std::FILE *, StringRef)
|
||||||
|
|
||||||
.. doxygenclass:: fmt::BasicWriter
|
.. doxygenclass:: fmt::BasicWriter
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
24
format.h
24
format.h
@ -1659,17 +1659,29 @@ class FileSink {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Formats a string and prints it to stdout.
|
/**
|
||||||
// Example:
|
\rst
|
||||||
// Print("Elapsed time: {0:.2f} seconds") << 1.23;
|
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) {
|
inline Formatter<FileSink> Print(StringRef format) {
|
||||||
Formatter<FileSink> f(format, FileSink(stdout));
|
Formatter<FileSink> f(format, FileSink(stdout));
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Formats a string and prints it to a file.
|
/**
|
||||||
// Example:
|
\rst
|
||||||
// Print(stderr, "Don't {}!") << "panic";
|
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) {
|
inline Formatter<FileSink> Print(std::FILE *file, StringRef format) {
|
||||||
Formatter<FileSink> f(format, FileSink(file));
|
Formatter<FileSink> f(format, FileSink(file));
|
||||||
return f;
|
return f;
|
||||||
|
Loading…
Reference in New Issue
Block a user