Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldreik committed May 29, 2019
2 parents 63e7b9e + bb254d1 commit 61c6756
Show file tree
Hide file tree
Showing 14 changed files with 193 additions and 115 deletions.
22 changes: 11 additions & 11 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@

* Implemented ``constexpr`` parsing of format strings and `compile-time format
string checks
<http://fmtlib.net/dev/api.html#compile-time-format-string-checks>`_. For
<https://fmt.dev/dev/api.html#compile-time-format-string-checks>`_. For
example

.. code:: c++
Expand Down Expand Up @@ -528,7 +528,7 @@
throw format_error("invalid specifier");

* Added `iterator support
<http://fmtlib.net/dev/api.html#output-iterator-support>`_:
<https://fmt.dev/dev/api.html#output-iterator-support>`_:

.. code:: c++

Expand All @@ -539,7 +539,7 @@
fmt::format_to(std::back_inserter(out), "{}", 42);

* Added the `format_to_n
<http://fmtlib.net/dev/api.html#_CPPv2N3fmt11format_to_nE8OutputItNSt6size_tE11string_viewDpRK4Args>`_
<https://fmt.dev/dev/api.html#_CPPv2N3fmt11format_to_nE8OutputItNSt6size_tE11string_viewDpRK4Args>`_
function that restricts the output to the specified number of characters
(`#298 <https://github.com/fmtlib/fmt/issues/298>`_):

Expand All @@ -550,7 +550,7 @@
// out == "1234" (without terminating '\0')

* Added the `formatted_size
<http://fmtlib.net/dev/api.html#_CPPv2N3fmt14formatted_sizeE11string_viewDpRK4Args>`_
<https://fmt.dev/dev/api.html#_CPPv2N3fmt14formatted_sizeE11string_viewDpRK4Args>`_
function for computing the output size:

.. code:: c++
Expand All @@ -560,7 +560,7 @@
auto size = fmt::formatted_size("{}", 12345); // size == 5

* Improved compile times by reducing dependencies on standard headers and
providing a lightweight `core API <http://fmtlib.net/dev/api.html#core-api>`_:
providing a lightweight `core API <https://fmt.dev/dev/api.html#core-api>`_:

.. code:: c++

Expand All @@ -572,7 +572,7 @@
<https://github.com/fmtlib/fmt#compile-time-and-code-bloat>`_.

* Added the `make_format_args
<http://fmtlib.net/dev/api.html#_CPPv2N3fmt16make_format_argsEDpRK4Args>`_
<https://fmt.dev/dev/api.html#_CPPv2N3fmt16make_format_argsEDpRK4Args>`_
function for capturing formatting arguments:

.. code:: c++
Expand Down Expand Up @@ -654,7 +654,7 @@
fmt::format("{} {two}", 1, fmt::arg("two", 2));

* Removed the write API in favor of the `format API
<http://fmtlib.net/dev/api.html#format-api>`_ with compile-time handling of
<https://fmt.dev/dev/api.html#format-api>`_ with compile-time handling of
format strings.

* Disallowed formatting of multibyte strings into a wide character target
Expand Down Expand Up @@ -1115,10 +1115,10 @@
Including ``format.h`` from the ``cppformat`` directory is deprecated
but works via a proxy header which will be removed in the next major version.

The documentation is now available at http://fmtlib.net.
The documentation is now available at https://fmt.dev.

* Added support for `strftime <http://en.cppreference.com/w/cpp/chrono/c/strftime>`_-like
`date and time formatting <http://fmtlib.net/3.0.0/api.html#date-and-time-formatting>`_
`date and time formatting <https://fmt.dev/3.0.0/api.html#date-and-time-formatting>`_
(`#283 <https://github.com/fmtlib/fmt/issues/283>`_):

.. code:: c++
Expand Down Expand Up @@ -1150,7 +1150,7 @@
// s == "The date is 2012-12-9"

* Added support for `custom argument formatters
<http://fmtlib.net/3.0.0/api.html#argument-formatters>`_
<https://fmt.dev/3.0.0/api.html#argument-formatters>`_
(`#235 <https://github.com/fmtlib/fmt/issues/235>`_).

* Added support for locale-specific integer formatting with the ``n`` specifier
Expand Down Expand Up @@ -1530,7 +1530,7 @@ Documentation


* Added `Building the documentation
<http://fmtlib.net/2.0.0/usage.html#building-the-documentation>`_
<https://fmt.dev/2.0.0/usage.html#building-the-documentation>`_
section to the documentation.

* Documentation build script is now compatible with Python 3 and newer pip versions.
Expand Down
26 changes: 13 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
**{fmt}** is an open-source formatting library for C++.
It can be used as a safe and fast alternative to (s)printf and iostreams.

`Documentation <http://fmtlib.net/latest/>`__
`Documentation <https://fmt.dev/latest/>`__

Q&A: ask questions on `StackOverflow with the tag fmt <http://stackoverflow.com/questions/tagged/fmt>`_.

Features
--------

* Replacement-based `format API <http://fmtlib.net/dev/api.html>`_ with
* Replacement-based `format API <https://fmt.dev/dev/api.html>`_ with
positional arguments for localization.
* `Format string syntax <http://fmtlib.net/dev/syntax.html>`_ similar to the one
* `Format string syntax <https://fmt.dev/dev/syntax.html>`_ similar to the one
of `str.format <https://docs.python.org/2/library/stdtypes.html#str.format>`_
in Python.
* Safe `printf implementation
<http://fmtlib.net/latest/api.html#printf-formatting>`_ including
<https://fmt.dev/latest/api.html#printf-formatting>`_ including
the POSIX extension for positional arguments.
* Implementation of the ISO C++ standards proposal `P0645
Text Formatting <http://fmtlib.net/Text%20Formatting.html>`__.
Text Formatting <https://fmt.dev/Text%20Formatting.html>`__.
* Support for user-defined types.
* High performance: faster than common standard library implementations of
`printf <http://en.cppreference.com/w/cpp/io/c/fprintf>`_ and
Expand All @@ -47,14 +47,14 @@ Features
* Ease of use: small self-contained code base, no external dependencies,
permissive BSD `license
<https://github.com/fmtlib/fmt/blob/master/LICENSE.rst>`_
* `Portability <http://fmtlib.net/latest/index.html#portability>`_ with
* `Portability <https://fmt.dev/latest/index.html#portability>`_ with
consistent output across platforms and support for older compilers.
* Clean warning-free codebase even on high warning levels
(``-Wall -Wextra -pedantic``).
* Support for wide strings.
* Optional header-only configuration enabled with the ``FMT_HEADER_ONLY`` macro.

See the `documentation <http://fmtlib.net/latest/>`_ for more details.
See the `documentation <https://fmt.dev/latest/>`_ for more details.

Examples
--------
Expand Down Expand Up @@ -107,7 +107,7 @@ Use {fmt} as a safe portable replacement for ``itoa``
// access the string with to_string(buf) or buf.data()

Format objects of user-defined types via a simple `extension API
<http://fmtlib.net/latest/api.html#formatting-user-defined-types>`_:
<https://fmt.dev/latest/api.html#formatting-user-defined-types>`_:

.. code:: c++

Expand All @@ -132,8 +132,8 @@ Format objects of user-defined types via a simple `extension API
// s == "The date is 2012-12-9"

Create your own functions similar to `format
<http://fmtlib.net/latest/api.html#format>`_ and
`print <http://fmtlib.net/latest/api.html#print>`_
<https://fmt.dev/latest/api.html#format>`_ and
`print <https://fmt.dev/latest/api.html#print>`_
which take arbitrary arguments (`godbolt <https://godbolt.org/g/MHjHVf>`_):

.. code:: c++
Expand Down Expand Up @@ -185,7 +185,7 @@ formatting (`dtoa-benchmark <https://github.com/fmtlib/dtoa-benchmark>`_)
and as fast as `double-conversion <https://github.com/google/double-conversion>`_:

.. image:: https://user-images.githubusercontent.com/576385/54883977-9fe8c000-4e28-11e9-8bde-272d122e7c52.jpg
:target: http://fmtlib.net/unknown_mac64_clang10.0.html
:target: https://fmt.dev/unknown_mac64_clang10.0.html

Compile time and code bloat
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -244,7 +244,7 @@ Running the tests
Please refer to `Building the library`__ for the instructions on how to build
the library and run the unit tests.

__ http://fmtlib.net/latest/usage.html#building-the-library
__ https://fmt.dev/latest/usage.html#building-the-library

Benchmarks reside in a separate repository,
`format-benchmarks <https://github.com/fmtlib/format-benchmark>`_,
Expand Down Expand Up @@ -474,7 +474,7 @@ License
<https://github.com/fmtlib/fmt/blob/master/LICENSE.rst>`_.

The `Format String Syntax
<http://fmtlib.net/latest/syntax.html>`_
<https://fmt.dev/latest/syntax.html>`_
section in the documentation is based on the one from Python `string module
documentation <https://docs.python.org/3/library/string.html#module-string>`_
adapted for the current library. For this reason the documentation is
Expand Down
2 changes: 1 addition & 1 deletion doc/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
{% for v in versions.split(',') %}
<li><a href="http://fmtlib.net/{{v}}">{{v}}</a></li>
<li><a href="https://fmt.dev/{{v}}">{{v}}</a></li>
{% endfor %}
</ul>
</li>
Expand Down
24 changes: 12 additions & 12 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ participate in an overload resolution if the latter is not a string.
.. doxygenfunction:: vprint(std::FILE *, string_view, format_args)
.. doxygenfunction:: vprint(std::FILE *, wstring_view, wformat_args)

Named arguments
Named Arguments
---------------

.. doxygenfunction:: fmt::arg(const S&, const T&)

Named arguments are not supported in compile-time checks at the moment.

Argument lists
Argument Lists
--------------

.. doxygenfunction:: fmt::make_format_args(const Args&...)
Expand Down Expand Up @@ -91,13 +91,13 @@ Format API
``fmt/format.h`` defines the full format API providing compile-time format
string checks, output iterator and user-defined type support.

Compile-time format string checks
Compile-time Format String Checks
---------------------------------

.. doxygendefine:: FMT_STRING
.. doxygendefine:: fmt

Formatting user-defined types
Formatting User-defined Types
-----------------------------

To make a user-defined type formattable, specialize the ``formatter<T>`` struct
Expand Down Expand Up @@ -184,10 +184,10 @@ This section shows how to define a custom format function for a user-defined
type. The next section describes how to get ``fmt`` to use a conventional stream
output ``operator<<`` when one is defined for a user-defined type.

Output iterator support
Output Iterator Support
-----------------------

.. doxygenfunction:: fmt::format_to(OutputIt, const S&, const Args&...)
.. doxygenfunction:: fmt::format_to(OutputIt, const S &, const Args &...)
.. doxygenfunction:: fmt::format_to_n(OutputIt, std::size_t, string_view, const Args&...)
.. doxygenstruct:: fmt::format_to_n_result
:members:
Expand Down Expand Up @@ -218,7 +218,7 @@ Utilities
:protected-members:
:members:

System errors
System Errors
-------------

fmt does not use ``errno`` to communicate errors to the user, but it may call
Expand All @@ -235,7 +235,7 @@ the value of ``errno`` being preserved by library functions.

.. _formatstrings:

Custom allocators
Custom Allocators
-----------------

The {fmt} library supports custom dynamic memory allocators.
Expand Down Expand Up @@ -270,7 +270,7 @@ arguments, the container that stores pointers to them will be allocated using
the default allocator. Also floating-point formatting falls back on ``sprintf``
which may do allocations.

Custom formatting of built-in types
Custom Formatting of Built-in Types
-----------------------------------

It is possible to change the way arguments are formatted by providing a
Expand Down Expand Up @@ -316,7 +316,7 @@ custom argument formatter class::

.. _chrono-api:

Date and time formatting
Date and Time Formatting
========================

The library supports `strftime
Expand All @@ -334,7 +334,7 @@ The format string syntax is described in the documentation of

.. _ostream-api:

``std::ostream`` support
``std::ostream`` Support
========================

``fmt/ostream.h`` provides ``std::ostream`` support including formatting of
Expand All @@ -359,7 +359,7 @@ user-defined types that have overloaded ``operator<<``::

.. _printf-api:

``printf`` formatting
``printf`` Formatting
=====================

The header ``fmt/printf.h`` provides ``printf``-like formatting functionality.
Expand Down
2 changes: 1 addition & 1 deletion doc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def build_docs(version='dev', **kwargs):
"FMT_BEGIN_NAMESPACE=namespace fmt {{" \
"FMT_END_NAMESPACE=}}" \
"FMT_STRING_ALIAS=1" \
"FMT_ENABLE_IF_T(B, T)=T"
"FMT_ENABLE_IF_T(B)=int"
EXCLUDE_SYMBOLS = fmt::internal::* StringValue write_str
'''.format(include_dir, doxyxml_dir).encode('UTF-8'))
if p.returncode != 0:
Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ its numeric value being written to the stream (i.e. 1070 instead of letter 'ю'
which is represented by ``L'\x42e'`` if we use Unicode) which is rarely what is
needed.

Compact binary code
Compact Binary Code
-------------------

The library is designed to produce compact per-call compiled code. For example
Expand Down
2 changes: 1 addition & 1 deletion doc/syntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ The available presentation types for pointers are:

.. _formatexamples:

Format examples
Format Examples
===============

This section contains examples of the format syntax and comparison with
Expand Down
15 changes: 4 additions & 11 deletions doc/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@ from a `release archive <https://github.com/fmtlib/fmt/releases/latest>`_ or
the `Git repository <https://github.com/fmtlib/fmt>`_ to your project.
Alternatively, you can :ref:`build the library with CMake <building>`.

If you are using Visual C++ with precompiled headers, you might need to add
the line ::

#include "stdafx.h"

before other includes in :file:`format.cc`.

.. _building:

Building the library
Building the Library
====================

The included `CMake build script`__ can be used to build the fmt
Expand Down Expand Up @@ -59,8 +52,8 @@ To build a `shared library`__ set the ``BUILD_SHARED_LIBS`` CMake variable to

__ http://en.wikipedia.org/wiki/Library_%28computing%29#Shared_libraries

Installing the library
====================
Installing the Library
======================

After building the library you can install it on a Unix-like system by running
:command:`sudo make install`.
Expand Down Expand Up @@ -90,7 +83,7 @@ Setting up your target to use a header-only version of ``fmt`` is equaly easy::

target_link_libraries(<your-target> PRIVATE fmt-header-only)

Building the documentation
Building the Documentation
==========================

To build the documentation you need the following software installed on your
Expand Down
2 changes: 0 additions & 2 deletions include/fmt/printf.h
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,6 @@ template <typename S, typename... Args,
FMT_ENABLE_IF(internal::is_string<S>::value)>
inline std::basic_string<FMT_CHAR(S)> sprintf(const S& format,
const Args&... args) {
internal::check_format_string<Args...>(format);
typedef internal::buffer<FMT_CHAR(S)> buffer;
typedef typename basic_printf_context_t<buffer>::type context;
format_arg_store<context, Args...> as{args...};
Expand Down Expand Up @@ -665,7 +664,6 @@ inline int vfprintf(
template <typename S, typename... Args,
FMT_ENABLE_IF(internal::is_string<S>::value)>
inline int fprintf(std::FILE* f, const S& format, const Args&... args) {
internal::check_format_string<Args...>(format);
typedef internal::buffer<FMT_CHAR(S)> buffer;
typedef typename basic_printf_context_t<buffer>::type context;
format_arg_store<context, Args...> as{args...};
Expand Down
2 changes: 1 addition & 1 deletion support/rtd/index.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
If you are not redirected automatically, follow the
`link to the fmt documentation <http://fmtlib.net/latest/>`_.
`link to the fmt documentation <https://fmt.dev/latest/>`_.
6 changes: 3 additions & 3 deletions support/rtd/theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

{% block extrahead %}
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=http://fmtlib.net/latest/">
<meta http-equiv="refresh" content="1;url=https://fmt.dev/latest/">
<script type="text/javascript">
window.location.href = "http://fmtlib.net/latest/"
window.location.href = "https://fmt.dev/latest/"
</script>
<title>Page Redirection</title>
{% endblock %}

{% block document %}
If you are not redirected automatically, follow the <a href='http://fmtlib.net/latest/'>link to the fmt documentation</a>.
If you are not redirected automatically, follow the <a href='https://fmt.dev/latest/'>link to the fmt documentation</a>.
{% endblock %}

{% block footer %}
Expand Down
Loading

0 comments on commit 61c6756

Please sign in to comment.