From 734bb029043f88c808be7f1d71024021e6698268 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 13 May 2014 06:43:43 -0700 Subject: [PATCH] More docs. --- format.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/format.h b/format.h index 41e8f012..6650bb11 100644 --- a/format.h +++ b/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 void Format(BasicStringRef 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 - `__. + `__ function. The class provides operator<< for feeding formatting arguments and all the output is sent to a :cpp:class:`fmt::Writer` object. \endrst