mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 21:16:56 +00:00
Update the readme.
This commit is contained in:
parent
e19eceafec
commit
452df673ea
14
README.rst
14
README.rst
@ -1,15 +1,16 @@
|
|||||||
format
|
format
|
||||||
======
|
======
|
||||||
|
|
||||||
Format is an open-source string formatting library for C++.
|
Format is an open-source formatting library for C++.
|
||||||
It can be used as a type-safe alternative to `printf` or as a fast
|
It can be used as a type-safe alternative to `printf` or as a fast
|
||||||
alternative to IOStreams.
|
alternative to IOStreams.
|
||||||
|
|
||||||
Features
|
Features
|
||||||
--------
|
--------
|
||||||
|
|
||||||
* Two APIs: faster concatenation-based write API and slower (but still fast)
|
* Two APIs: faster concatenation-based write API and slower (but still
|
||||||
replacement-based format API with positional arguments for localization.
|
very fast) replacement-based format API with positional arguments for
|
||||||
|
localization.
|
||||||
* Write API similar to the one used by IOStreams but much faster and more
|
* Write API similar to the one used by IOStreams but much faster and more
|
||||||
consistent.
|
consistent.
|
||||||
* Format API with `format string syntax
|
* Format API with `format string syntax
|
||||||
@ -69,9 +70,10 @@ An object of any user-defined type for which there is an overloaded
|
|||||||
std::string s = str(fmt::Format("The date is {0}") << Date(2012, 12, 9));
|
std::string s = str(fmt::Format("The date is {0}") << Date(2012, 12, 9));
|
||||||
// s == "The date is 2012-12-9"
|
// s == "The date is 2012-12-9"
|
||||||
|
|
||||||
You can use ``fmt::TempFormatter`` to create your own functions
|
You can use ```fmt::TempFormatter``
|
||||||
similar to ``fmt::Format`` and ``fmt::Print`` with an arbitrary action
|
<http://zverovich.net/format/#project0classfmt_1_1_temp_formatter>`
|
||||||
performed when formatting is complete:
|
to create your own functions similar to ``fmt::Format`` and ``fmt::Print``
|
||||||
|
with an arbitrary action performed when formatting is complete:
|
||||||
|
|
||||||
.. code-block:: c++
|
.. code-block:: c++
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user