mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-13 06:30:06 +00:00
More docs.
This commit is contained in:
parent
1eb30e4288
commit
734bb02904
24
format.h
24
format.h
@ -1068,6 +1068,28 @@ class BasicWriter {
|
||||
}
|
||||
|
||||
#if FMT_USE_VARIADIC_TEMPLATES
|
||||
/**
|
||||
\rst
|
||||
Formats a string sending the output to the writer.
|
||||
|
||||
**Example**::
|
||||
|
||||
Writer out;
|
||||
out.Format("Current point:\n");
|
||||
out.Format("({:+f}, {:+f})", -3.14, 3.14);
|
||||
|
||||
This will write the following output to the ``out`` object:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
Current point:
|
||||
(-3.140000, +3.140000)
|
||||
|
||||
The output can be accessed using :meth:`data` or :meth:`c_str`.
|
||||
|
||||
See also `Format String Syntax`_.
|
||||
\endrst
|
||||
*/
|
||||
template<typename... Args>
|
||||
void Format(BasicStringRef<Char> format, const Args & ... args) {
|
||||
Arg arg_array[] = {args...};
|
||||
@ -1291,7 +1313,7 @@ void FormatCustomArg(
|
||||
\rst
|
||||
The :cpp:class:`fmt::BasicFormatter` template provides string formatting
|
||||
functionality similar to Python's `str.format
|
||||
<http://docs.python.org/3/library/stdtypes.html#str.format>`__.
|
||||
<http://docs.python.org/3/library/stdtypes.html#str.format>`__ function.
|
||||
The class provides operator<< for feeding formatting arguments and all
|
||||
the output is sent to a :cpp:class:`fmt::Writer` object.
|
||||
\endrst
|
||||
|
Loading…
Reference in New Issue
Block a user