Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
70946519
Commit
70946519
authored
Oct 10, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to bootstrap theme
parent
76a2ea56
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
531 additions
and
505 deletions
+531
-505
doc/conf.py
doc/conf.py
+15
-2
doc/index.rst
doc/index.rst
+9
-502
doc/reference.rst
doc/reference.rst
+113
-0
doc/syntax.rst
doc/syntax.rst
+393
-0
format.h
format.h
+1
-1
No files found.
doc/conf.py
View file @
70946519
...
...
@@ -110,12 +110,25 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme
=
'sphinxdoc'
html_theme
=
'bootstrap'
html_theme_path
=
'.'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
html_theme_options
=
{
# HTML navbar class (Default: "navbar") to attach to <div>.
# For black navbar, do "navbar navbar-inverse"
#'navbar_class': "navbar navbar-inverse",
# Fix navigation bar to top of page?
# Values: "true" (default) or "false"
'navbar_fixed_top'
:
"true"
,
# Location of link to source.
# Options are "nav" (default), "footer".
'source_link_position'
:
"footer"
,
}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
...
...
doc/index.rst
View file @
70946519
This diff is collapsed.
Click to expand it.
doc/reference.rst
0 → 100644
View file @
70946519
.. highlight:: c++
.. _string-formatting-api:
*************
API Reference
*************
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 :ref:`format string syntax <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.
.. _format:
.. doxygenfunction:: fmt::format(StringRef, ArgList)
.. _print:
.. doxygenfunction:: fmt::print(StringRef, ArgList)
.. doxygenfunction:: fmt::print(std::FILE *, StringRef, ArgList)
.. doxygenfunction:: fmt::print(std::ostream &, StringRef, ArgList)
Printf formatting functions
===========================
The following functions use `printf format string syntax
<http://pubs.opengroup.org/onlinepubs/009695399/functions/fprintf.html>`_ with
a POSIX extension for positional arguments.
.. doxygenfunction:: fmt::printf(StringRef, ArgList)
.. doxygenfunction:: fmt::fprintf(std::FILE *, StringRef, ArgList)
.. doxygenfunction:: fmt::sprintf(StringRef, ArgList)
Write API
=========
.. doxygenclass:: fmt::BasicWriter
:members:
.. doxygenclass:: fmt::BasicMemoryWriter
:members:
.. doxygenfunction:: fmt::bin
.. doxygenfunction:: fmt::oct
.. doxygenfunction:: fmt::hex
.. doxygenfunction:: fmt::hexu
.. doxygenfunction:: fmt::pad(int, unsigned, Char)
Utilities
=========
.. doxygendefine:: FMT_VARIADIC
.. doxygenclass:: fmt::ArgList
:members:
.. doxygenclass:: fmt::BasicStringRef
:members:
System Errors
=============
.. doxygenclass:: fmt::SystemError
:members:
.. doxygenclass:: fmt::WindowsError
:members:
.. _formatstrings:
Custom allocators
=================
The C++ Format library supports custom dynamic memory allocators.
A custom allocator class can be specified as a template argument to
:cpp:class:`fmt::BasicMemoryWriter`::
typedef fmt::BasicMemoryWriter<char, CustomAllocator> CustomMemoryWriter;
It is also possible to write a formatting function that uses a custom
allocator::
typedef std::basic_string<char, std::char_traits<char>, CustomAllocator> CustomString;
CustomString format(CustomAllocator alloc, fmt::StringRef format_str,
fmt::ArgList args) {
CustomMemoryWriter writer(alloc);
writer.write(format_str, args);
return CustomString(writer.data(), writer.size(), alloc);
}
FMT_VARIADIC(CustomString, format, CustomAllocator, fmt::StringRef)
doc/syntax.rst
0 → 100644
View file @
70946519
This diff is collapsed.
Click to expand it.
format.h
View file @
70946519
...
...
@@ -1560,7 +1560,7 @@ class BasicWriter {
The output can be accessed using :meth:`data`, :meth:`c_str` or :meth:`str`
methods.
See also
`Format String Syntax`_
.
See also
:ref:`syntax`
.
\endrst
*/
void
write
(
BasicStringRef
<
Char
>
format
,
ArgList
args
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment