mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Update fmt lib, add recast, wip on recast pathfinder interface (broken atm)
This commit is contained in:
+405
-132
@@ -8,7 +8,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
|
||||
<title>API Reference — fmt 3.0.0 documentation</title>
|
||||
<title>API Reference — fmt 4.0.0 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/basic.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
@@ -17,10 +17,11 @@
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: './',
|
||||
VERSION: '3.0.0',
|
||||
VERSION: '4.0.0',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: ''
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
@@ -35,8 +36,9 @@
|
||||
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();
|
||||
a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;
|
||||
a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', 'UA-20116650-4', 'fmtlib.net');
|
||||
ga('send', 'pageview');
|
||||
@@ -50,7 +52,8 @@
|
||||
<div class="navbar-content">
|
||||
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<button type="button" class="navbar-toggle collapsed"
|
||||
data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
@@ -63,13 +66,17 @@
|
||||
<div class="collapse navbar-collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="dropdown">
|
||||
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
|
||||
aria-expanded="false">3.0.0 <span class="caret"></span></a>
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"
|
||||
role="button" aria-expanded="false">4.0.0
|
||||
<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="http://fmtlib.net/2.0.0/">2.0.0</a></li>
|
||||
<li><a href="http://fmtlib.net/1.1.0/">1.1.0</a></li>
|
||||
<li><a href="http://fmtlib.net/1.0.0/">1.0.0</a></li>
|
||||
|
||||
<li><a href="http://fmtlib.net/3.0.0">3.0.0</a></li>
|
||||
|
||||
<li><a href="http://fmtlib.net/2.0.0">2.0.0</a></li>
|
||||
|
||||
<li><a href="http://fmtlib.net/1.1.0">1.1.0</a></li>
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -82,7 +89,8 @@
|
||||
|
||||
|
||||
|
||||
<li class="active"><a href="api.html">API <span class="sr-only">(current)</span></a></li>
|
||||
<li class="active"><a href="api.html">API
|
||||
<span class="sr-only">(current)</span></a></li>
|
||||
|
||||
|
||||
|
||||
@@ -92,9 +100,11 @@
|
||||
</ul>
|
||||
|
||||
|
||||
<form class="navbar-form navbar-right" role="search" action="search.html" method="get">
|
||||
<form class="navbar-form navbar-right" role="search" action="search.html"
|
||||
method="get">
|
||||
<div class="form-group">
|
||||
<input type="text" name="q" class="form-control" placeholder="Search" >
|
||||
<input type="text" name="q" class="form-control"
|
||||
placeholder="Search" >
|
||||
</div>
|
||||
<input type="hidden" name="check_keywords" value="yes" />
|
||||
<input type="hidden" name="area" value="default" />
|
||||
@@ -122,13 +132,16 @@ in namespace <code class="docutils literal"><span class="pre">fmt</span></code>
|
||||
namespace is usually omitted in examples.</p>
|
||||
<div class="section" id="format-api">
|
||||
<h2>Format API<a class="headerlink" href="#format-api" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The following functions use <a class="reference internal" href="syntax.html#syntax"><span class="std std-ref">format string syntax</span></a> similar
|
||||
to the one used by Python’s <a class="reference external" href="http://docs.python.org/3/library/stdtypes.html#str.format">str.format</a> function.
|
||||
<p>The following functions defined in <code class="docutils literal"><span class="pre">fmt/format.h</span></code> use <a class="reference internal" href="syntax.html#syntax"><span class="std std-ref">format string
|
||||
syntax</span></a> similar to the one used by Python’s <a class="reference external" href="http://docs.python.org/3/library/stdtypes.html#str.format">str.format</a> function.
|
||||
They take <em>format_str</em> and <em>args</em> as arguments.</p>
|
||||
<p><em>format_str</em> is a format string that contains literal text and replacement
|
||||
fields surrounded by braces <code class="docutils literal"><span class="pre">{}</span></code>. The fields are replaced with formatted
|
||||
arguments in the resulting string.</p>
|
||||
<p><em>args</em> is an argument list representing arbitrary arguments.</p>
|
||||
<p>The <a class="reference external" href="https://github.com/fmtlib/fmt/blob/master/README.rst#speed-tests">performance of the format API</a> is close
|
||||
to that of glibc’s <code class="docutils literal"><span class="pre">printf</span></code> and better than the performance of IOStreams.
|
||||
For even better speed use the <a class="reference internal" href="#write-api">write API</a>.</p>
|
||||
<span class="target" id="format"></span><dl class="function">
|
||||
<dt id="_CPPv2N3fmt6formatE10CStringRef7ArgList">
|
||||
<span id="fmt::format__CStringRef.ArgList"></span><span class="target" id="formatformat_8h_1a638f25c535b3bfa12dc1478b11885b6f"></span>std::string <code class="descclassname">fmt::</code><code class="descname">format</code><span class="sig-paren">(</span>CStringRef <em>format_str</em>, <a class="reference internal" href="#_CPPv2N3fmt7ArgListE" title="fmt::ArgList">ArgList</a> <em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt6formatE10CStringRef7ArgList" title="Permalink to this definition">¶</a></dt>
|
||||
@@ -140,18 +153,10 @@ arguments in the resulting string.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt8literalsli7_formatEPKcNSt6size_tE">
|
||||
<span class="target" id="formatformat_8h_1a8f568cdac4d075838347616fc4899417"></span>internal::UdlFormat<char> <code class="descclassname">fmt::literals::</code><code class="descname">operator""_format</code><span class="sig-paren">(</span><em class="property">const</em> char *<em>s</em>, std::size_t<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt8literalsli7_formatEPKcNSt6size_tE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>C++11 literal equivalent of <a class="reference internal" href="#_CPPv2N3fmt6formatE10CStringRef7ArgList" title="fmt::format"><code class="xref cpp cpp-func docutils literal"><span class="pre">fmt::format()</span></code></a>.</p>
|
||||
<p><strong>Example</strong>:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">using</span> <span class="k">namespace</span> <span class="n">fmt</span><span class="o">::</span><span class="n">literals</span><span class="p">;</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">message</span> <span class="o">=</span> <span class="s">"The answer is {}"</span><span class="n">_format</span><span class="p">(</span><span class="mi">42</span><span class="p">);</span>
|
||||
</pre></div>
|
||||
<div class="admonition warning">
|
||||
<p class="first admonition-title">Warning</p>
|
||||
<p class="last">doxygenfunction: Cannot find function “operator”“_format” in doxygen xml output for project “format” from directory: /home/foonathan/Programming/fmt/build/doc/doxyxml</p>
|
||||
</div>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<span class="target" id="print"></span><dl class="function">
|
||||
<dt id="_CPPv2N3fmt5printE10CStringRef7ArgList">
|
||||
<span id="fmt::print__CStringRef.ArgList"></span><span class="target" id="formatformat_8h_1a7cfad68e64995774f11072aaf5008e8a"></span>void <code class="descclassname">fmt::</code><code class="descname">print</code><span class="sig-paren">(</span>CStringRef <em>format_str</em>, <a class="reference internal" href="#_CPPv2N3fmt7ArgListE" title="fmt::ArgList">ArgList</a> <em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt5printE10CStringRef7ArgList" title="Permalink to this definition">¶</a></dt>
|
||||
@@ -180,7 +185,8 @@ arguments in the resulting string.</p>
|
||||
<dt id="_CPPv2N3fmt14BasicFormatterE">
|
||||
<span id="fmt::BasicFormatter"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">BasicFormatter</code><a class="headerlink" href="#_CPPv2N3fmt14BasicFormatterE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>This template formats data and writes the output to a writer. </p>
|
||||
<div class="breathe-sectiondef container">
|
||||
<p>Inherits from fmt::internal::FormatterBase</p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Types</p>
|
||||
<dl class="type">
|
||||
<dt id="_CPPv2N3fmt14BasicFormatter4CharE">
|
||||
@@ -189,7 +195,7 @@ arguments in the resulting string.</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="breathe-sectiondef container">
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt14BasicFormatter14BasicFormatterERK7ArgListR11BasicWriterI4CharE">
|
||||
@@ -217,8 +223,8 @@ appropriate lifetimes.</p>
|
||||
|
||||
<div class="section" id="date-and-time-formatting">
|
||||
<h3>Date and time formatting<a class="headerlink" href="#date-and-time-formatting" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The library supports <a class="reference external" href="http://en.cppreference.com/w/cpp/chrono/c/strftime">strftime</a>-like
|
||||
date and time formatting:</p>
|
||||
<p>The library supports <a class="reference external" href="http://en.cppreference.com/w/cpp/chrono/c/strftime">strftime</a>-like date and time
|
||||
formatting:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf">"fmt/time.h"</span><span class="cp"></span>
|
||||
|
||||
<span class="n">std</span><span class="o">::</span><span class="kt">time_t</span> <span class="n">t</span> <span class="o">=</span> <span class="n">std</span><span class="o">::</span><span class="n">time</span><span class="p">(</span><span class="k">nullptr</span><span class="p">);</span>
|
||||
@@ -229,6 +235,32 @@ date and time formatting:</p>
|
||||
<p>The format string syntax is described in the documentation of
|
||||
<a class="reference external" href="http://en.cppreference.com/w/cpp/chrono/c/strftime">strftime</a>.</p>
|
||||
</div>
|
||||
<div class="section" id="formatting-user-defined-types">
|
||||
<h3>Formatting user-defined types<a class="headerlink" href="#formatting-user-defined-types" title="Permalink to this headline">¶</a></h3>
|
||||
<p>A custom <code class="docutils literal"><span class="pre">format_arg</span></code> function may be implemented and used to format any
|
||||
user-defined type. That is how date and time formatting described in the
|
||||
previous section is implemented in <code class="file docutils literal"><span class="pre">fmt/time.h</span></code>. The following example
|
||||
shows how to implement custom formatting for a user-defined structure.</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">struct</span> <span class="n">MyStruct</span> <span class="p">{</span> <span class="kt">double</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">;</span> <span class="p">};</span>
|
||||
|
||||
<span class="kt">void</span> <span class="nf">format_arg</span><span class="p">(</span><span class="n">fmt</span><span class="o">::</span><span class="n">BasicFormatter</span><span class="o"><</span><span class="kt">char</span><span class="o">></span> <span class="o">&</span><span class="n">f</span><span class="p">,</span>
|
||||
<span class="k">const</span> <span class="kt">char</span> <span class="o">*&</span><span class="n">format_str</span><span class="p">,</span> <span class="k">const</span> <span class="n">MyStruct</span> <span class="o">&</span><span class="n">s</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">f</span><span class="p">.</span><span class="n">writer</span><span class="p">().</span><span class="n">write</span><span class="p">(</span><span class="s">"[MyStruct: a={:.1f}, b={:.2f}]"</span><span class="p">,</span> <span class="n">s</span><span class="p">.</span><span class="n">a</span><span class="p">,</span> <span class="n">s</span><span class="p">.</span><span class="n">b</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
|
||||
<span class="n">MyStruct</span> <span class="n">m</span> <span class="o">=</span> <span class="p">{</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span> <span class="p">};</span>
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">s</span> <span class="o">=</span> <span class="n">fmt</span><span class="o">::</span><span class="n">format</span><span class="p">(</span><span class="s">"m={}"</span><span class="p">,</span> <span class="n">n</span><span class="p">);</span>
|
||||
<span class="c1">// s == "m=[MyStruct: a=1.0, b=2.00]"</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Note in the example above the <code class="docutils literal"><span class="pre">format_arg</span></code> function ignores the contents of
|
||||
<code class="docutils literal"><span class="pre">format_str</span></code> so the type will always be formatted as specified. See
|
||||
<code class="docutils literal"><span class="pre">format_arg</span></code> in <code class="file docutils literal"><span class="pre">fmt/time.h</span></code> for an advanced example of how to use
|
||||
the <code class="docutils literal"><span class="pre">format_str</span></code> argument to customize the formatted output.</p>
|
||||
<p>This section shows how to define a custom format function for a user-defined
|
||||
type. The next section describes how to get <code class="docutils literal"><span class="pre">fmt</span></code> to use a conventional stream
|
||||
output <code class="docutils literal"><span class="pre">operator<<</span></code> when one is defined for a user-defined type.</p>
|
||||
</div>
|
||||
<div class="section" id="std-ostream-support">
|
||||
<h3><code class="docutils literal"><span class="pre">std::ostream</span></code> support<a class="headerlink" href="#std-ostream-support" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The header <code class="docutils literal"><span class="pre">fmt/ostream.h</span></code> provides <code class="docutils literal"><span class="pre">std::ostream</span></code> support including
|
||||
@@ -238,7 +270,7 @@ formatting of user-defined types that have overloaded <code class="docutils lite
|
||||
<span class="k">class</span> <span class="nc">Date</span> <span class="p">{</span>
|
||||
<span class="kt">int</span> <span class="n">year_</span><span class="p">,</span> <span class="n">month_</span><span class="p">,</span> <span class="n">day_</span><span class="p">;</span>
|
||||
<span class="k">public</span><span class="o">:</span>
|
||||
<span class="n">Date</span><span class="p">(</span><span class="kt">int</span> <span class="n">year</span><span class="p">,</span> <span class="kt">int</span> <span class="n">month</span><span class="p">,</span> <span class="kt">int</span> <span class="n">day</span><span class="p">)</span> <span class="o">:</span> <span class="n">year_</span><span class="p">(</span><span class="n">year</span><span class="p">),</span> <span class="n">month_</span><span class="p">(</span><span class="n">month</span><span class="p">),</span> <span class="n">day_</span><span class="p">(</span><span class="n">day</span><span class="p">)</span> <span class="p">{}</span>
|
||||
<span class="n">Date</span><span class="p">(</span><span class="kt">int</span> <span class="n">year</span><span class="p">,</span> <span class="kt">int</span> <span class="n">month</span><span class="p">,</span> <span class="kt">int</span> <span class="n">day</span><span class="p">)</span><span class="o">:</span> <span class="n">year_</span><span class="p">(</span><span class="n">year</span><span class="p">),</span> <span class="n">month_</span><span class="p">(</span><span class="n">month</span><span class="p">),</span> <span class="n">day_</span><span class="p">(</span><span class="n">day</span><span class="p">)</span> <span class="p">{}</span>
|
||||
|
||||
<span class="k">friend</span> <span class="n">std</span><span class="o">::</span><span class="n">ostream</span> <span class="o">&</span><span class="k">operator</span><span class="o"><<</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">ostream</span> <span class="o">&</span><span class="n">os</span><span class="p">,</span> <span class="k">const</span> <span class="n">Date</span> <span class="o">&</span><span class="n">d</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="k">return</span> <span class="n">os</span> <span class="o"><<</span> <span class="n">d</span><span class="p">.</span><span class="n">year_</span> <span class="o"><<</span> <span class="sc">'-'</span> <span class="o"><<</span> <span class="n">d</span><span class="p">.</span><span class="n">month_</span> <span class="o"><<</span> <span class="sc">'-'</span> <span class="o"><<</span> <span class="n">d</span><span class="p">.</span><span class="n">day_</span><span class="p">;</span>
|
||||
@@ -260,17 +292,6 @@ formatting of user-defined types that have overloaded <code class="docutils lite
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt7fprintfERNSt7ostreamE10CStringRef7ArgList">
|
||||
<span id="fmt::fprintf__osR.CStringRef.ArgList"></span><span class="target" id="formatostream_8h_1adf9e00e4ddf5cad224a101333cfac9e8"></span>int <code class="descclassname">fmt::</code><code class="descname">fprintf</code><span class="sig-paren">(</span>std::ostream &<em>os</em>, CStringRef <em>format_str</em>, <a class="reference internal" href="#_CPPv2N3fmt7ArgListE" title="fmt::ArgList">ArgList</a> <em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt7fprintfERNSt7ostreamE10CStringRef7ArgList" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Prints formatted data to the stream <em>os</em>.</p>
|
||||
<p><strong>Example</strong>:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">fprintf</span><span class="p">(</span><span class="n">cerr</span><span class="p">,</span> <span class="s">"Don't %s!"</span><span class="p">,</span> <span class="s">"panic"</span><span class="p">);</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="argument-formatters">
|
||||
<h3>Argument formatters<a class="headerlink" href="#argument-formatters" title="Permalink to this headline">¶</a></h3>
|
||||
@@ -279,7 +300,7 @@ custom argument formatter class:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="c1">// A custom argument formatter that formats negative integers as unsigned</span>
|
||||
<span class="c1">// with the ``x`` format specifier.</span>
|
||||
<span class="k">class</span> <span class="nc">CustomArgFormatter</span> <span class="o">:</span>
|
||||
<span class="k">public</span> <span class="n">fmt</span><span class="o">::</span><span class="n">BasicArgFormatter</span><span class="o"><</span><span class="n">CustomArgFormatter</span><span class="p">,</span> <span class="kt">char</span><span class="o">></span> <span class="p">{</span>
|
||||
<span class="k">public</span> <span class="n">fmt</span><span class="o">::</span><span class="n">BasicArgFormatter</span><span class="o"><</span><span class="n">CustomArgFormatter</span><span class="p">,</span> <span class="kt">char</span><span class="o">></span> <span class="p">{</span>
|
||||
<span class="k">public</span><span class="o">:</span>
|
||||
<span class="n">CustomArgFormatter</span><span class="p">(</span><span class="n">fmt</span><span class="o">::</span><span class="n">BasicFormatter</span><span class="o"><</span><span class="kt">char</span><span class="p">,</span> <span class="n">CustomArgFormatter</span><span class="o">></span> <span class="o">&</span><span class="n">f</span><span class="p">,</span>
|
||||
<span class="n">fmt</span><span class="o">::</span><span class="n">FormatSpec</span> <span class="o">&</span><span class="n">s</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">fmt</span><span class="p">)</span>
|
||||
@@ -329,7 +350,7 @@ then a corresponding method of <a class="reference internal" href="#_CPPv2N3fmt1
|
||||
</pre></div>
|
||||
</div>
|
||||
</p>
|
||||
<div class="breathe-sectiondef container">
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt10ArgVisitor9visit_intEi">
|
||||
@@ -440,7 +461,7 @@ called.</p>
|
||||
|
||||
<dl class="class">
|
||||
<dt>
|
||||
<span class="target" id="formatclassfmt_1_1_basic_arg_formatter"></span><em class="property">template </em><typename <em>Impl</em>, typename <em>Char</em>></dt>
|
||||
<span class="target" id="formatclassfmt_1_1_basic_arg_formatter"></span><em class="property">template </em><typename <em>Impl</em>, typename <em>Char</em>, typename <em>Spec</em> = fmt::FormatSpec></dt>
|
||||
<dt id="_CPPv2N3fmt17BasicArgFormatterE">
|
||||
<span id="fmt::BasicArgFormatter"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">BasicArgFormatter</code><a class="headerlink" href="#_CPPv2N3fmt17BasicArgFormatterE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>An argument formatter based on the <a class="reference external" href="http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern">curiously recurring template pattern</a>.</p>
|
||||
@@ -455,11 +476,12 @@ will be called. If the subclass doesn’t contain a method with this signatu
|
||||
then a corresponding method of <a class="reference internal" href="#_CPPv2N3fmt17BasicArgFormatterE" title="fmt::BasicArgFormatter"><code class="xref cpp cpp-any docutils literal"><span class="pre">BasicArgFormatter</span></code></a> or its superclass
|
||||
will be called.</p>
|
||||
</p>
|
||||
<div class="breathe-sectiondef container">
|
||||
<p>Inherits from fmt::internal::ArgFormatterBase< Impl, Char, Spec ></p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt17BasicArgFormatter17BasicArgFormatterER14BasicFormatterI4Char4ImplER10FormatSpecPK4Char">
|
||||
<span id="fmt::BasicArgFormatter::BasicArgFormatter__BasicFormatter:Char.Impl:R.FormatSpecR.CharCP"></span><span class="target" id="formatclassfmt_1_1_basic_arg_formatter_1a207b17b258c5e16cf61ebfc9b13211d3"></span><code class="descname">BasicArgFormatter</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N3fmt14BasicFormatterE" title="fmt::BasicFormatter">BasicFormatter</a><Char, Impl> &<em>formatter</em>, FormatSpec &<em>spec</em>, <em class="property">const</em> Char *<em>fmt</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt17BasicArgFormatter17BasicArgFormatterER14BasicFormatterI4Char4ImplER10FormatSpecPK4Char" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="_CPPv2N3fmt17BasicArgFormatter17BasicArgFormatterER14BasicFormatterI4Char4ImplER4SpecPK4Char">
|
||||
<span id="fmt::BasicArgFormatter::BasicArgFormatter__BasicFormatter:Char.Impl:R.SpecR.CharCP"></span><span class="target" id="formatclassfmt_1_1_basic_arg_formatter_1a9fbfaaf573b6714ed03894326b0a5106"></span><code class="descname">BasicArgFormatter</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N3fmt14BasicFormatterE" title="fmt::BasicFormatter">BasicFormatter</a><Char, Impl> &<em>formatter</em>, Spec &<em>spec</em>, <em class="property">const</em> Char *<em>fmt</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt17BasicArgFormatter17BasicArgFormatterER14BasicFormatterI4Char4ImplER4SpecPK4Char" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Constructs an argument formatter object.
|
||||
<em>formatter</em> is a reference to the main formatter object, <em>spec</em> contains
|
||||
format specifier information for standard argument types, and <em>fmt</em> points
|
||||
@@ -469,8 +491,8 @@ to the part of the format string being parsed for custom argument types.</p>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt17BasicArgFormatter12visit_customEN8internal3Arg11CustomValueE">
|
||||
<span id="fmt::BasicArgFormatter::visit_custom__internal::Arg::CustomValue"></span><span class="target" id="formatclassfmt_1_1_basic_arg_formatter_1ae0aab0f90c9c93e3513203fc84c2c4dc"></span>void <code class="descname">visit_custom</code><span class="sig-paren">(</span>internal::Arg::CustomValue <em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt17BasicArgFormatter12visit_customEN8internal3Arg11CustomValueE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Formats argument of a custom (user-defined) type. </p>
|
||||
<span id="fmt::BasicArgFormatter::visit_custom__internal::Arg::CustomValue"></span><span class="target" id="formatclassfmt_1_1_basic_arg_formatter_1acc822e8efaa99b664deaf38b08950b88"></span>void <code class="descname">visit_custom</code><span class="sig-paren">(</span>internal::Arg::CustomValue <em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt17BasicArgFormatter12visit_customEN8internal3Arg11CustomValueE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Formats an argument of a custom (user-defined) type. </p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
@@ -482,7 +504,8 @@ to the part of the format string being parsed for custom argument types.</p>
|
||||
<dt id="_CPPv2N3fmt12ArgFormatterE">
|
||||
<span id="fmt::ArgFormatter"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">ArgFormatter</code><a class="headerlink" href="#_CPPv2N3fmt12ArgFormatterE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>The default argument formatter. </p>
|
||||
<div class="breathe-sectiondef container">
|
||||
<p>Inherits from <a class="reference internal" href="#formatclassfmt_1_1_basic_arg_formatter"><span class="std std-ref">fmt::BasicArgFormatter< ArgFormatter< Char >, Char, FormatSpec ></span></a></p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt12ArgFormatter12ArgFormatterER14BasicFormatterI4CharER10FormatSpecPK4Char">
|
||||
@@ -494,13 +517,16 @@ to the part of the format string being parsed for custom argument types.</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="section" id="printf-formatting-functions">
|
||||
<h3>Printf formatting functions<a class="headerlink" href="#printf-formatting-functions" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The following functions use <a class="reference external" href="http://pubs.opengroup.org/onlinepubs/009695399/functions/fprintf.html">printf format string syntax</a> with
|
||||
a POSIX extension for positional arguments.</p>
|
||||
<div class="section" id="printf-formatting">
|
||||
<h3>Printf formatting<a class="headerlink" href="#printf-formatting" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The header <code class="docutils literal"><span class="pre">fmt/printf.h</span></code> provides <code class="docutils literal"><span class="pre">printf</span></code>-like formatting functionality.
|
||||
The following functions use <a class="reference external" href="http://pubs.opengroup.org/onlinepubs/009695399/functions/fprintf.html">printf format string syntax</a> with
|
||||
the POSIX extension for positional arguments. Unlike their standard
|
||||
counterparts, the <code class="docutils literal"><span class="pre">fmt</span></code> functions are type-safe and throw an exception if an
|
||||
argument type doesn’t match its format specification.</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt6printfE10CStringRef7ArgList">
|
||||
<span id="fmt::printf__CStringRef.ArgList"></span><span class="target" id="formatformat_8h_1aa936ffccf89f4609cd9fce18825f0b14"></span>int <code class="descclassname">fmt::</code><code class="descname">printf</code><span class="sig-paren">(</span>CStringRef <em>format</em>, <a class="reference internal" href="#_CPPv2N3fmt7ArgListE" title="fmt::ArgList">ArgList</a> <em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt6printfE10CStringRef7ArgList" title="Permalink to this definition">¶</a></dt>
|
||||
<span id="fmt::printf__CStringRef.ArgList"></span><span class="target" id="formatprintf_8h_1aa936ffccf89f4609cd9fce18825f0b14"></span>int <code class="descclassname">fmt::</code><code class="descname">printf</code><span class="sig-paren">(</span>CStringRef <em>format</em>, <a class="reference internal" href="#_CPPv2N3fmt7ArgListE" title="fmt::ArgList">ArgList</a> <em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt6printfE10CStringRef7ArgList" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Prints formatted data to <code class="docutils literal"><span class="pre">stdout</span></code>.</p>
|
||||
<p><strong>Example</strong>:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">fmt</span><span class="o">::</span><span class="n">printf</span><span class="p">(</span><span class="s">"Elapsed time: %.2f seconds"</span><span class="p">,</span> <span class="mf">1.23</span><span class="p">);</span>
|
||||
@@ -511,7 +537,7 @@ a POSIX extension for positional arguments.</p>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt7fprintfEPNSt4FILEE10CStringRef7ArgList">
|
||||
<span id="fmt::fprintf__std::FILEP.CStringRef.ArgList"></span><span class="target" id="formatformat_8h_1ae70c0a9615eef5e1e78450496d2a90e6"></span>int <code class="descclassname">fmt::</code><code class="descname">fprintf</code><span class="sig-paren">(</span>std::FILE *<em>f</em>, CStringRef <em>format</em>, <a class="reference internal" href="#_CPPv2N3fmt7ArgListE" title="fmt::ArgList">ArgList</a> <em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt7fprintfEPNSt4FILEE10CStringRef7ArgList" title="Permalink to this definition">¶</a></dt>
|
||||
<span id="fmt::fprintf__std::FILEP.CStringRef.ArgList"></span><span class="target" id="formatprintf_8h_1ae70c0a9615eef5e1e78450496d2a90e6"></span>int <code class="descclassname">fmt::</code><code class="descname">fprintf</code><span class="sig-paren">(</span>std::FILE *<em>f</em>, CStringRef <em>format</em>, <a class="reference internal" href="#_CPPv2N3fmt7ArgListE" title="fmt::ArgList">ArgList</a> <em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt7fprintfEPNSt4FILEE10CStringRef7ArgList" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Prints formatted data to the file <em>f</em>.</p>
|
||||
<p><strong>Example</strong>:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">fmt</span><span class="o">::</span><span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"Don't %s!"</span><span class="p">,</span> <span class="s">"panic"</span><span class="p">);</span>
|
||||
@@ -520,9 +546,20 @@ a POSIX extension for positional arguments.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt7fprintfERNSt7ostreamE10CStringRef7ArgList">
|
||||
<span id="fmt::fprintf__osR.CStringRef.ArgList"></span><span class="target" id="formatprintf_8h_1adf9e00e4ddf5cad224a101333cfac9e8"></span>int <code class="descclassname">fmt::</code><code class="descname">fprintf</code><span class="sig-paren">(</span>std::ostream &<em>os</em>, CStringRef <em>format_str</em>, <a class="reference internal" href="#_CPPv2N3fmt7ArgListE" title="fmt::ArgList">ArgList</a> <em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt7fprintfERNSt7ostreamE10CStringRef7ArgList" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Prints formatted data to the stream <em>os</em>.</p>
|
||||
<p><strong>Example</strong>:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">fprintf</span><span class="p">(</span><span class="n">cerr</span><span class="p">,</span> <span class="s">"Don't %s!"</span><span class="p">,</span> <span class="s">"panic"</span><span class="p">);</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt7sprintfE10CStringRef7ArgList">
|
||||
<span id="fmt::sprintf__CStringRef.ArgList"></span><span class="target" id="formatformat_8h_1a956d655d1291fb85203c58fadd4bba1a"></span>std::string <code class="descclassname">fmt::</code><code class="descname">sprintf</code><span class="sig-paren">(</span>CStringRef <em>format</em>, <a class="reference internal" href="#_CPPv2N3fmt7ArgListE" title="fmt::ArgList">ArgList</a> <em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt7sprintfE10CStringRef7ArgList" title="Permalink to this definition">¶</a></dt>
|
||||
<span id="fmt::sprintf__CStringRef.ArgList"></span><span class="target" id="formatprintf_8h_1a956d655d1291fb85203c58fadd4bba1a"></span>std::string <code class="descclassname">fmt::</code><code class="descname">sprintf</code><span class="sig-paren">(</span>CStringRef <em>format</em>, <a class="reference internal" href="#_CPPv2N3fmt7ArgListE" title="fmt::ArgList">ArgList</a> <em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt7sprintfE10CStringRef7ArgList" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Formats arguments and returns the result as a string.</p>
|
||||
<p><strong>Example</strong>:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">message</span> <span class="o">=</span> <span class="n">fmt</span><span class="o">::</span><span class="n">sprintf</span><span class="p">(</span><span class="s">"The answer is %d"</span><span class="p">,</span> <span class="mi">42</span><span class="p">);</span>
|
||||
@@ -531,10 +568,124 @@ a POSIX extension for positional arguments.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt>
|
||||
<span class="target" id="formatclassfmt_1_1_printf_formatter"></span><em class="property">template </em><typename <em>Char</em>, typename <em>ArgFormatter</em> = <a class="reference internal" href="#formatclassfmt_1_1_printf_arg_formatter"><span class="std std-ref">PrintfArgFormatter</span></a><Char>></dt>
|
||||
<dt id="_CPPv2N3fmt15PrintfFormatterE">
|
||||
<span id="fmt::PrintfFormatter"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">PrintfFormatter</code><a class="headerlink" href="#_CPPv2N3fmt15PrintfFormatterE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>This template formats data and writes the output to a writer. </p>
|
||||
<p>Inherits from fmt::internal::FormatterBase</p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt15PrintfFormatter15PrintfFormatterERK7ArgListR11BasicWriterI4CharE">
|
||||
<span id="fmt::PrintfFormatter::PrintfFormatter__ArgListCR.BasicWriter:Char:R"></span><span class="target" id="formatclassfmt_1_1_printf_formatter_1a9cb3cad9a8e4cd08445e9ff2338d40b0"></span><code class="descname">PrintfFormatter</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N3fmt7ArgListE" title="fmt::ArgList">ArgList</a> &<em>al</em>, <a class="reference internal" href="#_CPPv2N3fmt11BasicWriterE" title="fmt::BasicWriter">BasicWriter</a><Char> &<em>w</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt15PrintfFormatter15PrintfFormatterERK7ArgListR11BasicWriterI4CharE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Constructs a <code class="docutils literal"><span class="pre">PrintfFormatter</span></code> object. References to the arguments and
|
||||
the writer are stored in the formatter object so make sure they have
|
||||
appropriate lifetimes.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt15PrintfFormatter6formatE15BasicCStringRefI4CharE">
|
||||
<span id="fmt::PrintfFormatter::format__BasicCStringRef:Char:"></span><span class="target" id="formatclassfmt_1_1_printf_formatter_1a295c50e11b9a77720c8078f287040e5c"></span>void <code class="descname">format</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N3fmt15BasicCStringRefE" title="fmt::BasicCStringRef">BasicCStringRef</a><Char> <em>format_str</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt15PrintfFormatter6formatE15BasicCStringRefI4CharE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Formats stored arguments and writes the output to the writer. </p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt>
|
||||
<span class="target" id="formatclassfmt_1_1_basic_printf_arg_formatter"></span><em class="property">template </em><typename <em>Impl</em>, typename <em>Char</em>, typename <em>Spec</em>></dt>
|
||||
<dt id="_CPPv2N3fmt23BasicPrintfArgFormatterE">
|
||||
<span id="fmt::BasicPrintfArgFormatter"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">BasicPrintfArgFormatter</code><a class="headerlink" href="#_CPPv2N3fmt23BasicPrintfArgFormatterE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>A <code class="docutils literal"><span class="pre">printf</span></code> argument formatter based on the <a class="reference external" href="http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern">curiously recurring template
|
||||
pattern</a>.</p>
|
||||
<p>To use <a class="reference internal" href="#_CPPv2N3fmt23BasicPrintfArgFormatterE" title="fmt::BasicPrintfArgFormatter"><code class="xref cpp cpp-any docutils literal"><span class="pre">BasicPrintfArgFormatter</span></code></a> define a subclass that implements some
|
||||
or all of the visit methods with the same signatures as the methods in
|
||||
<a class="reference internal" href="#_CPPv2N3fmt10ArgVisitorE" title="fmt::ArgVisitor"><code class="xref cpp cpp-any docutils literal"><span class="pre">ArgVisitor</span></code></a>, for example, <a class="reference internal" href="#_CPPv2N3fmt10ArgVisitor9visit_intEi" title="fmt::ArgVisitor::visit_int"><code class="xref cpp cpp-any docutils literal"><span class="pre">visit_int()</span></code></a>.
|
||||
Pass the subclass as the <em>Impl</em> template parameter. When a formatting
|
||||
function processes an argument, it will dispatch to a visit method
|
||||
specific to the argument type. For example, if the argument type is
|
||||
<code class="docutils literal"><span class="pre">double</span></code> then the <a class="reference internal" href="#_CPPv2N3fmt10ArgVisitor12visit_doubleEd" title="fmt::ArgVisitor::visit_double"><code class="xref cpp cpp-any docutils literal"><span class="pre">visit_double()</span></code></a> method of a subclass
|
||||
will be called. If the subclass doesn’t contain a method with this signature,
|
||||
then a corresponding method of <a class="reference internal" href="#_CPPv2N3fmt23BasicPrintfArgFormatterE" title="fmt::BasicPrintfArgFormatter"><code class="xref cpp cpp-any docutils literal"><span class="pre">BasicPrintfArgFormatter</span></code></a> or its
|
||||
superclass will be called.</p>
|
||||
</p>
|
||||
<p>Inherits from fmt::internal::ArgFormatterBase< Impl, Char, Spec ></p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt23BasicPrintfArgFormatter23BasicPrintfArgFormatterER11BasicWriterI4CharER4Spec">
|
||||
<span id="fmt::BasicPrintfArgFormatter::BasicPrintfArgFormatter__BasicWriter:Char:R.SpecR"></span><span class="target" id="formatclassfmt_1_1_basic_printf_arg_formatter_1a7027cf03f0a54f8d7e53563e948d9f54"></span><code class="descname">BasicPrintfArgFormatter</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N3fmt11BasicWriterE" title="fmt::BasicWriter">BasicWriter</a><Char> &<em>w</em>, Spec &<em>s</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt23BasicPrintfArgFormatter23BasicPrintfArgFormatterER11BasicWriterI4CharER4Spec" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Constructs an argument formatter object.
|
||||
<em>writer</em> is a reference to the output writer and <em>spec</em> contains format
|
||||
specifier information for standard argument types.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt23BasicPrintfArgFormatter10visit_boolEb">
|
||||
<span id="fmt::BasicPrintfArgFormatter::visit_bool__b"></span><span class="target" id="formatclassfmt_1_1_basic_printf_arg_formatter_1a5a8896e3b7e60b678ad7ac1145d2d7db"></span>void <code class="descname">visit_bool</code><span class="sig-paren">(</span>bool <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt23BasicPrintfArgFormatter10visit_boolEb" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Formats an argument of type <code class="docutils literal"><span class="pre">bool</span></code>. </p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt23BasicPrintfArgFormatter10visit_charEi">
|
||||
<span id="fmt::BasicPrintfArgFormatter::visit_char__i"></span><span class="target" id="formatclassfmt_1_1_basic_printf_arg_formatter_1a6d6a9710fe756a8682efa6e83eea8146"></span>void <code class="descname">visit_char</code><span class="sig-paren">(</span>int <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt23BasicPrintfArgFormatter10visit_charEi" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Formats a character. </p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt23BasicPrintfArgFormatter13visit_cstringEPKc">
|
||||
<span id="fmt::BasicPrintfArgFormatter::visit_cstring__cCP"></span><span class="target" id="formatclassfmt_1_1_basic_printf_arg_formatter_1a202e5093c8d7ab388c05f58956e8f721"></span>void <code class="descname">visit_cstring</code><span class="sig-paren">(</span><em class="property">const</em> char *<em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt23BasicPrintfArgFormatter13visit_cstringEPKc" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Formats a null-terminated C string. </p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt23BasicPrintfArgFormatter13visit_pointerEPKv">
|
||||
<span id="fmt::BasicPrintfArgFormatter::visit_pointer__voidCP"></span><span class="target" id="formatclassfmt_1_1_basic_printf_arg_formatter_1a4184ac39a994f38d4b4850393e413a1c"></span>void <code class="descname">visit_pointer</code><span class="sig-paren">(</span><em class="property">const</em> void *<em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt23BasicPrintfArgFormatter13visit_pointerEPKv" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Formats a pointer. </p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt23BasicPrintfArgFormatter12visit_customEN8internal3Arg11CustomValueE">
|
||||
<span id="fmt::BasicPrintfArgFormatter::visit_custom__internal::Arg::CustomValue"></span><span class="target" id="formatclassfmt_1_1_basic_printf_arg_formatter_1a5ad1e99dfd69b88a6b7940c1bfc52d23"></span>void <code class="descname">visit_custom</code><span class="sig-paren">(</span>internal::Arg::CustomValue <em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt23BasicPrintfArgFormatter12visit_customEN8internal3Arg11CustomValueE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Formats an argument of a custom (user-defined) type. </p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt>
|
||||
<span class="target" id="formatclassfmt_1_1_printf_arg_formatter"></span><em class="property">template </em><<em class="property">typename</em> Char></dt>
|
||||
<dt id="_CPPv2N3fmt18PrintfArgFormatterE">
|
||||
<span id="fmt::PrintfArgFormatter"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">PrintfArgFormatter</code><a class="headerlink" href="#_CPPv2N3fmt18PrintfArgFormatterE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>The default printf argument formatter. </p>
|
||||
<p>Inherits from <a class="reference internal" href="#formatclassfmt_1_1_basic_printf_arg_formatter"><span class="std std-ref">fmt::BasicPrintfArgFormatter< PrintfArgFormatter< Char >, Char, FormatSpec ></span></a></p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt18PrintfArgFormatter18PrintfArgFormatterER11BasicWriterI4CharER10FormatSpec">
|
||||
<span id="fmt::PrintfArgFormatter::PrintfArgFormatter__BasicWriter:Char:R.FormatSpecR"></span><span class="target" id="formatclassfmt_1_1_printf_arg_formatter_1aa4b9526d3c614205d607f63918c33245"></span><code class="descname">PrintfArgFormatter</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N3fmt11BasicWriterE" title="fmt::BasicWriter">BasicWriter</a><Char> &<em>w</em>, FormatSpec &<em>s</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt18PrintfArgFormatter18PrintfArgFormatterER11BasicWriterI4CharER10FormatSpec" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Constructs an argument formatter object. </p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="write-api">
|
||||
<h2>Write API<a class="headerlink" href="#write-api" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The write API provides classes for writing formatted data into character
|
||||
streams. It is usually faster than the <a class="reference internal" href="#format-api">format API</a> but, as IOStreams,
|
||||
may result in larger compiled code size. The main writer class is
|
||||
<a class="reference internal" href="#_CPPv2N3fmt17BasicMemoryWriterE" title="fmt::BasicMemoryWriter"><code class="xref cpp cpp-any docutils literal"><span class="pre">BasicMemoryWriter</span></code></a> which stores its output in a memory buffer and
|
||||
provides direct access to it. It is possible to create custom writers that
|
||||
store output elsewhere by subclassing <a class="reference internal" href="#_CPPv2N3fmt11BasicWriterE" title="fmt::BasicWriter"><code class="xref cpp cpp-any docutils literal"><span class="pre">BasicWriter</span></code></a>.</p>
|
||||
<dl class="class">
|
||||
<dt>
|
||||
<span class="target" id="formatclassfmt_1_1_basic_writer"></span><em class="property">template </em><typename <em>Char</em>></dt>
|
||||
@@ -564,37 +715,38 @@ such as <a class="reference internal" href="#_CPPv2N3fmt17BasicMemoryWriterE" ti
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<div class="breathe-sectiondef container">
|
||||
<p>Subclassed by <a class="reference internal" href="#formatclassfmt_1_1_basic_array_writer"><span class="std std-ref">fmt::BasicArrayWriter< Char ></span></a>, <a class="reference internal" href="#formatclassfmt_1_1_basic_memory_writer"><span class="std std-ref">fmt::BasicMemoryWriter< Char, Allocator ></span></a>, <a class="reference internal" href="#formatclassfmt_1_1_basic_string_writer"><span class="std std-ref">fmt::BasicStringWriter< Char, Allocator ></span></a></p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt11BasicWriterD0Ev">
|
||||
<span id="fmt::BasicWriter::~BasicWriter"></span>virtual <span class="target" id="formatclassfmt_1_1_basic_writer_1a25f6fc2e43d3bcfb3de9ac33afe6050d"></span><code class="descname">~BasicWriter</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt11BasicWriterD0Ev" title="Permalink to this definition">¶</a></dt>
|
||||
<span id="fmt::BasicWriter::~BasicWriter"></span><span class="target" id="formatclassfmt_1_1_basic_writer_1a25f6fc2e43d3bcfb3de9ac33afe6050d"></span><em class="property">virtual</em> <code class="descname">~BasicWriter</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt11BasicWriterD0Ev" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Destroys a <code class="docutils literal"><span class="pre">BasicWriter</span></code> object.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt11BasicWriter4sizeEv">
|
||||
<span id="fmt::BasicWriter::size"></span><span class="target" id="formatclassfmt_1_1_basic_writer_1a1b6721b4ba4d3fa18ac781a36616cc2a"></span>std::size_t <code class="descname">size</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N3fmt11BasicWriter4sizeEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="_CPPv2NK3fmt11BasicWriter4sizeEv">
|
||||
<span id="fmt::BasicWriter::sizeC"></span><span class="target" id="formatclassfmt_1_1_basic_writer_1a8d4534eea273ef4a3dd9078b995d3d15"></span>std::size_t <code class="descname">size</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK3fmt11BasicWriter4sizeEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the total number of characters written. </p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt11BasicWriter4dataEv">
|
||||
<span id="fmt::BasicWriter::data"></span><span class="target" id="formatclassfmt_1_1_basic_writer_1a6f3f431fab4a937cd6844a5bda609391"></span><em class="property">const</em> Char *<code class="descname">data</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N3fmt11BasicWriter4dataEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="_CPPv2NK3fmt11BasicWriter4dataEv">
|
||||
<span id="fmt::BasicWriter::dataC"></span><span class="target" id="formatclassfmt_1_1_basic_writer_1a06ada257ca9ae580212d6fe0147fe2cc"></span><em class="property">const</em> Char *<code class="descname">data</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK3fmt11BasicWriter4dataEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a pointer to the output buffer content. </p>
|
||||
<p>No terminating null character is appended. </p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt11BasicWriter5c_strEv">
|
||||
<span id="fmt::BasicWriter::c_str"></span><span class="target" id="formatclassfmt_1_1_basic_writer_1a8b68001f5c1c0ea851ddaef27dcbc691"></span><em class="property">const</em> Char *<code class="descname">c_str</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N3fmt11BasicWriter5c_strEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="_CPPv2NK3fmt11BasicWriter5c_strEv">
|
||||
<span id="fmt::BasicWriter::c_strC"></span><span class="target" id="formatclassfmt_1_1_basic_writer_1ab608044b16c838ed394cfe937e2ed8b9"></span><em class="property">const</em> Char *<code class="descname">c_str</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK3fmt11BasicWriter5c_strEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a pointer to the output buffer content with terminating null character appended. </p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt11BasicWriter3strEv">
|
||||
<span id="fmt::BasicWriter::str"></span><span class="target" id="formatclassfmt_1_1_basic_writer_1a91f06ced6e063ee77a99740e0e79faf6"></span>std::basic_string<Char> <code class="descname">str</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N3fmt11BasicWriter3strEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="_CPPv2NK3fmt11BasicWriter3strEv">
|
||||
<span id="fmt::BasicWriter::strC"></span><span class="target" id="formatclassfmt_1_1_basic_writer_1aac8dbeddff3d4e268d17a4f9c16264f6"></span>std::basic_string<Char> <code class="descname">str</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK3fmt11BasicWriter3strEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Returns the content of the output buffer as an <code class="xref cpp cpp-any docutils literal"><span class="pre">std::string</span></code>.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
@@ -695,11 +847,12 @@ and the standard allocator:</p>
|
||||
<p>The output can be converted to an <code class="docutils literal"><span class="pre">std::string</span></code> with <code class="docutils literal"><span class="pre">out.str()</span></code> or
|
||||
accessed as a C string with <code class="docutils literal"><span class="pre">out.c_str()</span></code>.</p>
|
||||
</p>
|
||||
<div class="breathe-sectiondef container">
|
||||
<p>Inherits from <a class="reference internal" href="#formatclassfmt_1_1_basic_writer"><span class="std std-ref">fmt::BasicWriter< Char ></span></a></p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt17BasicMemoryWriter17BasicMemoryWriterERR17BasicMemoryWriter">
|
||||
<span id="fmt::BasicMemoryWriter::BasicMemoryWriter__BasicMemoryWriterRR"></span><span class="target" id="formatclassfmt_1_1_basic_memory_writer_1a245047763a93566d0a7c1f90e8901672"></span><code class="descname">BasicMemoryWriter</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N3fmt17BasicMemoryWriterE" title="fmt::BasicMemoryWriter">BasicMemoryWriter</a> &&<em>other</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt17BasicMemoryWriter17BasicMemoryWriterERR17BasicMemoryWriter" title="Permalink to this definition">¶</a></dt>
|
||||
<span id="fmt::BasicMemoryWriter::BasicMemoryWriter__BasicMemoryWriterRR"></span><span class="target" id="formatclassfmt_1_1_basic_memory_writer_1a245047763a93566d0a7c1f90e8901672"></span><code class="descname">BasicMemoryWriter</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N3fmt17BasicMemoryWriter17BasicMemoryWriterERR17BasicMemoryWriter" title="fmt::BasicMemoryWriter::BasicMemoryWriter">BasicMemoryWriter</a> &&<em>other</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt17BasicMemoryWriter17BasicMemoryWriterERR17BasicMemoryWriter" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Constructs a <a class="reference internal" href="#_CPPv2N3fmt17BasicMemoryWriterE" title="fmt::BasicMemoryWriter"><code class="xref cpp cpp-class docutils literal"><span class="pre">fmt::BasicMemoryWriter</span></code></a> object moving the content
|
||||
of the other object to it.</p>
|
||||
</p>
|
||||
@@ -746,7 +899,8 @@ into the array.</p>
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
<div class="breathe-sectiondef container">
|
||||
<p>Inherits from <a class="reference internal" href="#formatclassfmt_1_1_basic_writer"><span class="std std-ref">fmt::BasicWriter< Char ></span></a></p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt16BasicArrayWriter16BasicArrayWriterEP4CharNSt6size_tE">
|
||||
@@ -769,27 +923,118 @@ size known at compile time.</p>
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt>
|
||||
<span class="target" id="formatclassfmt_1_1_basic_string_writer"></span><em class="property">template </em><<em class="property">typename</em> Char, <em class="property">typename</em> Allocator = std::allocator<Char>></dt>
|
||||
<dt id="_CPPv2N3fmt17BasicStringWriterE">
|
||||
<span id="fmt::BasicStringWriter"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">BasicStringWriter</code><a class="headerlink" href="#_CPPv2N3fmt17BasicStringWriterE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>This class template provides operations for formatting and writing data
|
||||
into a character stream. The output is stored in a <code class="docutils literal"><span class="pre">std::basic_string</span></code>
|
||||
that grows dynamically.</p>
|
||||
<p>You can use one of the following typedefs for common character types
|
||||
and the standard allocator:</p>
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
<col width="35%" />
|
||||
<col width="65%" />
|
||||
</colgroup>
|
||||
<thead valign="bottom">
|
||||
<tr class="row-odd"><th class="head">Type</th>
|
||||
<th class="head">Definition</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody valign="top">
|
||||
<tr class="row-even"><td>StringWriter</td>
|
||||
<td>BasicStringWriter<char></td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td>WStringWriter</td>
|
||||
<td>BasicStringWriter<wchar_t></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><strong>Example</strong>:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">StringWriter</span> <span class="n">out</span><span class="p">;</span>
|
||||
<span class="n">out</span> <span class="o"><<</span> <span class="s">"The answer is "</span> <span class="o"><<</span> <span class="mi">42</span> <span class="o"><<</span> <span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">;</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>This will write the following output to the <code class="docutils literal"><span class="pre">out</span></code> object:</p>
|
||||
<div class="highlight-none"><div class="highlight"><pre><span></span>The answer is 42
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The output can be moved to a <code class="docutils literal"><span class="pre">std::basic_string</span></code> with <code class="docutils literal"><span class="pre">out.move_to()</span></code>.</p>
|
||||
</p>
|
||||
<p>Inherits from <a class="reference internal" href="#formatclassfmt_1_1_basic_writer"><span class="std std-ref">fmt::BasicWriter< Char ></span></a></p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt17BasicStringWriter17BasicStringWriterERK9Allocator">
|
||||
<span id="fmt::BasicStringWriter::BasicStringWriter__AllocatorCR"></span><span class="target" id="formatclassfmt_1_1_basic_string_writer_1a39e60f775feda49e58964a9c540831fc"></span><code class="descname">BasicStringWriter</code><span class="sig-paren">(</span><em class="property">const</em> Allocator &<em>allocator</em> = Allocator()<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt17BasicStringWriter17BasicStringWriterERK9Allocator" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Constructs a <a class="reference internal" href="#_CPPv2N3fmt17BasicStringWriterE" title="fmt::BasicStringWriter"><code class="xref cpp cpp-class docutils literal"><span class="pre">fmt::BasicStringWriter</span></code></a> object.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt17BasicStringWriter7move_toERNSt12basic_stringI4CharNSt11char_traitsI4CharEE9AllocatorEE">
|
||||
<span id="fmt::BasicStringWriter::move_to__std::basic_string:Char.std::char_traits:Char:.Allocator:R"></span><span class="target" id="formatclassfmt_1_1_basic_string_writer_1af5eb54db9a51ef610d55ecb858257fb0"></span>void <code class="descname">move_to</code><span class="sig-paren">(</span>std::basic_string<Char, std::char_traits<Char>, Allocator> &<em>str</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt17BasicStringWriter7move_toERNSt12basic_stringI4CharNSt11char_traitsI4CharEE9AllocatorEE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Moves the buffer content to <em>str</em> clearing the buffer.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt>
|
||||
<span class="target" id="formatclassfmt_1_1_basic_container_writer"></span><em class="property">template </em><<em class="property">class</em> Container></dt>
|
||||
<dt id="_CPPv2N3fmt20BasicContainerWriterE">
|
||||
<span id="fmt::BasicContainerWriter"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">BasicContainerWriter</code><a class="headerlink" href="#_CPPv2N3fmt20BasicContainerWriterE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>This class template provides operations for formatting and appending data
|
||||
to a standard <em>container</em> like <code class="docutils literal"><span class="pre">std::vector</span></code> or <code class="docutils literal"><span class="pre">std::basic_string</span></code>.</p>
|
||||
<p><strong>Example</strong>:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">vecformat</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="kt">char</span><span class="o">>&</span> <span class="n">dest</span><span class="p">,</span> <span class="n">fmt</span><span class="o">::</span><span class="n">BasicCStringRef</span><span class="o"><</span><span class="kt">char</span><span class="o">></span> <span class="n">format</span><span class="p">,</span>
|
||||
<span class="n">fmt</span><span class="o">::</span><span class="n">ArgList</span> <span class="n">args</span><span class="p">)</span> <span class="p">{</span>
|
||||
<span class="n">fmt</span><span class="o">::</span><span class="n">BasicContainerWriter</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="kt">char</span><span class="o">></span> <span class="o">></span> <span class="n">appender</span><span class="p">(</span><span class="n">dest</span><span class="p">);</span>
|
||||
<span class="n">appender</span><span class="p">.</span><span class="n">write</span><span class="p">(</span><span class="n">format</span><span class="p">,</span> <span class="n">args</span><span class="p">);</span>
|
||||
<span class="p">}</span>
|
||||
<span class="n">FMT_VARIADIC</span><span class="p">(</span><span class="kt">void</span><span class="p">,</span> <span class="n">vecformat</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="kt">char</span><span class="o">>&</span><span class="p">,</span>
|
||||
<span class="n">fmt</span><span class="o">::</span><span class="n">BasicCStringRef</span><span class="o"><</span><span class="kt">char</span><span class="o">></span><span class="p">);</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</p>
|
||||
<p>Inherits from <a class="reference internal" href="#formatclassfmt_1_1_basic_writer"><span class="std std-ref">fmt::BasicWriter< Container::value_type ></span></a></p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt20BasicContainerWriter20BasicContainerWriterER9Container">
|
||||
<span id="fmt::BasicContainerWriter::BasicContainerWriter__ContainerR"></span><span class="target" id="formatclassfmt_1_1_basic_container_writer_1a1c5f521af91a36bf07d580d3b5e8fde4"></span><code class="descname">BasicContainerWriter</code><span class="sig-paren">(</span>Container &<em>dest</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt20BasicContainerWriter20BasicContainerWriterER9Container" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Constructs a <a class="reference internal" href="#_CPPv2N3fmt20BasicContainerWriterE" title="fmt::BasicContainerWriter"><code class="xref cpp cpp-class docutils literal"><span class="pre">fmt::BasicContainerWriter</span></code></a> object.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt3binEi">
|
||||
<span id="fmt::bin__i"></span><span class="target" id="formatformat_8h_1aa3e8966d52b70224d46861fabd090e4b"></span>IntFormatSpec<int, TypeSpec<'b'>> <code class="descclassname">fmt::</code><code class="descname">bin</code><span class="sig-paren">(</span>int <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt3binEi" title="Permalink to this definition">¶</a></dt>
|
||||
<span id="fmt::bin__i"></span><span class="target" id="formatformat_8h_1a760fce6f0963895343b50eec787f80db"></span>IntFormatSpec<int, TypeSpec<'b'>> <code class="descclassname">fmt::</code><code class="descname">bin</code><span class="sig-paren">(</span>int <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt3binEi" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns an integer format specifier to format the value in base 2. </p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt3octEi">
|
||||
<span id="fmt::oct__i"></span><span class="target" id="formatformat_8h_1a1d166c5b2242a6a0aefba5455c32a2b3"></span>IntFormatSpec<int, TypeSpec<'o'>> <code class="descclassname">fmt::</code><code class="descname">oct</code><span class="sig-paren">(</span>int <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt3octEi" title="Permalink to this definition">¶</a></dt>
|
||||
<span id="fmt::oct__i"></span><span class="target" id="formatformat_8h_1a49d07603108a758be5cc6157f456e32d"></span>IntFormatSpec<int, TypeSpec<'o'>> <code class="descclassname">fmt::</code><code class="descname">oct</code><span class="sig-paren">(</span>int <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt3octEi" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns an integer format specifier to format the value in base 8. </p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt3hexEi">
|
||||
<span id="fmt::hex__i"></span><span class="target" id="formatformat_8h_1aaa926c5c42fbad5f5c98aaad84b9f66a"></span>IntFormatSpec<int, TypeSpec<'x'>> <code class="descclassname">fmt::</code><code class="descname">hex</code><span class="sig-paren">(</span>int <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt3hexEi" title="Permalink to this definition">¶</a></dt>
|
||||
<span id="fmt::hex__i"></span><span class="target" id="formatformat_8h_1a8451bad40c90c2ce2aa1a932851cf090"></span>IntFormatSpec<int, TypeSpec<'x'>> <code class="descclassname">fmt::</code><code class="descname">hex</code><span class="sig-paren">(</span>int <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt3hexEi" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns an integer format specifier to format the value in base 16 using lower-case letters for the digits above 9. </p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt4hexuEi">
|
||||
<span id="fmt::hexu__i"></span><span class="target" id="formatformat_8h_1ac2fd8f73cfcd1321dfb6fb0302f23f66"></span>IntFormatSpec<int, TypeSpec<'X'>> <code class="descclassname">fmt::</code><code class="descname">hexu</code><span class="sig-paren">(</span>int <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt4hexuEi" title="Permalink to this definition">¶</a></dt>
|
||||
<span id="fmt::hexu__i"></span><span class="target" id="formatformat_8h_1ae08e783a599e0667dae7b5a63a265de4"></span>IntFormatSpec<int, TypeSpec<'X'>> <code class="descclassname">fmt::</code><code class="descname">hexu</code><span class="sig-paren">(</span>int <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt4hexuEi" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns an integer formatter format specifier to format in base 16 using upper-case letters for the digits above 9. </p>
|
||||
</dd></dl>
|
||||
|
||||
@@ -797,7 +1042,7 @@ size known at compile time.</p>
|
||||
<dt>
|
||||
<em class="property">template </em><char <em>TYPE_CODE</em>, <em class="property">typename</em> Char></dt>
|
||||
<dt id="_CPPv2N3fmt3padEij4Char">
|
||||
<span id="fmt::pad__i.unsigned.Char"></span><span class="target" id="formatformat_8h_1a48d6010061d1710d807853ad9125d825"></span>IntFormatSpec<int, AlignTypeSpec<TYPE_CODE>, Char> <code class="descclassname">fmt::</code><code class="descname">pad</code><span class="sig-paren">(</span>int <em>value</em>, unsigned <em>width</em>, Char <em>fill</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt3padEij4Char" title="Permalink to this definition">¶</a></dt>
|
||||
<span id="fmt::pad__i.unsigned.Char"></span><span class="target" id="formatformat_8h_1aa6ebb90e2adc57f2c942e226fd708b24"></span>IntFormatSpec<int, AlignTypeSpec<TYPE_CODE>, Char> <code class="descclassname">fmt::</code><code class="descname">pad</code><span class="sig-paren">(</span>int <em>value</em>, unsigned <em>width</em>, Char <em>fill</em> = ' '<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt3padEij4Char" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Returns an integer format specifier to pad the formatted argument with the
|
||||
fill character to the specified width using the default (right) numeric
|
||||
alignment.</p>
|
||||
@@ -817,7 +1062,7 @@ alignment.</p>
|
||||
<dt>
|
||||
<em class="property">template </em><<em class="property">typename</em> T></dt>
|
||||
<dt id="_CPPv2N3fmt3argE9StringRefRK1T">
|
||||
<span id="fmt::arg__StringRef.TCR"></span><span class="target" id="formatformat_8h_1a4649a895b3f769fe24b268e39a8cf152"></span>internal::NamedArg<char> <code class="descclassname">fmt::</code><code class="descname">arg</code><span class="sig-paren">(</span>StringRef <em>name</em>, <em class="property">const</em> T &<em>arg</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt3argE9StringRefRK1T" title="Permalink to this definition">¶</a></dt>
|
||||
<span id="fmt::arg__StringRef.TCR"></span><span class="target" id="formatformat_8h_1a3ccc93714460459602dc6fc2b055ee6b"></span>internal::NamedArgWithType<char, T> <code class="descclassname">fmt::</code><code class="descname">arg</code><span class="sig-paren">(</span>StringRef <em>name</em>, <em class="property">const</em> T &<em>arg</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt3argE9StringRefRK1T" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Returns a named argument for formatting functions.</p>
|
||||
<p><strong>Example</strong>:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">print</span><span class="p">(</span><span class="s">"Elapsed time: {s:.2f} seconds"</span><span class="p">,</span> <span class="n">arg</span><span class="p">(</span><span class="s">"s"</span><span class="p">,</span> <span class="mf">1.23</span><span class="p">));</span>
|
||||
@@ -826,18 +1071,10 @@ alignment.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt8literalsli2_aEPKcNSt6size_tE">
|
||||
<span class="target" id="formatformat_8h_1a1f0ec67406a0e4937166e6481f481198"></span>internal::UdlArg<char> <code class="descclassname">fmt::literals::</code><code class="descname">operator""_a</code><span class="sig-paren">(</span><em class="property">const</em> char *<em>s</em>, std::size_t<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt8literalsli2_aEPKcNSt6size_tE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>C++11 literal equivalent of <a class="reference internal" href="#_CPPv2N3fmt3argE9StringRefRK1T" title="fmt::arg"><code class="xref cpp cpp-func docutils literal"><span class="pre">fmt::arg()</span></code></a>.</p>
|
||||
<p><strong>Example</strong>:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">using</span> <span class="k">namespace</span> <span class="n">fmt</span><span class="o">::</span><span class="n">literals</span><span class="p">;</span>
|
||||
<span class="n">print</span><span class="p">(</span><span class="s">"Elapsed time: {s:.2f} seconds"</span><span class="p">,</span> <span class="s">"s"</span><span class="n">_a</span><span class="o">=</span><span class="mf">1.23</span><span class="p">);</span>
|
||||
</pre></div>
|
||||
<div class="admonition warning">
|
||||
<p class="first admonition-title">Warning</p>
|
||||
<p class="last">doxygenfunction: Cannot find function “operator”“_a” in doxygen xml output for project “format” from directory: /home/foonathan/Programming/fmt/build/doc/doxyxml</p>
|
||||
</div>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="macro">
|
||||
<dt id="c.FMT_CAPTURE">
|
||||
<span class="target" id="formatformat_8h_1a3caa326fabdddb0e4fbcad7e5ec8bd37"></span><code class="descname">FMT_CAPTURE</code><span class="sig-paren">(</span>...<span class="sig-paren">)</span><a class="headerlink" href="#c.FMT_CAPTURE" title="Permalink to this definition">¶</a></dt>
|
||||
@@ -886,23 +1123,39 @@ directly:</p>
|
||||
<dt id="_CPPv2N3fmt7ArgListE">
|
||||
<span id="fmt::ArgList"></span><span class="target" id="formatclassfmt_1_1_arg_list"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">ArgList</code><a class="headerlink" href="#_CPPv2N3fmt7ArgListE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>An argument list. </p>
|
||||
<div class="breathe-sectiondef container">
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt7ArgListixEj">
|
||||
<span id="fmt::ArgList::subscript-operator__unsigned"></span><span class="target" id="formatclassfmt_1_1_arg_list_1ad2c2672388e003aa70d9c948ac8140cd"></span>internal::Arg <code class="descname">operator[]</code><span class="sig-paren">(</span>unsigned <em>index</em><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N3fmt7ArgListixEj" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="_CPPv2NK3fmt7ArgListixEj">
|
||||
<span id="fmt::ArgList::subscript-operator__unsignedC"></span><span class="target" id="formatclassfmt_1_1_arg_list_1a9a717b2022170c8f2918141a80cc6eb2"></span>internal::Arg <code class="descname">operator[]</code><span class="sig-paren">(</span>unsigned <em>index</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK3fmt7ArgListixEj" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the argument at specified index. </p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt>
|
||||
<em class="property">template </em><<em class="property">typename</em> T></dt>
|
||||
<dt id="_CPPv2N3fmt9to_stringERK1T">
|
||||
<span id="fmt::to_string__TCR"></span><span class="target" id="formatstring_8h_1abfd84051cd3673d750be5851ee93b05f"></span>std::string <code class="descclassname">fmt::</code><code class="descname">to_string</code><span class="sig-paren">(</span><em class="property">const</em> T &<em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt9to_stringERK1T" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Converts <em>value</em> to <code class="docutils literal"><span class="pre">std::string</span></code> using the default format for type <em>T</em>.</p>
|
||||
<p><strong>Example</strong>:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf">"fmt/string.h"</span><span class="cp"></span>
|
||||
|
||||
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">answer</span> <span class="o">=</span> <span class="n">fmt</span><span class="o">::</span><span class="n">to_string</span><span class="p">(</span><span class="mi">42</span><span class="p">);</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt>
|
||||
<span class="target" id="formatclassfmt_1_1_basic_string_ref"></span><em class="property">template </em><typename <em>Char</em>></dt>
|
||||
<dt id="_CPPv2N3fmt14BasicStringRefE">
|
||||
<span id="fmt::BasicStringRef"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">BasicStringRef</code><a class="headerlink" href="#_CPPv2N3fmt14BasicStringRefE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>A string reference. It can be constructed from a C string or <code class="docutils literal"><span class="pre">std::string</span></code>.</p>
|
||||
<dd><p><p>A string reference. It can be constructed from a C string or
|
||||
<code class="docutils literal"><span class="pre">std::basic_string</span></code>.</p>
|
||||
<p>You can use one of the following typedefs for common character types:</p>
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
@@ -933,7 +1186,7 @@ different types of strings to a function, for example:</p>
|
||||
</pre></div>
|
||||
</div>
|
||||
</p>
|
||||
<div class="breathe-sectiondef container">
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt14BasicStringRef14BasicStringRefEPK4CharNSt6size_tE">
|
||||
@@ -950,28 +1203,30 @@ the size with <code class="docutils literal"><span class="pre">std::char_traits&
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt14BasicStringRef14BasicStringRefERKNSt12basic_stringI4CharEE">
|
||||
<span id="fmt::BasicStringRef::BasicStringRef__std::basic_string:Char:CR"></span><span class="target" id="formatclassfmt_1_1_basic_string_ref_1afd8ffd0c6d2ccac657f277a4faea3889"></span><code class="descname">BasicStringRef</code><span class="sig-paren">(</span><em class="property">const</em> std::basic_string<Char> &<em>s</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt14BasicStringRef14BasicStringRefERKNSt12basic_stringI4CharEE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Constructs a string reference from an <code class="docutils literal"><span class="pre">std::string</span></code> object.</p>
|
||||
<dt>
|
||||
<em class="property">template </em><<em class="property">typename</em> Allocator></dt>
|
||||
<dt id="_CPPv2N3fmt14BasicStringRef14BasicStringRefERKNSt12basic_stringI4CharNSt11char_traitsI4CharEE9AllocatorEE">
|
||||
<span id="fmt::BasicStringRef::BasicStringRef__std::basic_string:Char.std::char_traits:Char:.Allocator:CR"></span><span class="target" id="formatclassfmt_1_1_basic_string_ref_1a7c4c0c3bfc4768d7cb657f5756549863"></span><code class="descname">BasicStringRef</code><span class="sig-paren">(</span><em class="property">const</em> std::basic_string<Char, std::char_traits<Char>, Allocator> &<em>s</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt14BasicStringRef14BasicStringRefERKNSt12basic_stringI4CharNSt11char_traitsI4CharEE9AllocatorEE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Constructs a string reference from a <code class="docutils literal"><span class="pre">std::basic_string</span></code> object.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt14BasicStringRef9to_stringEv">
|
||||
<span id="fmt::BasicStringRef::to_string"></span><span class="target" id="formatclassfmt_1_1_basic_string_ref_1a7340f48f53cf9188e9fea5e6e1556969"></span>std::basic_string<Char> <code class="descname">to_string</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N3fmt14BasicStringRef9to_stringEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="_CPPv2NK3fmt14BasicStringRef9to_stringEv">
|
||||
<span id="fmt::BasicStringRef::to_stringC"></span><span class="target" id="formatclassfmt_1_1_basic_string_ref_1a85503c30cd35cd6deff9e77da52857e6"></span>std::basic_string<Char> <code class="descname">to_string</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK3fmt14BasicStringRef9to_stringEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Converts a string reference to an <code class="docutils literal"><span class="pre">std::string</span></code> object.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt14BasicStringRef4dataEv">
|
||||
<span id="fmt::BasicStringRef::data"></span><span class="target" id="formatclassfmt_1_1_basic_string_ref_1ae9c80502c527437215fe1c11dca8b475"></span><em class="property">const</em> Char *<code class="descname">data</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N3fmt14BasicStringRef4dataEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="_CPPv2NK3fmt14BasicStringRef4dataEv">
|
||||
<span id="fmt::BasicStringRef::dataC"></span><span class="target" id="formatclassfmt_1_1_basic_string_ref_1aeca62faae1111525b0ef2667e75187f7"></span><em class="property">const</em> Char *<code class="descname">data</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK3fmt14BasicStringRef4dataEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns a pointer to the string data. </p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt14BasicStringRef4sizeEv">
|
||||
<span id="fmt::BasicStringRef::size"></span><span class="target" id="formatclassfmt_1_1_basic_string_ref_1ae38d9106dd5bec69488e5464aedc266a"></span>std::size_t <code class="descname">size</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N3fmt14BasicStringRef4sizeEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="_CPPv2NK3fmt14BasicStringRef4sizeEv">
|
||||
<span id="fmt::BasicStringRef::sizeC"></span><span class="target" id="formatclassfmt_1_1_basic_string_ref_1a765ddcb00e0a0a880a4a9458f9e68ea0"></span>std::size_t <code class="descname">size</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK3fmt14BasicStringRef4sizeEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the string size. </p>
|
||||
</dd></dl>
|
||||
|
||||
@@ -984,7 +1239,7 @@ the size with <code class="docutils literal"><span class="pre">std::char_traits&
|
||||
<dt id="_CPPv2N3fmt15BasicCStringRefE">
|
||||
<span id="fmt::BasicCStringRef"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">BasicCStringRef</code><a class="headerlink" href="#_CPPv2N3fmt15BasicCStringRefE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>A reference to a null terminated string. It can be constructed from a C
|
||||
string or <code class="docutils literal"><span class="pre">std::string</span></code>.</p>
|
||||
string or <code class="docutils literal"><span class="pre">std::basic_string</span></code>.</p>
|
||||
<p>You can use one of the following typedefs for common character types:</p>
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
@@ -1015,7 +1270,7 @@ different types of strings to a function, for example:</p>
|
||||
</pre></div>
|
||||
</div>
|
||||
</p>
|
||||
<div class="breathe-sectiondef container">
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt15BasicCStringRef15BasicCStringRefEPK4Char">
|
||||
@@ -1024,15 +1279,17 @@ different types of strings to a function, for example:</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt15BasicCStringRef15BasicCStringRefERKNSt12basic_stringI4CharEE">
|
||||
<span id="fmt::BasicCStringRef::BasicCStringRef__std::basic_string:Char:CR"></span><span class="target" id="formatclassfmt_1_1_basic_c_string_ref_1ab460855d19c769773de532296f9f13f9"></span><code class="descname">BasicCStringRef</code><span class="sig-paren">(</span><em class="property">const</em> std::basic_string<Char> &<em>s</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt15BasicCStringRef15BasicCStringRefERKNSt12basic_stringI4CharEE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Constructs a string reference from an <code class="docutils literal"><span class="pre">std::string</span></code> object.</p>
|
||||
<dt>
|
||||
<em class="property">template </em><<em class="property">typename</em> Allocator></dt>
|
||||
<dt id="_CPPv2N3fmt15BasicCStringRef15BasicCStringRefERKNSt12basic_stringI4CharNSt11char_traitsI4CharEE9AllocatorEE">
|
||||
<span id="fmt::BasicCStringRef::BasicCStringRef__std::basic_string:Char.std::char_traits:Char:.Allocator:CR"></span><span class="target" id="formatclassfmt_1_1_basic_c_string_ref_1aa7caaa44a192e0184031d60c2a71bd12"></span><code class="descname">BasicCStringRef</code><span class="sig-paren">(</span><em class="property">const</em> std::basic_string<Char, std::char_traits<Char>, Allocator> &<em>s</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt15BasicCStringRef15BasicCStringRefERKNSt12basic_stringI4CharNSt11char_traitsI4CharEE9AllocatorEE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Constructs a string reference from a <code class="docutils literal"><span class="pre">std::basic_string</span></code> object.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt15BasicCStringRef5c_strEv">
|
||||
<span id="fmt::BasicCStringRef::c_str"></span><span class="target" id="formatclassfmt_1_1_basic_c_string_ref_1ae3bafa845b53339b20c4f5edb4f635f9"></span><em class="property">const</em> Char *<code class="descname">c_str</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N3fmt15BasicCStringRef5c_strEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="_CPPv2NK3fmt15BasicCStringRef5c_strEv">
|
||||
<span id="fmt::BasicCStringRef::c_strC"></span><span class="target" id="formatclassfmt_1_1_basic_c_string_ref_1ac1064b18371a8762e3d89395d253d436"></span><em class="property">const</em> Char *<code class="descname">c_str</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK3fmt15BasicCStringRef5c_strEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the pointer to a C string. </p>
|
||||
</dd></dl>
|
||||
|
||||
@@ -1046,17 +1303,18 @@ different types of strings to a function, for example:</p>
|
||||
<span id="fmt::Buffer"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">Buffer</code><a class="headerlink" href="#_CPPv2N3fmt6BufferE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>A buffer supporting a subset of <code class="docutils literal"><span class="pre">std::vector</span></code>‘s operations.</p>
|
||||
</p>
|
||||
<div class="breathe-sectiondef container">
|
||||
<p>Subclassed by fmt::internal::MemoryBuffer< T, SIZE, Allocator ></p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt6Buffer4sizeEv">
|
||||
<span id="fmt::Buffer::size"></span><span class="target" id="formatclassfmt_1_1_buffer_1a14fa72f0ddf584c14ffffb1446f598aa"></span>std::size_t <code class="descname">size</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N3fmt6Buffer4sizeEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="_CPPv2NK3fmt6Buffer4sizeEv">
|
||||
<span id="fmt::Buffer::sizeC"></span><span class="target" id="formatclassfmt_1_1_buffer_1a2489cffd9cdc6f846cdf17988d52f785"></span>std::size_t <code class="descname">size</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK3fmt6Buffer4sizeEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the size of this buffer. </p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt6Buffer8capacityEv">
|
||||
<span id="fmt::Buffer::capacity"></span><span class="target" id="formatclassfmt_1_1_buffer_1aaf54fe786de91157629f96380e0cb215"></span>std::size_t <code class="descname">capacity</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N3fmt6Buffer8capacityEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dt id="_CPPv2NK3fmt6Buffer8capacityEv">
|
||||
<span id="fmt::Buffer::capacityC"></span><span class="target" id="formatclassfmt_1_1_buffer_1af38a0b9f1afac4901f24a73207f72e6f"></span>std::size_t <code class="descname">capacity</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK3fmt6Buffer8capacityEv" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Returns the capacity of this buffer. </p>
|
||||
</dd></dl>
|
||||
|
||||
@@ -1083,11 +1341,11 @@ different types of strings to a function, for example:</p>
|
||||
</dd></dl>
|
||||
|
||||
</div>
|
||||
<div class="breathe-sectiondef container">
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt6Buffer4growENSt6size_tE">
|
||||
<span id="fmt::Buffer::grow__std::s"></span>virtual <span class="target" id="formatclassfmt_1_1_buffer_1abdc7aaf5813aa07008b3d715969a7e19"></span>void <code class="descname">grow</code><span class="sig-paren">(</span>std::size_t <em>size</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N3fmt6Buffer4growENSt6size_tE" title="Permalink to this definition">¶</a></dt>
|
||||
<span id="fmt::Buffer::grow__std::s"></span><span class="target" id="formatclassfmt_1_1_buffer_1abdc7aaf5813aa07008b3d715969a7e19"></span><em class="property">virtual</em> void <code class="descname">grow</code><span class="sig-paren">(</span>std::size_t <em>size</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N3fmt6Buffer4growENSt6size_tE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Increases the buffer capacity to hold at least <em>size</em> elements updating
|
||||
<code class="docutils literal"><span class="pre">ptr_</span></code> and <code class="docutils literal"><span class="pre">capacity_</span></code>.</p>
|
||||
</p>
|
||||
@@ -1103,21 +1361,17 @@ different types of strings to a function, for example:</p>
|
||||
<dt id="_CPPv2N3fmt11SystemErrorE">
|
||||
<span id="fmt::SystemError"></span><span class="target" id="formatclassfmt_1_1_system_error"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">SystemError</code><a class="headerlink" href="#_CPPv2N3fmt11SystemErrorE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>An error returned by an operating system or a language runtime, for example a file opening error. </p>
|
||||
<div class="breathe-sectiondef container">
|
||||
<p>Inherits from fmt::internal::RuntimeError</p>
|
||||
<p>Subclassed by <a class="reference internal" href="#formatclassfmt_1_1_windows_error"><span class="std std-ref">fmt::WindowsError</span></a></p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt11SystemError11SystemErrorEi10CStringRef">
|
||||
<span id="fmt::SystemError::SystemError__i.CStringRef"></span><span class="target" id="formatclassfmt_1_1_system_error_1a307c40b2542f53d7426b09319255d35c"></span><code class="descname">SystemError</code><span class="sig-paren">(</span>int <em>error_code</em>, CStringRef <em>message</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt11SystemError11SystemErrorEi10CStringRef" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Constructs a <a class="reference internal" href="#_CPPv2N3fmt11SystemErrorE" title="fmt::SystemError"><code class="xref cpp cpp-class docutils literal"><span class="pre">fmt::SystemError</span></code></a> object with the description
|
||||
of the form</p>
|
||||
<pre class="literal-block">
|
||||
<em><message></em>: <em><system-message></em>
|
||||
</pre>
|
||||
<p>where <em><message></em> is the formatted message and <em><system-message></em> is
|
||||
the system message corresponding to the error code.
|
||||
<em>error_code</em> is a system error code as given by <code class="docutils literal"><span class="pre">errno</span></code>.
|
||||
If <em>error_code</em> is not a valid error code such as -1, the system message
|
||||
may look like “Unknown error -1” and is platform-dependent.</p>
|
||||
<dd><p><p>Constructs a <a class="reference internal" href="#_CPPv2N3fmt11SystemErrorE" title="fmt::SystemError"><code class="xref cpp cpp-class docutils literal"><span class="pre">fmt::SystemError</span></code></a> object with a description
|
||||
formatted with <a class="reference internal" href="#_CPPv2N3fmt19format_system_errorERN3fmt6WriterEiN3fmt9StringRefE" title="fmt::format_system_error"><code class="xref cpp cpp-any docutils literal"><span class="pre">fmt::format_system_error()</span></code></a>. <em>message</em> and additional
|
||||
arguments passed into the constructor are formatted similarly to
|
||||
<a class="reference internal" href="#_CPPv2N3fmt6formatE10CStringRef7ArgList" title="fmt::format"><code class="xref cpp cpp-any docutils literal"><span class="pre">fmt::format()</span></code></a>.</p>
|
||||
<p><strong>Example</strong>:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="c1">// This throws a SystemError with the description</span>
|
||||
<span class="c1">// cannot open file 'madeup': No such file or directory</span>
|
||||
@@ -1134,11 +1388,29 @@ may look like “Unknown error -1” and is platform-dependent.</p>
|
||||
</div>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt19format_system_errorERN3fmt6WriterEiN3fmt9StringRefE">
|
||||
<span id="fmt::format_system_error__fmt::WriterR.i.fmt::StringRef"></span><span class="target" id="formatformat_8h_1a3933879503d45e8cce0ef1e284f98402"></span>void <code class="descclassname">fmt::</code><code class="descname">format_system_error</code><span class="sig-paren">(</span>fmt::Writer &<em>out</em>, int <em>error_code</em>, fmt::StringRef <em>message</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N3fmt19format_system_errorERN3fmt6WriterEiN3fmt9StringRefE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p><p>Formats an error returned by an operating system or a language runtime,
|
||||
for example a file opening error, and writes it to <em>out</em> in the following
|
||||
form:</p>
|
||||
<pre class="literal-block">
|
||||
<em><message></em>: <em><system-message></em>
|
||||
</pre>
|
||||
<p>where <em><message></em> is the passed message and <em><system-message></em> is
|
||||
the system message corresponding to the error code.
|
||||
<em>error_code</em> is a system error code as given by <code class="docutils literal"><span class="pre">errno</span></code>.
|
||||
If <em>error_code</em> is not a valid error code such as -1, the system message
|
||||
may look like “Unknown error -1” and is platform-dependent.</p>
|
||||
</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="class">
|
||||
<dt id="_CPPv2N3fmt12WindowsErrorE">
|
||||
<span id="fmt::WindowsError"></span><span class="target" id="formatclassfmt_1_1_windows_error"></span><em class="property">class </em><code class="descclassname">fmt::</code><code class="descname">WindowsError</code><a class="headerlink" href="#_CPPv2N3fmt12WindowsErrorE" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>A Windows error. </p>
|
||||
<div class="breathe-sectiondef container">
|
||||
<p>Inherits from <a class="reference internal" href="#formatclassfmt_1_1_system_error"><span class="std std-ref">fmt::SystemError</span></a></p>
|
||||
<div class="breathe-sectiondef docutils container">
|
||||
<p class="breathe-sectiondef-title rubric">Public Functions</p>
|
||||
<dl class="function">
|
||||
<dt id="_CPPv2N3fmt12WindowsError12WindowsErrorEi10CStringRef">
|
||||
@@ -1183,7 +1455,8 @@ A custom allocator class can be specified as a template argument to
|
||||
</div>
|
||||
<p>It is also possible to write a formatting function that uses a custom
|
||||
allocator:</p>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">basic_string</span><span class="o"><</span><span class="kt">char</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">char_traits</span><span class="o"><</span><span class="kt">char</span><span class="o">></span><span class="p">,</span> <span class="n">CustomAllocator</span><span class="o">></span> <span class="n">CustomString</span><span class="p">;</span>
|
||||
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">basic_string</span><span class="o"><</span><span class="kt">char</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">char_traits</span><span class="o"><</span><span class="kt">char</span><span class="o">></span><span class="p">,</span> <span class="n">CustomAllocator</span><span class="o">></span>
|
||||
<span class="n">CustomString</span><span class="p">;</span>
|
||||
|
||||
<span class="n">CustomString</span> <span class="nf">format</span><span class="p">(</span><span class="n">CustomAllocator</span> <span class="n">alloc</span><span class="p">,</span> <span class="n">fmt</span><span class="o">::</span><span class="n">CStringRef</span> <span class="n">format_str</span><span class="p">,</span>
|
||||
<span class="n">fmt</span><span class="o">::</span><span class="n">ArgList</span> <span class="n">args</span><span class="p">)</span> <span class="p">{</span>
|
||||
@@ -1206,7 +1479,7 @@ allocator:</p>
|
||||
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2012-2015, Victor Zverovich.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.1.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.1+.
|
||||
</div>
|
||||
|
||||
<script src="_static/bootstrap.min.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user