aboutsummaryrefslogtreecommitdiff
path: root/doc/index.rst
diff options
context:
space:
mode:
authorVictor Zverovich <victor.zverovich@gmail.com>2014-08-21 08:49:13 -0700
committerVictor Zverovich <victor.zverovich@gmail.com>2014-08-21 08:49:13 -0700
commitdd4323f31c220f1869dffa992cf09133ba382ca3 (patch)
treeb5653e802eb105c8e924e023f49e9cffdbe76351 /doc/index.rst
parentf9561671cfaf9107942575b30c2422e9b675c8ba (diff)
downloadfmtlib-dd4323f31c220f1869dffa992cf09133ba382ca3.tar.gz
Add fprintf and write docs.
Diffstat (limited to 'doc/index.rst')
-rw-r--r--doc/index.rst48
1 files changed, 39 insertions, 9 deletions
diff --git a/doc/index.rst b/doc/index.rst
index 77ef4a3e..ffe615b7 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -6,8 +6,8 @@ Usage
-----
To use the C++ Format library, add ``format.h`` and ``format.cc`` from
-a `release archive <https://github.com/cppformat/cppformat/releases/latest>`__
-or the `Git repository <https://github.com/cppformat/cppformat>`__ to your project.
+a `release archive <https://github.com/cppformat/cppformat/releases/latest>`_
+or the `Git repository <https://github.com/cppformat/cppformat>`_ to your project.
If you are using Visual C++ with precompiled headers, you might need to add
the line
@@ -25,6 +25,20 @@ All functions and classes provided by the C++ Format library reside
in namespace ``fmt`` and macros have prefix ``FMT_``. For brevity the
namespace is usually omitted in examples.
+Formatting functions
+^^^^^^^^^^^^^^^^^^^^
+
+The following functions use `format string syntax`_ similar to the one
+used by Python's `str.format
+<http://docs.python.org/3/library/stdtypes.html#str.format>`_ function.
+They take *format_str* and *args* as arguments.
+
+*format_str* is a format string that contains literal text and replacement
+fields surrounded by braces ``{}``. The fields are replaced with formatted
+arguments in the resulting string.
+
+*args* is an argument list representing arbitrary arguments.
+
.. doxygenfunction:: fmt::format(StringRef, const ArgList &)
.. doxygenfunction:: fmt::print(StringRef, const ArgList &)
@@ -33,20 +47,25 @@ namespace is usually omitted in examples.
.. doxygenfunction:: fmt::print(std::ostream &, StringRef, const ArgList &)
-.. doxygendefine:: FMT_VARIADIC
+Printf formatting functions
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
-.. doxygenclass:: fmt::BasicWriter
- :members:
+The following functions use `printf format string syntax
+<http://pubs.opengroup.org/onlinepubs/009695399/functions/fprintf.html>`_ with
+a POSIX extension for positional arguments.
-.. doxygenclass:: fmt::ArgList
- :members:
+.. doxygenfunction:: fmt::printf(StringRef, const ArgList &)
-.. doxygenclass:: fmt::BasicStringRef
- :members:
+.. doxygenfunction:: fmt::fprintf(std::FILE *, StringRef, const ArgList &)
+
+.. doxygenfunction:: fmt::sprintf(StringRef, const ArgList &)
Write API
---------
+.. doxygenclass:: fmt::BasicWriter
+ :members:
+
.. doxygenfunction:: fmt::bin
.. doxygenfunction:: fmt::oct
@@ -59,6 +78,17 @@ Write API
.. _formatstrings:
+Utilities
+---------
+
+.. doxygendefine:: FMT_VARIADIC
+
+.. doxygenclass:: fmt::ArgList
+ :members:
+
+.. doxygenclass:: fmt::BasicStringRef
+ :members:
+
System Errors
-------------