mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-20 04:38:09 +08:00
438 lines
110 KiB
HTML
438 lines
110 KiB
HTML
<!doctype html><html lang=ja dir=ltr><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="
|
|
value.hpp
|
|
#
|
|
|
|
value.hppでは、basic_valueが定義されます。
|
|
|
|
toml::basic_value
|
|
#
|
|
|
|
basic_valueは、TOMLの値を格納するクラスです。
|
|
namespace toml
|
|
{
|
|
template <class TypeConfig>
|
|
class basic_value;
|
|
|
|
// 以下はtypes.hppで定義される
|
|
// using value = basic_value<type_config>;
|
|
// using table = typename basic_value<type_config>::table_type;
|
|
// using array = typename basic_value<type_config>::array_type;
|
|
|
|
template<typename TC>
|
|
bool operator==(const basic_value<TC>&, const basic_value<TC>&);
|
|
template<typename TC>
|
|
bool operator!=(const basic_value<TC>&, const basic_value<TC>&);
|
|
template<typename TC>
|
|
bool operator< (const basic_value<TC>&, const basic_value<TC>&);
|
|
template<typename TC>
|
|
bool operator<=(const basic_value<TC>&, const basic_value<TC>&);
|
|
template<typename TC>
|
|
bool operator> (const basic_value<TC>&, const basic_value<TC>&);
|
|
template<typename TC>
|
|
bool operator>=(const basic_value<TC>&, const basic_value<TC>&);
|
|
} //toml
|
|
|
|
メンバ型
|
|
#
|
|
|
|
以下のメンバ型が定義されます。"><meta name=theme-color media="(prefers-color-scheme: light)" content="#ffffff"><meta name=theme-color media="(prefers-color-scheme: dark)" content="#343a40"><meta name=color-scheme content="light dark"><meta property="og:url" content="https://toruniina.github.io/toml11/ja/docs/reference/value/"><meta property="og:site_name" content="toml11"><meta property="og:title" content="value.hpp"><meta property="og:description" content="value.hpp # value.hppでは、basic_valueが定義されます。
|
|
toml::basic_value # basic_valueは、TOMLの値を格納するクラスです。
|
|
namespace toml { template <class TypeConfig> class basic_value; // 以下はtypes.hppで定義される // using value = basic_value<type_config>; // using table = typename basic_value<type_config>::table_type; // using array = typename basic_value<type_config>::array_type; template<typename TC> bool operator==(const basic_value<TC>&, const basic_value<TC>&); template<typename TC> bool operator!=(const basic_value<TC>&, const basic_value<TC>&); template<typename TC> bool operator< (const basic_value<TC>&, const basic_value<TC>&); template<typename TC> bool operator<=(const basic_value<TC>&, const basic_value<TC>&); template<typename TC> bool operator> (const basic_value<TC>&, const basic_value<TC>&); template<typename TC> bool operator>=(const basic_value<TC>&, const basic_value<TC>&); } //toml メンバ型 # 以下のメンバ型が定義されます。"><meta property="og:locale" content="ja"><meta property="og:type" content="article"><meta property="article:section" content="docs"><title>value.hpp | toml11</title>
|
|
<link rel=manifest href=/toml11/manifest.json><link rel=icon href=/toml11/favicon.png><link rel=canonical href=https://toruniina.github.io/toml11/ja/docs/reference/value/><link rel=alternate hreflang=en href=https://toruniina.github.io/toml11/docs/reference/value/ title=value.hpp><link rel=stylesheet href=/toml11/book.min.ddac3efe7ea4c1007ff53e5a8fd67f12517e5d2e99984d8c67a18668f7ecaa03.css integrity="sha256-3aw+/n6kwQB/9T5aj9Z/ElF+XS6ZmE2MZ6GGaPfsqgM=" crossorigin=anonymous><script defer src=/toml11/fuse.min.js></script><script defer src=/toml11/ja.search.min.13aefbf6a803b591c02d5bc9a01dfe65fe37c31e2915c91573708d38e805d86c.js integrity="sha256-E6779qgDtZHALVvJoB3+Zf43wx4pFckVc3CNOOgF2Gw=" crossorigin=anonymous></script></head><body dir=ltr><input type=checkbox class="hidden toggle" id=menu-control>
|
|
<input type=checkbox class="hidden toggle" id=toc-control><main class="container flex"><aside class=book-menu><div class=book-menu-content><nav><h2 class=book-brand><a class="flex align-center" href=/toml11/ja/><span>toml11</span></a></h2><div class="book-search hidden"><input type=text id=book-search-input placeholder=検索 aria-label=検索 maxlength=64 data-hotkeys=s/><div class="book-search-spinner hidden"></div><ul id=book-search-results></ul></div><script>document.querySelector(".book-search").classList.remove("hidden")</script><ul class=book-languages><li><input type=checkbox id=languages class=toggle>
|
|
<label for=languages class="flex justify-between"><a role=button class="flex align-center"><img src=/toml11/svg/translate.svg class=book-icon alt=Languages>
|
|
日本語</a></label><ul><li><a href=https://toruniina.github.io/toml11/docs/reference/value/>English</a></li></ul></li></ul><ul><li><a href=/toml11/ja/docs/installation/>installation</a><ul></ul></li><li><input type=checkbox id=section-b4cfb5b55e913a8d853eacf5e8fba05f class=toggle>
|
|
<label for=section-b4cfb5b55e913a8d853eacf5e8fba05f class="flex justify-between"><a href=/toml11/ja/docs/features/>features</a></label><ul><li><a href=/toml11/ja/docs/features/parsing_files/>parsing files</a></li><li><a href=/toml11/ja/docs/features/value/>getting values</a></li><li><a href=/toml11/ja/docs/features/error_message/>error message</a></li><li><a href=/toml11/ja/docs/features/serialize/>serializing values</a></li><li><a href=/toml11/ja/docs/features/configure_types/>configuring types</a></li><li><a href=/toml11/ja/docs/features/literal/>toml literal</a></li><li><a href=/toml11/ja/docs/features/toml_spec/>toml spec</a></li><li><a href=/toml11/ja/docs/features/extension/>extension</a></li></ul></li><li><input type=checkbox id=section-01b096afc5186aea96713b408b47c967 class=toggle checked>
|
|
<label for=section-01b096afc5186aea96713b408b47c967 class="flex justify-between"><a href=/toml11/ja/docs/reference/>reference</a></label><ul><li><a href=/toml11/ja/docs/reference/color/>color.hpp</a></li><li><a href=/toml11/ja/docs/reference/comments/>comments.hpp</a></li><li><a href=/toml11/ja/docs/reference/conversion/>conversion.hpp</a></li><li><a href=/toml11/ja/docs/reference/datetime/>datetime.hpp</a></li><li><a href=/toml11/ja/docs/reference/error_info/>error_info.hpp</a></li><li><a href=/toml11/ja/docs/reference/exception/>exception.hpp</a></li><li><a href=/toml11/ja/docs/reference/find/>find.hpp</a></li><li><a href=/toml11/ja/docs/reference/format/>format.hpp</a></li><li><a href=/toml11/ja/docs/reference/from/>from.hpp</a></li><li><a href=/toml11/ja/docs/reference/get/>get.hpp</a></li><li><a href=/toml11/ja/docs/reference/into/>into.hpp</a></li><li><a href=/toml11/ja/docs/reference/literal/>literal.hpp</a></li><li><a href=/toml11/ja/docs/reference/ordered_map/>ordered_map.hpp</a></li><li><a href=/toml11/ja/docs/reference/parser/>parser.hpp</a></li><li><a href=/toml11/ja/docs/reference/result/>result.hpp</a></li><li><a href=/toml11/ja/docs/reference/serializer/>serializer.hpp</a></li><li><a href=/toml11/ja/docs/reference/source_location/>source_location.hpp</a></li><li><a href=/toml11/ja/docs/reference/spec/>spec.hpp</a></li><li><a href=/toml11/ja/docs/reference/toml_fwd/>toml_fwd.hpp</a></li><li><a href=/toml11/ja/docs/reference/toml/>toml.hpp</a></li><li><a href=/toml11/ja/docs/reference/types/>types.hpp</a></li><li><a href=/toml11/ja/docs/reference/value_t/>value_t.hpp</a></li><li><a href=/toml11/ja/docs/reference/value/ class=active>value.hpp</a></li><li><a href=/toml11/ja/docs/reference/version/>version.hpp</a></li><li><a href=/toml11/ja/docs/reference/visit/>visit.hpp</a></li></ul></li><li><a href=/toml11/ja/docs/changelog/>changelog</a><ul></ul></li></ul><ul><li><a href=https://github.com/ToruNiina/toml11 target=_blank rel=noopener>GitHub</a></li></ul></nav><script>(function(){var e=document.querySelector("aside .book-menu-content");addEventListener("beforeunload",function(){localStorage.setItem("menu.scrollTop",e.scrollTop)}),e.scrollTop=localStorage.getItem("menu.scrollTop")})()</script></div></aside><div class=book-page><header class=book-header><div class="flex align-center justify-between"><label for=menu-control><img src=/toml11/svg/menu.svg class=book-icon alt=Menu>
|
|
</label><strong>value.hpp</strong>
|
|
<label for=toc-control><img src=/toml11/svg/toc.svg class=book-icon alt="Table of Contents"></label></div><aside class="hidden clearfix"><nav id=TableOfContents><ul><li><a href=#valuehpp>value.hpp</a></li><li><a href=#tomlbasic_value><code>toml::basic_value</code></a><ul><li><a href=#メンバ型>メンバ型</a></li><li><a href=#メンバ関数>メンバ関数</a><ul><li><a href=#デフォルトコンストラクタ>デフォルトコンストラクタ</a></li><li><a href=#コピームーブコンストラクタ>コピー・ムーブコンストラクタ</a></li><li><a href=#コピームーブコンストラクタコメント指定>コピー・ムーブコンストラクタ(コメント指定)</a></li><li><a href=#変換コンストラクタ>変換コンストラクタ</a></li><li><a href=#コンストラクタ-boolean>コンストラクタ (boolean)</a></li><li><a href=#コンストラクタ-integer>コンストラクタ (integer)</a></li><li><a href=#コンストラクタfloating>コンストラクタ(floating)</a></li><li><a href=#コンストラクタstring>コンストラクタ(string)</a></li><li><a href=#コンストラクタlocal_date>コンストラクタ(local_date)</a></li><li><a href=#コンストラクタlocal_time>コンストラクタ(local_time)</a></li><li><a href=#コンストラクタlocal_datetime>コンストラクタ(local_datetime)</a></li><li><a href=#コンストラクタoffset_datetime>コンストラクタ(offset_datetime)</a></li><li><a href=#コンストラクタarray>コンストラクタ(array)</a></li><li><a href=#コンストラクタtable>コンストラクタ(table)</a></li><li><a href=#コンストラクタuser-defined>コンストラクタ(user-defined)</a></li><li><a href=#operatorbasic_value><code>operator=(basic_value)</code></a></li><li><a href=#operatort><code>operator=(T)</code></a></li><li><a href=#ist><code>is<T>()</code></a></li><li><a href=#istomlvalue_t><code>is(toml::value_t)</code></a></li><li><a href=#is_xxx><code>is_xxx()</code></a></li><li><a href=#is_empty><code>is_empty()</code></a></li><li><a href=#is_array_of_tables><code>is_array_of_tables()</code></a></li><li><a href=#type><code>type()</code></a></li><li><a href=#as_xxx><code>as_xxx()</code></a></li><li><a href=#as_xxxstdnothrow><code>as_xxx(std::nothrow)</code></a></li><li><a href=#as_xxx_fmt><code>as_xxx_fmt()</code></a></li><li><a href=#as_xxx_fmtstdnothrow><code>as_xxx_fmt(std::nothrow)</code></a></li><li><a href=#atkey><code>at(key)</code></a></li><li><a href=#countkey><code>count(key)</code></a></li><li><a href=#containskey><code>contains(key)</code></a></li><li><a href=#atidx><code>at(idx)</code></a></li><li><a href=#operatoridx><code>operator[](idx)</code></a></li><li><a href=#push_backvalue><code>push_back(value)</code></a></li><li><a href=#emplace_backargs><code>emplace_back(args...)</code></a></li><li><a href=#size><code>size()</code></a></li><li><a href=#location><code>location()</code></a></li><li><a href=#comments><code>comments()</code></a></li><li><a href=#accessed><code>accessed()</code></a></li></ul></li><li><a href=#非メンバ関数>非メンバ関数</a><ul><li><a href=#operator><code>operator==</code></a></li><li><a href=#operator-1><code>operator!=</code></a></li><li><a href=#operator-2><code>operator<</code></a></li><li><a href=#operator-3><code>operator<=</code></a></li><li><a href=#operator-4><code>operator></code></a></li><li><a href=#operator-5><code>operator>=</code></a></li></ul></li></ul></li><li><a href=#tomltype_error><code>toml::type_error</code></a></li><li><a href=#tomlmake_error_info><code>toml::make_error_info</code></a></li><li><a href=#tomlformat_error><code>toml::format_error</code></a></li><li><a href=#関連項目>関連項目</a></li></ul></nav></aside></header><article class="markdown book-article"><h1 id=valuehpp>value.hpp
|
|
<a class=anchor href=#valuehpp>#</a></h1><p><code>value.hpp</code>では、<code>basic_value</code>が定義されます。</p><h1 id=tomlbasic_value><code>toml::basic_value</code>
|
|
<a class=anchor href=#tomlbasic_value>#</a></h1><p><code>basic_value</code>は、TOMLの値を格納するクラスです。</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>namespace</span> toml
|
|
</span></span><span style=display:flex><span>{
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span> <span style=color:#f92672><</span><span style=color:#66d9ef>class</span> <span style=color:#a6e22e>TypeConfig</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>class</span> <span style=color:#a6e22e>basic_value</span>;
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span><span style=color:#75715e>// 以下はtypes.hppで定義される
|
|
</span></span></span><span style=display:flex><span><span style=color:#75715e>// using value = basic_value<type_config>;
|
|
</span></span></span><span style=display:flex><span><span style=color:#75715e>// using table = typename basic_value<type_config>::table_type;
|
|
</span></span></span><span style=display:flex><span><span style=color:#75715e>// using array = typename basic_value<type_config>::array_type;
|
|
</span></span></span><span style=display:flex><span><span style=color:#75715e></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>==</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>);
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>!=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>);
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672><</span> (<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>);
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672><=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>);
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>></span> (<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>);
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>>=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>);
|
|
</span></span><span style=display:flex><span>} <span style=color:#75715e>//toml
|
|
</span></span></span></code></pre></div><h2 id=メンバ型>メンバ型
|
|
<a class=anchor href=#%e3%83%a1%e3%83%b3%e3%83%90%e5%9e%8b>#</a></h2><p>以下のメンバ型が定義されます。</p><p><code>TypeConfig</code>を使って、メンバ型を変更することができます。</p><p>参考: <a href=https://toruniina.github.io/toml11/ja/docs/reference/types/>types.hpp</a></p><table><thead><tr><th style=text-align:left>名前</th><th style=text-align:left>定義</th></tr></thead><tbody><tr><td style=text-align:left><code>char_type</code></td><td style=text-align:left><code>typename TypeConfig::char_type</code></td></tr><tr><td style=text-align:left><code>key_type</code></td><td style=text-align:left><code>typename TypeConfig::string_type</code></td></tr><tr><td style=text-align:left><code>value_type</code></td><td style=text-align:left><code>basic_value<TypeConfig></code></td></tr><tr><td style=text-align:left><code>boolean_type</code></td><td style=text-align:left><code>typename TypeConfig::boolean_type</code></td></tr><tr><td style=text-align:left><code>integer_type</code></td><td style=text-align:left><code>typename TypeConfig::integer_type</code></td></tr><tr><td style=text-align:left><code>floating_type</code></td><td style=text-align:left><code>typename TypeConfig::floating_type</code></td></tr><tr><td style=text-align:left><code>string_type</code></td><td style=text-align:left><code>typename TypeConfig::string_type</code></td></tr><tr><td style=text-align:left><code>local_time_type</code></td><td style=text-align:left><code>toml::local_time</code></td></tr><tr><td style=text-align:left><code>local_date_type</code></td><td style=text-align:left><code>toml::local_date</code></td></tr><tr><td style=text-align:left><code>local_datetime_type</code></td><td style=text-align:left><code>toml::local_datetime</code></td></tr><tr><td style=text-align:left><code>offset_datetime_type</code></td><td style=text-align:left><code>toml::offset_datetime</code></td></tr><tr><td style=text-align:left><code>array_type</code></td><td style=text-align:left><code>typename TypeConfig::template array_type<value_type></code></td></tr><tr><td style=text-align:left><code>table_type</code></td><td style=text-align:left><code>typename TypeConfig::template table_type<key_type, value_type></code></td></tr><tr><td style=text-align:left><code>comment_type</code></td><td style=text-align:left><code>typename TypeConfig::comment_type</code></td></tr></tbody></table><h2 id=メンバ関数>メンバ関数
|
|
<a class=anchor href=#%e3%83%a1%e3%83%b3%e3%83%90%e9%96%a2%e6%95%b0>#</a></h2><h3 id=デフォルトコンストラクタ>デフォルトコンストラクタ
|
|
<a class=anchor href=#%e3%83%87%e3%83%95%e3%82%a9%e3%83%ab%e3%83%88%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bf>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value() <span style=color:#66d9ef>noexcept</span>
|
|
</span></span></code></pre></div><p>空の<code>toml::value</code>を構築します。</p><p>構築された<code>toml::value</code>は空になります。</p><h3 id=コピームーブコンストラクタ>コピー・ムーブコンストラクタ
|
|
<a class=anchor href=#%e3%82%b3%e3%83%94%e3%83%bc%e3%83%a0%e3%83%bc%e3%83%96%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bf>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&</span> v)
|
|
</span></span><span style=display:flex><span>basic_value(basic_value<span style=color:#f92672>&&</span> v)
|
|
</span></span></code></pre></div><p>値、フォーマット情報、コメント、ファイル領域の全ての情報をコピー・ムーブします。</p><h3 id=コピームーブコンストラクタコメント指定>コピー・ムーブコンストラクタ(コメント指定)
|
|
<a class=anchor href=#%e3%82%b3%e3%83%94%e3%83%bc%e3%83%a0%e3%83%bc%e3%83%96%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bf%e3%82%b3%e3%83%a1%e3%83%b3%e3%83%88%e6%8c%87%e5%ae%9a>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(basic_value v, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span></code></pre></div><p>コメントを上書きしながらコピー・ムーブします。</p><h3 id=変換コンストラクタ>変換コンストラクタ
|
|
<a class=anchor href=#%e5%a4%89%e6%8f%9b%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bf>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TI<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(basic_value<span style=color:#f92672><</span>TI<span style=color:#f92672>></span> other)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TI<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(basic_value<span style=color:#f92672><</span>TI<span style=color:#f92672>></span> other, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span></code></pre></div><p>異なる<code>type_config</code>を持つ<code>basic_value</code>からコピー・ムーブします。</p><h3 id=コンストラクタ-boolean>コンストラクタ (boolean)
|
|
<a class=anchor href=#%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bf-boolean>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(boolean_type x)
|
|
</span></span><span style=display:flex><span>basic_value(boolean_type x, boolean_format_info fmt)
|
|
</span></span><span style=display:flex><span>basic_value(boolean_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>basic_value(boolean_type x, boolean_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span></code></pre></div><p><code>bool</code>と、そのフォーマット情報、コメントを受け取って構築します。</p><h3 id=コンストラクタ-integer>コンストラクタ (integer)
|
|
<a class=anchor href=#%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bf-integer>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(integer_type x)
|
|
</span></span><span style=display:flex><span>basic_value(integer_type x, integer_format_info fmt)
|
|
</span></span><span style=display:flex><span>basic_value(integer_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>basic_value(integer_type x, integer_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span></code></pre></div><p><code>integer</code>と、そのフォーマット情報、コメントを受け取って構築します。</p><h3 id=コンストラクタfloating>コンストラクタ(floating)
|
|
<a class=anchor href=#%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bffloating>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T は std::is_floating_point<T> を満たす */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(T x)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T は std::is_floating_point<T> を満たす */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(T x, floating_format_info fmt)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T は std::is_floating_point<T> を満たす */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(T x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T は std::is_floating_point<T> を満たす */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(T x, floating_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span></code></pre></div><p><code>floating</code>と、そのフォーマット情報、コメントを受け取って構築します。</p><h3 id=コンストラクタstring>コンストラクタ(string)
|
|
<a class=anchor href=#%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bfstring>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(string_type x)
|
|
</span></span><span style=display:flex><span>basic_value(string_type x, string_format_info fmt)
|
|
</span></span><span style=display:flex><span>basic_value(string_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>basic_value(string_type x, string_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> string_type<span style=color:#f92672>::</span>value_type<span style=color:#f92672>*</span> x)
|
|
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> string_type<span style=color:#f92672>::</span>value_type<span style=color:#f92672>*</span> x, string_format_info fmt)
|
|
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> string_type<span style=color:#f92672>::</span>value_type<span style=color:#f92672>*</span> x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> string_type<span style=color:#f92672>::</span>value_type<span style=color:#f92672>*</span> x, string_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span><span style=color:#75715e>// C++17以降
|
|
</span></span></span><span style=display:flex><span><span style=color:#75715e></span>basic_value(string_view_type x)
|
|
</span></span><span style=display:flex><span>basic_value(string_view_type x, string_format_info fmt)
|
|
</span></span><span style=display:flex><span>basic_value(string_view_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>basic_value(string_view_type x, string_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span></code></pre></div><p><code>string</code>と、そのフォーマット情報、コメントを受け取って構築します。</p><p><code>string_view_type</code>は、<code>string_type</code>と同じ<code>value_type</code>と<code>traits_type</code>を持ちます。</p><h3 id=コンストラクタlocal_date>コンストラクタ(local_date)
|
|
<a class=anchor href=#%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bflocal_date>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(local_date_type x)
|
|
</span></span><span style=display:flex><span>basic_value(local_date_type x, local_date_format_info fmt)
|
|
</span></span><span style=display:flex><span>basic_value(local_date_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>basic_value(local_date_type x, local_date_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span></code></pre></div><p><code>local_date_type</code>と、そのフォーマット情報、コメントを受け取って構築します。</p><h3 id=コンストラクタlocal_time>コンストラクタ(local_time)
|
|
<a class=anchor href=#%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bflocal_time>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(local_time_type x)
|
|
</span></span><span style=display:flex><span>basic_value(local_time_type x, local_time_format_info fmt)
|
|
</span></span><span style=display:flex><span>basic_value(local_time_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>basic_value(local_time_type x, local_time_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> Rep, <span style=color:#66d9ef>typename</span> Period<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>duration<span style=color:#f92672><</span>Rep, Period<span style=color:#f92672>>&</span> x)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> Rep, <span style=color:#66d9ef>typename</span> Period<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>duration<span style=color:#f92672><</span>Rep, Period<span style=color:#f92672>>&</span> x, local_time_format_info fmt)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> Rep, <span style=color:#66d9ef>typename</span> Period<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>duration<span style=color:#f92672><</span>Rep, Period<span style=color:#f92672>>&</span> x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> Rep, <span style=color:#66d9ef>typename</span> Period<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>duration<span style=color:#f92672><</span>Rep, Period<span style=color:#f92672>>&</span> x, local_time_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span></code></pre></div><p><code>local_time_type</code>と、そのフォーマット情報、コメントを受け取って構築します。</p><p><code>std::chrono::duration</code>は、<code>00:00:00</code>からの時間幅として構築します。</p><h3 id=コンストラクタlocal_datetime>コンストラクタ(local_datetime)
|
|
<a class=anchor href=#%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bflocal_datetime>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(local_datetime_type x)
|
|
</span></span><span style=display:flex><span>basic_value(local_datetime_type x, local_date_format_info fmt)
|
|
</span></span><span style=display:flex><span>basic_value(local_datetime_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>basic_value(local_datetime_type x, local_date_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span></code></pre></div><p><code>local_datetime_type</code>と、そのフォーマット情報、コメントを受け取って構築します。</p><h3 id=コンストラクタoffset_datetime>コンストラクタ(offset_datetime)
|
|
<a class=anchor href=#%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bfoffset_datetime>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(offset_datetime_type x)
|
|
</span></span><span style=display:flex><span>basic_value(offset_datetime_type x, offset_date_format_info fmt)
|
|
</span></span><span style=display:flex><span>basic_value(offset_datetime_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>basic_value(offset_datetime_type x, offset_date_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span>basic_value(std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>system_clock<span style=color:#f92672>::</span>time_point x)
|
|
</span></span><span style=display:flex><span>basic_value(std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>system_clock<span style=color:#f92672>::</span>time_point x, offset_date_format_info fmt)
|
|
</span></span><span style=display:flex><span>basic_value(std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>system_clock<span style=color:#f92672>::</span>time_point x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>basic_value(std<span style=color:#f92672>::</span>chrono<span style=color:#f92672>::</span>system_clock<span style=color:#f92672>::</span>time_point x, offset_date_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span></code></pre></div><p><code>offset_datetime_type</code>と、そのフォーマット情報、コメントを受け取って構築します。</p><p><code>std::chrono::system_clock::time_point</code>の場合、それが指す時点として構築します。</p><h3 id=コンストラクタarray>コンストラクタ(array)
|
|
<a class=anchor href=#%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bfarray>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(array_type x)
|
|
</span></span><span style=display:flex><span>basic_value(array_type x, integer_format_info fmt)
|
|
</span></span><span style=display:flex><span>basic_value(array_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>basic_value(array_type x, integer_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is array-like */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(T x)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is array-like */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(T x, array_format_info fmt)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is array-like */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(T x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is array-like */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(T x, array_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span></code></pre></div><p><code>array</code>と、そのフォーマット情報、コメントを受け取って構築します。</p><p><code>array-like</code>は、以下の条件を満たす型です。</p><ul><li><code>T::iterator</code> を持つ。</li><li><code>T::value_type</code> を持つ。</li><li><code>T::key_type</code> を持た<strong>ない</strong>。</li><li><code>T::mapped_type</code> を持た<strong>ない</strong>。</li><li><code>std::string</code> では<strong>ない</strong>。</li><li><code>std::string_view</code> では<strong>ない</strong>。(C++17以降)</li></ul><h3 id=コンストラクタtable>コンストラクタ(table)
|
|
<a class=anchor href=#%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bftable>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value(table_type x)
|
|
</span></span><span style=display:flex><span>basic_value(table_type x, integer_format_info fmt)
|
|
</span></span><span style=display:flex><span>basic_value(table_type x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>basic_value(table_type x, integer_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is table-like */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(T x)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is table-like */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(T x, table_format_info fmt)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is table-like */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(T x, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T, <span style=color:#75715e>/* T is table-like */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(T x, table_format_info fmt, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com)
|
|
</span></span></code></pre></div><p><code>table</code>と、そのフォーマット情報、コメントを受け取って構築します。</p><p><code>table-like</code>は、以下の条件を満たす型です。</p><ul><li><code>T::iterator</code> を持つ。</li><li><code>T::value_type</code> を持つ。</li><li><code>T::key_type</code> を持つ。</li><li><code>T::mapped_type</code> を持つ。</li></ul><h3 id=コンストラクタuser-defined>コンストラクタ(user-defined)
|
|
<a class=anchor href=#%e3%82%b3%e3%83%b3%e3%82%b9%e3%83%88%e3%83%a9%e3%82%af%e3%82%bfuser-defined>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T <span style=color:#75715e>/* toml::into<T>が定義されていること */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> T<span style=color:#f92672>&</span> ud);
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T <span style=color:#75715e>/* toml::into<T>が定義されていること */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> T<span style=color:#f92672>&</span> ud, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com);
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T <span style=color:#75715e>/* into<T>は定義されておらず、T{}.into_toml()が存在すること */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> T<span style=color:#f92672>&</span> ud);
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T <span style=color:#75715e>/* into<T>は定義されておらず、T{}.into_toml()が存在すること */</span><span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value(<span style=color:#66d9ef>const</span> T<span style=color:#f92672>&</span> ud, std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> com);
|
|
</span></span></code></pre></div><p><code>toml::into<T></code> が定義されていた場合、 <code>toml::into<T>(ud)</code> の結果から構築します。</p><p><code>toml::into<T></code> が定義されておらず、 <code>T</code> に <code>into_toml()</code> メンバ関数が定義されていた場合、
|
|
<code>ud.into_toml()</code>の結果から構築します。</p><hr><h3 id=operatorbasic_value><code>operator=(basic_value)</code>
|
|
<a class=anchor href=#operatorbasic_value>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>basic_value<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672>&</span> v)
|
|
</span></span><span style=display:flex><span>basic_value<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(basic_value<span style=color:#f92672>&&</span> v)
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TI<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(basic_value<span style=color:#f92672><</span>TI<span style=color:#f92672>></span> other)
|
|
</span></span></code></pre></div><p>右辺の<code>basic_value</code>を代入します。</p><h3 id=operatort><code>operator=(T)</code>
|
|
<a class=anchor href=#operatort>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> T<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>basic_value<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>=</span>(T x)
|
|
</span></span></code></pre></div><p>Tに対応する値を代入します。</p><p><code>source_location</code>の指す内容は破棄されます。</p><p>もし同じ型の値を持っていたなら、元のフォーマット情報が保持されます。</p><hr><h3 id=ist><code>is<T>()</code>
|
|
<a class=anchor href=#ist>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> is<span style=color:#f92672><</span>T<span style=color:#f92672>></span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>
|
|
</span></span></code></pre></div><h4 id=条件>条件
|
|
<a class=anchor href=#%e6%9d%a1%e4%bb%b6>#</a></h4><p><code>T</code>は厳密にTOML型であること。つまり、値に対応する<code>toml::value::xxx_type</code>のいずれかであること。</p><h4 id=戻り値>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4>#</a></h4><p>格納している型が<code>T</code>と一致した場合<code>true</code>を、そうでない場合は<code>false</code>を返します。</p><hr><h3 id=istomlvalue_t><code>is(toml::value_t)</code>
|
|
<a class=anchor href=#istomlvalue_t>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> is(toml<span style=color:#f92672>::</span>value_t t) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>
|
|
</span></span></code></pre></div><h4 id=戻り値-1>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-1>#</a></h4><p>格納している型のタグが<code>t</code>と一致した場合<code>true</code>を、そうでない場合は<code>false</code>を返します。</p><hr><h3 id=is_xxx><code>is_xxx()</code>
|
|
<a class=anchor href=#is_xxx>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_boolean</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_integer</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_floating</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_string</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_offset_datetime</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_local_datetime</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_local_date</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_local_time</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_array</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_table</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-2>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-2>#</a></h4><p>格納している型がその型である場合<code>true</code>を、そうでない場合は<code>false</code>を返します。</p><hr><h3 id=is_empty><code>is_empty()</code>
|
|
<a class=anchor href=#is_empty>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_empty</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-3>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-3>#</a></h4><p>デフォルト構築され値が代入されていない場合<code>true</code>を、そうでない場合は<code>false</code>を返します。</p><h3 id=is_array_of_tables><code>is_array_of_tables()</code>
|
|
<a class=anchor href=#is_array_of_tables>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>is_array_of_tables</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-4>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-4>#</a></h4><p>格納している型が配列であり、空ではなく、全要素がテーブルの場合は<code>true</code>を、そうでない場合は<code>false</code>を返します。</p><hr><h3 id=type><code>type()</code>
|
|
<a class=anchor href=#type>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>toml<span style=color:#f92672>::</span>value_t type() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>
|
|
</span></span></code></pre></div><h4 id=戻り値-5>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-5>#</a></h4><p>格納している型に対応するタグを返します。</p><hr><h3 id=as_xxx><code>as_xxx()</code>
|
|
<a class=anchor href=#as_xxx>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>boolean_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_boolean () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>integer_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_integer () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>floating_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_floating () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>string_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_string () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>offset_datetime_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_offset_datetime() <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>local_datetime_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_local_datetime () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>local_date_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_local_date () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>local_time_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_local_time () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>array_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_array () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>table_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_table () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span>boolean_type <span style=color:#f92672>&</span> as_boolean ();
|
|
</span></span><span style=display:flex><span>integer_type <span style=color:#f92672>&</span> as_integer ();
|
|
</span></span><span style=display:flex><span>floating_type <span style=color:#f92672>&</span> as_floating ();
|
|
</span></span><span style=display:flex><span>string_type <span style=color:#f92672>&</span> as_string ();
|
|
</span></span><span style=display:flex><span>offset_datetime_type<span style=color:#f92672>&</span> as_offset_datetime();
|
|
</span></span><span style=display:flex><span>local_datetime_type <span style=color:#f92672>&</span> as_local_datetime ();
|
|
</span></span><span style=display:flex><span>local_date_type <span style=color:#f92672>&</span> as_local_date ();
|
|
</span></span><span style=display:flex><span>local_time_type <span style=color:#f92672>&</span> as_local_time ();
|
|
</span></span><span style=display:flex><span>array_type <span style=color:#f92672>&</span> as_array ();
|
|
</span></span><span style=display:flex><span>table_type <span style=color:#f92672>&</span> as_table ();
|
|
</span></span></code></pre></div><h4 id=戻り値-6>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-6>#</a></h4><p>指定された型への参照を返します。</p><h4 id=例外>例外
|
|
<a class=anchor href=#%e4%be%8b%e5%a4%96>#</a></h4><p>格納されている値の型が指定と異なる場合、<code>toml::type_error</code>を送出します。</p><hr><h3 id=as_xxxstdnothrow><code>as_xxx(std::nothrow)</code>
|
|
<a class=anchor href=#as_xxxstdnothrow>#</a></h3><p><code>std::nothrow</code>オブジェクトを渡して呼び出します。</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>boolean_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_boolean (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>integer_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_integer (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>floating_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_floating (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>string_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_string (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>offset_datetime_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_offset_datetime(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>local_datetime_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_local_datetime (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>local_date_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_local_date (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>local_time_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_local_time (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>array_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_array (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>table_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_table (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span>boolean_type <span style=color:#f92672>&</span> as_boolean (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>integer_type <span style=color:#f92672>&</span> as_integer (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>floating_type <span style=color:#f92672>&</span> as_floating (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>string_type <span style=color:#f92672>&</span> as_string (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>offset_datetime_type<span style=color:#f92672>&</span> as_offset_datetime(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>local_datetime_type <span style=color:#f92672>&</span> as_local_datetime (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>local_date_type <span style=color:#f92672>&</span> as_local_date (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>local_time_type <span style=color:#f92672>&</span> as_local_time (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>array_type <span style=color:#f92672>&</span> as_array (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>table_type <span style=color:#f92672>&</span> as_table (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-7>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-7>#</a></h4><p>指定された型への参照を返します。</p><h4 id=備考>備考
|
|
<a class=anchor href=#%e5%82%99%e8%80%83>#</a></h4><p>格納されている値の型が指定と異なる場合、未定義動作となります。</p><hr><h3 id=as_xxx_fmt><code>as_xxx_fmt()</code>
|
|
<a class=anchor href=#as_xxx_fmt>#</a></h3><p>フォーマット情報にアクセスします。</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>boolean_format_info <span style=color:#f92672>&</span> as_boolean_fmt ();
|
|
</span></span><span style=display:flex><span>integer_format_info <span style=color:#f92672>&</span> as_integer_fmt ();
|
|
</span></span><span style=display:flex><span>floating_format_info <span style=color:#f92672>&</span> as_floating_fmt ();
|
|
</span></span><span style=display:flex><span>string_format_info <span style=color:#f92672>&</span> as_string_fmt ();
|
|
</span></span><span style=display:flex><span>offset_datetime_format_info<span style=color:#f92672>&</span> as_offset_datetime_fmt();
|
|
</span></span><span style=display:flex><span>local_datetime_format_info <span style=color:#f92672>&</span> as_local_datetime_fmt ();
|
|
</span></span><span style=display:flex><span>local_date_format_info <span style=color:#f92672>&</span> as_local_date_fmt ();
|
|
</span></span><span style=display:flex><span>local_time_format_info <span style=color:#f92672>&</span> as_local_time_fmt ();
|
|
</span></span><span style=display:flex><span>array_format_info <span style=color:#f92672>&</span> as_array_fmt ();
|
|
</span></span><span style=display:flex><span>table_format_info <span style=color:#f92672>&</span> as_table_fmt ();
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span>boolean_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_boolean_fmt () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>integer_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_integer_fmt () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>floating_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_floating_fmt () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>string_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_string_fmt () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>offset_datetime_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_offset_datetime_fmt() <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>local_datetime_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_local_datetime_fmt () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>local_date_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_local_date_fmt () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>local_time_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_local_time_fmt () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>array_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_array_fmt () <span style=color:#66d9ef>const</span>;
|
|
</span></span><span style=display:flex><span>table_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_table_fmt () <span style=color:#66d9ef>const</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-8>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-8>#</a></h4><p>指定された型のフォーマット情報を持つ構造体への参照を返します。</p><h4 id=例外-1>例外
|
|
<a class=anchor href=#%e4%be%8b%e5%a4%96-1>#</a></h4><p>格納されている値の型が指定と異なる場合、<code>toml::type_error</code>を送出します。</p><hr><h3 id=as_xxx_fmtstdnothrow><code>as_xxx_fmt(std::nothrow)</code>
|
|
<a class=anchor href=#as_xxx_fmtstdnothrow>#</a></h3><p><code>std::nothrow</code>オブジェクトを渡して呼び出します。</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>boolean_format_info <span style=color:#f92672>&</span> as_boolean_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>integer_format_info <span style=color:#f92672>&</span> as_integer_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>floating_format_info <span style=color:#f92672>&</span> as_floating_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>string_format_info <span style=color:#f92672>&</span> as_string_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>offset_datetime_format_info<span style=color:#f92672>&</span> as_offset_datetime_fmt(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>local_datetime_format_info <span style=color:#f92672>&</span> as_local_datetime_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>local_date_format_info <span style=color:#f92672>&</span> as_local_date_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>local_time_format_info <span style=color:#f92672>&</span> as_local_time_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>array_format_info <span style=color:#f92672>&</span> as_array_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>table_format_info <span style=color:#f92672>&</span> as_table_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span>boolean_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_boolean_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>integer_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_integer_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>floating_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_floating_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>string_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_string_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>offset_datetime_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_offset_datetime_fmt(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>local_datetime_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_local_datetime_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>local_date_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_local_date_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>local_time_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_local_time_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>array_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_array_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>table_format_info <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> as_table_fmt (<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>nothrow_t<span style=color:#f92672>&</span>) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-9>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-9>#</a></h4><p>指定された型のフォーマット情報を持つ構造体への参照を返します。</p><h4 id=備考-1>備考
|
|
<a class=anchor href=#%e5%82%99%e8%80%83-1>#</a></h4><p>格納されている値の型が指定と異なる場合、未定義動作となります。</p><hr><h3 id=atkey><code>at(key)</code>
|
|
<a class=anchor href=#atkey>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>value_type<span style=color:#f92672>&</span> at(<span style=color:#66d9ef>const</span> key_type<span style=color:#f92672>&</span> key);
|
|
</span></span><span style=display:flex><span>value_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> at(<span style=color:#66d9ef>const</span> key_type<span style=color:#f92672>&</span> key) <span style=color:#66d9ef>const</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-10>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-10>#</a></h4><p>今の<code>value</code>を<code>table</code>にキャストしたあと、<code>key</code>によって指定される要素を返します。</p><h4 id=例外-2>例外
|
|
<a class=anchor href=#%e4%be%8b%e5%a4%96-2>#</a></h4><p>もし格納している値が<code>table</code>ではなかった場合、<code>toml::type_error</code>を送出します。</p><p>もし格納している<code>table</code>が指定された要素を持っていなかった場合、<code>std::out_of_range</code>を送出します。</p><hr><h4 id=operatorkey><code>operator[](key)</code>
|
|
<a class=anchor href=#operatorkey>#</a></h4><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>value_type<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span>[](<span style=color:#66d9ef>const</span> key_type<span style=color:#f92672>&</span> k);
|
|
</span></span></code></pre></div><h5 id=戻り値-11>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-11>#</a></h5><p>今の<code>value</code>を<code>table</code>にキャストしたあと、<code>key</code>によって指定される要素への参照です。</p><p>もし<code>key</code>によって指定される要素が存在しない場合、デフォルト構築されます。</p><h5 id=例外-3>例外
|
|
<a class=anchor href=#%e4%be%8b%e5%a4%96-3>#</a></h5><p>もし格納している値が<code>table</code>ではなかった場合、<code>toml::type_error</code>を送出します。</p><hr><h3 id=countkey><code>count(key)</code>
|
|
<a class=anchor href=#countkey>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>std<span style=color:#f92672>::</span>size_t count(<span style=color:#66d9ef>const</span> key_type<span style=color:#f92672>&</span> key) <span style=color:#66d9ef>const</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-12>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-12>#</a></h4><p>今の<code>value</code>を<code>table</code>にキャストしたあと、<code>key</code>に対応する要素が含まれていれば<code>1</code>、そうでなければ<code>0</code>を返します。</p><h4 id=例外-4>例外
|
|
<a class=anchor href=#%e4%be%8b%e5%a4%96-4>#</a></h4><p>もし格納している値が<code>table</code>ではなかった場合、<code>toml::type_error</code>を送出します。</p><hr><h3 id=containskey><code>contains(key)</code>
|
|
<a class=anchor href=#containskey>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>contains</span>(<span style=color:#66d9ef>const</span> key_type<span style=color:#f92672>&</span> key) <span style=color:#66d9ef>const</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-13>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-13>#</a></h4><p>今の<code>value</code>を<code>table</code>にキャストしたあと、<code>key</code>に対応する要素が含まれていれば<code>true</code>、そうでなければ<code>false</code>を返します。</p><h4 id=例外-5>例外
|
|
<a class=anchor href=#%e4%be%8b%e5%a4%96-5>#</a></h4><p>もし格納している値が<code>table</code>ではなかった場合、<code>toml::type_error</code>を送出します。</p><hr><h3 id=atidx><code>at(idx)</code>
|
|
<a class=anchor href=#atidx>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>value_type<span style=color:#f92672>&</span> at(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>size_t idx);
|
|
</span></span><span style=display:flex><span>value_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> at(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>size_t idx) <span style=color:#66d9ef>const</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-14>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-14>#</a></h4><p>今の<code>value</code>を<code>array</code>にキャストしたあと、<code>idx</code>によって指定される要素を返します。</p><h4 id=例外-6>例外
|
|
<a class=anchor href=#%e4%be%8b%e5%a4%96-6>#</a></h4><p>もし格納している値が<code>array</code>ではなかった場合、<code>toml::type_error</code>を送出します。</p><p>もし格納している<code>array</code>が指定された要素を持っていなかった場合、<code>std::out_of_range</code>を送出します。</p><hr><h3 id=operatoridx><code>operator[](idx)</code>
|
|
<a class=anchor href=#operatoridx>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>value_type<span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span>[](<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>size_t idx) <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>value_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> <span style=color:#66d9ef>operator</span>[](<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>size_t idx) <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-15>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-15>#</a></h4><p>今の<code>value</code>を<code>array</code>にキャストしたあと、<code>idx</code>によって指定される要素への参照を返します。</p><h4 id=備考-2>備考
|
|
<a class=anchor href=#%e5%82%99%e8%80%83-2>#</a></h4><p>一切のチェックを行いません。</p><p>もし格納している値が<code>array</code>ではなかった場合、あるいは<code>idx</code>によって指定される要素が存在しない場合、未定義動作となります。</p><hr><h3 id=push_backvalue><code>push_back(value)</code>
|
|
<a class=anchor href=#push_backvalue>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>push_back</span>(<span style=color:#66d9ef>const</span> value_type<span style=color:#f92672>&</span> x);
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>void</span> <span style=color:#a6e22e>push_back</span>(value_type<span style=color:#f92672>&&</span> x);
|
|
</span></span></code></pre></div><p><code>value</code>を<code>array</code>にキャストしたのち、その<code>array</code>に対して<code>push_back</code>を実行します。</p><h4 id=戻り値-16>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-16>#</a></h4><p>なし。</p><h4 id=例外-7>例外
|
|
<a class=anchor href=#%e4%be%8b%e5%a4%96-7>#</a></h4><p>格納している値が<code>array</code>ではなかった場合、<code>toml::type_error</code>を送出します。</p><hr><h3 id=emplace_backargs><code>emplace_back(args...)</code>
|
|
<a class=anchor href=#emplace_backargs>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> ... Ts<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>value_type<span style=color:#f92672>&</span> emplace_back(Ts<span style=color:#f92672>&&</span> ... args)
|
|
</span></span></code></pre></div><p><code>value</code>を<code>array</code>にキャストしたのち、その<code>array</code>に対して<code>emplace_back</code>を実行します。</p><h4 id=戻り値-17>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-17>#</a></h4><p>構築した値への参照。</p><h4 id=例外-8>例外
|
|
<a class=anchor href=#%e4%be%8b%e5%a4%96-8>#</a></h4><p>格納している値が<code>array</code>ではなかった場合、<code>toml::type_error</code>を送出します。</p><hr><h3 id=size><code>size()</code>
|
|
<a class=anchor href=#size>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>std<span style=color:#f92672>::</span>size_t size() <span style=color:#66d9ef>const</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-18>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-18>#</a></h4><p>今の<code>value</code>を<code>array</code>、<code>string</code>、<code>table</code>のどれかにキャストしたあと、その要素数を返します。
|
|
<code>string</code>の場合、文字数を返します。</p><h4 id=例外-9>例外
|
|
<a class=anchor href=#%e4%be%8b%e5%a4%96-9>#</a></h4><p>格納している値が<code>array</code>, <code>string</code>, <code>table</code>のどれでもなかった場合、<code>toml::type_error</code>を送出します。</p><hr><h3 id=location><code>location()</code>
|
|
<a class=anchor href=#location>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>source_location <span style=color:#a6e22e>location</span>() <span style=color:#66d9ef>const</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-19>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-19>#</a></h4><p>その<code>value</code>が定義されたTOML文書内の位置を表す<code>source_location</code>オブジェクトを返します。</p><p>もしTOML文書のパースによって構築されたものでない場合、どこも指示さない<code>source_location</code>を返します。</p><hr><h3 id=comments><code>comments()</code>
|
|
<a class=anchor href=#comments>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span>comment_type <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> comments() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>comment_type<span style=color:#f92672>&</span> comments() <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-20>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-20>#</a></h4><p>コメント用コンテナへの参照を返します。</p><hr><h3 id=accessed><code>accessed()</code>
|
|
<a class=anchor href=#accessed>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#a6e22e>accessed</span>() <span style=color:#66d9ef>const</span>;
|
|
</span></span></code></pre></div><h4 id=戻り値-21>戻り値
|
|
<a class=anchor href=#%e6%88%bb%e3%82%8a%e5%80%a4-21>#</a></h4><p>その<code>value</code>がパース後に一度でも<code>as_xxx</code>や<code>is_xxx</code>でアクセスされていた場合、<code>true</code>を返します。
|
|
それ以外の場合、<code>false</code>を返します。</p><h4 id=備考-3>備考
|
|
<a class=anchor href=#%e5%82%99%e8%80%83-3>#</a></h4><p><code>TOML11_ENABLE_ACCESS_CHECK</code>が定義されている場合にのみ存在します。</p><h2 id=非メンバ関数>非メンバ関数
|
|
<a class=anchor href=#%e9%9d%9e%e3%83%a1%e3%83%b3%e3%83%90%e9%96%a2%e6%95%b0>#</a></h2><h3 id=operator><code>operator==</code>
|
|
<a class=anchor href=#operator>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>==</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>);
|
|
</span></span></code></pre></div><p>以下を満たすとき、2つの<code>basic_value<T></code>は同値となります。</p><ul><li>TOML型が同一</li><li>含む値が同一</li><li>コメントがバイト単位で同一</li></ul><h3 id=operator-1><code>operator!=</code>
|
|
<a class=anchor href=#operator-1>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>!=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span> lhs, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span> rhs)
|
|
</span></span><span style=display:flex><span>{
|
|
</span></span><span style=display:flex><span> <span style=color:#66d9ef>return</span> <span style=color:#f92672>!</span>(lhs <span style=color:#f92672>==</span> rhs);
|
|
</span></span><span style=display:flex><span>}
|
|
</span></span></code></pre></div><h3 id=operator-2><code>operator<</code>
|
|
<a class=anchor href=#operator-2>#</a></h3><p><code>array_type</code>と<code>table_type</code>が<code>operator<</code>を持っている場合のみ定義されます。</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672><</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span>);
|
|
</span></span></code></pre></div><p>以下の順番で比較されます。</p><ol><li>TOML型</li><li>TOML型が同一の場合、その値</li><li>TOML型とその値が同一の場合、コメント</li></ol><p>TOML型は、以下の順に小さい値を持ちます。</p><ol><li><code>toml::value_t::empty</code></li><li><code>toml::value_t::boolean</code></li><li><code>toml::value_t::integer</code></li><li><code>toml::value_t::floating</code></li><li><code>toml::value_t::string</code></li><li><code>toml::value_t::offset_datetime</code></li><li><code>toml::value_t::local_datetime</code></li><li><code>toml::value_t::local_date</code></li><li><code>toml::value_t::local_time</code></li><li><code>toml::value_t::array</code></li><li><code>toml::value_t::table</code></li></ol><h3 id=operator-3><code>operator<=</code>
|
|
<a class=anchor href=#operator-3>#</a></h3><p><code>array_type</code>と<code>table_type</code>が<code>operator<</code>を持っている場合のみ定義されます。</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672><=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span> lhs, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span> rhs)
|
|
</span></span><span style=display:flex><span>{
|
|
</span></span><span style=display:flex><span> <span style=color:#66d9ef>return</span> (lhs <span style=color:#f92672><</span> rhs) <span style=color:#f92672>||</span> (lhs <span style=color:#f92672>==</span> rhs);
|
|
</span></span><span style=display:flex><span>}
|
|
</span></span></code></pre></div><h3 id=operator-4><code>operator></code>
|
|
<a class=anchor href=#operator-4>#</a></h3><p><code>array_type</code>と<code>table_type</code>が<code>operator<</code>を持っている場合のみ定義されます。</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>></span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span> lhs, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span> rhs)
|
|
</span></span><span style=display:flex><span>{
|
|
</span></span><span style=display:flex><span> <span style=color:#66d9ef>return</span> <span style=color:#f92672>!</span>(lhs <span style=color:#f92672><=</span> rhs);
|
|
</span></span><span style=display:flex><span>}
|
|
</span></span></code></pre></div><h3 id=operator-5><code>operator>=</code>
|
|
<a class=anchor href=#operator-5>#</a></h3><p><code>array_type</code>と<code>table_type</code>が<code>operator<</code>を持っている場合のみ定義されます。</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span><span style=color:#66d9ef>bool</span> <span style=color:#66d9ef>operator</span><span style=color:#f92672>>=</span>(<span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span> lhs, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span> rhs)
|
|
</span></span><span style=display:flex><span>{
|
|
</span></span><span style=display:flex><span> <span style=color:#66d9ef>return</span> <span style=color:#f92672>!</span>(lhs <span style=color:#f92672><</span> rhs);
|
|
</span></span><span style=display:flex><span>}
|
|
</span></span></code></pre></div><h1 id=tomltype_error><code>toml::type_error</code>
|
|
<a class=anchor href=#tomltype_error>#</a></h1><p>型エラーの際に送出される例外です。</p><p>型エラーが生じた値の位置情報が格納されています。</p><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>struct</span> <span style=color:#a6e22e>type_error</span> <span style=color:#66d9ef>final</span> <span style=color:#f92672>:</span> <span style=color:#66d9ef>public</span> <span style=color:#f92672>::</span>toml<span style=color:#f92672>::</span>exception
|
|
</span></span><span style=display:flex><span>{
|
|
</span></span><span style=display:flex><span> <span style=color:#66d9ef>public</span><span style=color:#f92672>:</span>
|
|
</span></span><span style=display:flex><span> type_error(std<span style=color:#f92672>::</span>string what_arg, source_location loc);
|
|
</span></span><span style=display:flex><span> <span style=color:#f92672>~</span>type_error() <span style=color:#66d9ef>noexcept</span> <span style=color:#66d9ef>override</span> <span style=color:#f92672>=</span> <span style=color:#66d9ef>default</span>;
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span> <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>char</span><span style=color:#f92672>*</span> <span style=color:#a6e22e>what</span>() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span> <span style=color:#66d9ef>override</span>;
|
|
</span></span><span style=display:flex><span>
|
|
</span></span><span style=display:flex><span> source_location <span style=color:#66d9ef>const</span><span style=color:#f92672>&</span> location() <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>noexcept</span>;
|
|
</span></span><span style=display:flex><span>};
|
|
</span></span></code></pre></div><h1 id=tomlmake_error_info><code>toml::make_error_info</code>
|
|
<a class=anchor href=#tomlmake_error_info>#</a></h1><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC, <span style=color:#66d9ef>typename</span> ... Ts<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>error_info make_error_info(
|
|
</span></span><span style=display:flex><span> std<span style=color:#f92672>::</span>string title, <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span> v, std<span style=color:#f92672>::</span>string msg, Ts<span style=color:#f92672>&&</span> ... tail);
|
|
</span></span></code></pre></div><p><code>basic_value</code> の <code>location()</code> を呼び出して、その <code>source_location</code> を
|
|
<a href=https://toruniina.github.io/toml11/ja/docs/reference/error_info/#make_error_info><code>make_error_info</code></a>
|
|
に渡して <code>error_info</code> を作成します。</p><p>詳しくは <a href=https://toruniina.github.io/toml11/ja/docs/reference/error_info/><code>error_info</code></a> を参照してください。</p><h1 id=tomlformat_error><code>toml::format_error</code>
|
|
<a class=anchor href=#tomlformat_error>#</a></h1><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-cpp data-lang=cpp><span style=display:flex><span><span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> TC, <span style=color:#66d9ef>typename</span> ... Ts<span style=color:#f92672>></span>
|
|
</span></span><span style=display:flex><span>std<span style=color:#f92672>::</span>string format_error(std<span style=color:#f92672>::</span>string title,
|
|
</span></span><span style=display:flex><span> <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>TC<span style=color:#f92672>>&</span> v, std<span style=color:#f92672>::</span>string msg, Ts<span style=color:#f92672>&&</span> ... tail);
|
|
</span></span></code></pre></div><p><code>basic_value</code> の <code>location()</code> を呼び出して、その <code>source_location</code> を
|
|
<a href=https://toruniina.github.io/toml11/ja/docs/reference/error_info/#format_error><code>format_error</code></a>
|
|
に渡して <code>error_info</code> を作成し、それを文字列化して返します。</p><p>詳しくは <a href=https://toruniina.github.io/toml11/ja/docs/reference/error_info/><code>error_info</code></a> を参照してください。</p><h1 id=関連項目>関連項目
|
|
<a class=anchor href=#%e9%96%a2%e9%80%a3%e9%a0%85%e7%9b%ae>#</a></h1><ul><li><a href=https://toruniina.github.io/toml11/ja/docs/reference/comments/>comments.hpp</a></li><li><a href=https://toruniina.github.io/toml11/ja/docs/reference/source_location/>source_location.hpp</a></li><li><a href=https://toruniina.github.io/toml11/ja/docs/reference/types/>types.hpp</a></li><li><a href=https://toruniina.github.io/toml11/ja/docs/reference/visit/>visit.hpp</a></li></ul></article><footer class=book-footer><div class="flex flex-wrap justify-between"></div><script>(function(){function e(e){const t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}document.querySelectorAll("pre code").forEach(t=>{t.addEventListener("click",function(){if(window.getSelection().toString())return;e(t.parentElement),navigator.clipboard&&navigator.clipboard.writeText(t.parentElement.textContent)})})})()</script></footer><label for=menu-control class="hidden book-menu-overlay"></label></div><aside class=book-toc><div class=book-toc-content><nav id=TableOfContents><ul><li><a href=#valuehpp>value.hpp</a></li><li><a href=#tomlbasic_value><code>toml::basic_value</code></a><ul><li><a href=#メンバ型>メンバ型</a></li><li><a href=#メンバ関数>メンバ関数</a><ul><li><a href=#デフォルトコンストラクタ>デフォルトコンストラクタ</a></li><li><a href=#コピームーブコンストラクタ>コピー・ムーブコンストラクタ</a></li><li><a href=#コピームーブコンストラクタコメント指定>コピー・ムーブコンストラクタ(コメント指定)</a></li><li><a href=#変換コンストラクタ>変換コンストラクタ</a></li><li><a href=#コンストラクタ-boolean>コンストラクタ (boolean)</a></li><li><a href=#コンストラクタ-integer>コンストラクタ (integer)</a></li><li><a href=#コンストラクタfloating>コンストラクタ(floating)</a></li><li><a href=#コンストラクタstring>コンストラクタ(string)</a></li><li><a href=#コンストラクタlocal_date>コンストラクタ(local_date)</a></li><li><a href=#コンストラクタlocal_time>コンストラクタ(local_time)</a></li><li><a href=#コンストラクタlocal_datetime>コンストラクタ(local_datetime)</a></li><li><a href=#コンストラクタoffset_datetime>コンストラクタ(offset_datetime)</a></li><li><a href=#コンストラクタarray>コンストラクタ(array)</a></li><li><a href=#コンストラクタtable>コンストラクタ(table)</a></li><li><a href=#コンストラクタuser-defined>コンストラクタ(user-defined)</a></li><li><a href=#operatorbasic_value><code>operator=(basic_value)</code></a></li><li><a href=#operatort><code>operator=(T)</code></a></li><li><a href=#ist><code>is<T>()</code></a></li><li><a href=#istomlvalue_t><code>is(toml::value_t)</code></a></li><li><a href=#is_xxx><code>is_xxx()</code></a></li><li><a href=#is_empty><code>is_empty()</code></a></li><li><a href=#is_array_of_tables><code>is_array_of_tables()</code></a></li><li><a href=#type><code>type()</code></a></li><li><a href=#as_xxx><code>as_xxx()</code></a></li><li><a href=#as_xxxstdnothrow><code>as_xxx(std::nothrow)</code></a></li><li><a href=#as_xxx_fmt><code>as_xxx_fmt()</code></a></li><li><a href=#as_xxx_fmtstdnothrow><code>as_xxx_fmt(std::nothrow)</code></a></li><li><a href=#atkey><code>at(key)</code></a></li><li><a href=#countkey><code>count(key)</code></a></li><li><a href=#containskey><code>contains(key)</code></a></li><li><a href=#atidx><code>at(idx)</code></a></li><li><a href=#operatoridx><code>operator[](idx)</code></a></li><li><a href=#push_backvalue><code>push_back(value)</code></a></li><li><a href=#emplace_backargs><code>emplace_back(args...)</code></a></li><li><a href=#size><code>size()</code></a></li><li><a href=#location><code>location()</code></a></li><li><a href=#comments><code>comments()</code></a></li><li><a href=#accessed><code>accessed()</code></a></li></ul></li><li><a href=#非メンバ関数>非メンバ関数</a><ul><li><a href=#operator><code>operator==</code></a></li><li><a href=#operator-1><code>operator!=</code></a></li><li><a href=#operator-2><code>operator<</code></a></li><li><a href=#operator-3><code>operator<=</code></a></li><li><a href=#operator-4><code>operator></code></a></li><li><a href=#operator-5><code>operator>=</code></a></li></ul></li></ul></li><li><a href=#tomltype_error><code>toml::type_error</code></a></li><li><a href=#tomlmake_error_info><code>toml::make_error_info</code></a></li><li><a href=#tomlformat_error><code>toml::format_error</code></a></li><li><a href=#関連項目>関連項目</a></li></ul></nav></div></aside></main></body></html> |