Files
toml11/ja/docs/features/index.html
ToruNiina e671b8e3bd Merge pull request #291 from franzpoeschel/namespace-versioning
Use an inline namespace to distinguish emitted symbols by version numbers e4051f77d7
2025-05-17 07:21:19 +00:00

137 lines
19 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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="
features
#
ここでは、toml11が提供する主な機能について、例を挙げながら説明します。
ファイル・文字列をパースする
#
ファイルや文字列をパースする関数と、それが出力するエラーの扱い方について説明します。
以下の内容を含みます。
ファイルをパースする
文字列をパースする
バイト列をパースする
例外を投げずにファイルをパースする
例外を投げずに文字列をパースする
例外を投げずにバイト列をパースする
toml::valueから値を取り出す
#
toml::valueが持つデータの型を調べ、取り出す方法、型変換を行う方法について説明します。
以下の内容を含みます。
メンバ関数を使って値の型を調べる
メンバ関数を使って値にアクセスする
コメントにアクセスする
インラインテーブル・ドットキーの取り扱い
日付情報の取り扱い
toml::get<T>を使って変換する
toml::get_orを使って失敗時の値を指定する
toml::find<T>を使って検索と変換を行う
toml::find_orを使って失敗時の値を指定する
ユーザー定義型との変換を定義する
toml::visitで関数を適用する
toml::valueを構築する
エラーメッセージを作る
#
toml::valueの値を使って、TOMLファイル中の位置情報つきのエラーメッセージを生成する方法について説明します。
以下の内容を含みます。
toml::value の位置情報を取り出す
エラーメッセージを構築する
出力に色を付ける
TOMLファイルを出力する
#
toml::valueの値をフォーマットする方法と、可能なフォーマット指定について説明します。
以下の内容を含みます。
toml::valueの値ごとにフォーマットを指定する
toml::valueをフォーマットして文字列化する
toml::valueの型を変更する
#
toml::valueが格納する型integer_typeやtable_typeをカスタマイズする方法について説明します。
以下の内容を含みます。
type_configの定義
ordered_type_configを使用する
コメントを保存しないようにする
std::dequeなどの異なるコンテナを使用する
boost::multiprecisionなどの異なる数値型を使用する
TOMLリテラル
#
C++内にTOMLファイルを埋め込むための_tomlリテラルについて説明します。
以下の内容を含みます。
TOMLリテラルを使用する
TOML言語バージョン
#
toml11がサポートするTOML言語のバージョン、主にTOML-v1.1.0で追加された言語機能を制御する方法について説明します。
以下の内容を含みます。
TOML言語の1.1.0を使用する
TOML言語の1.1.0の一部の機能のみ使用する
TOML言語拡張
#
toml11独自のTOML言語拡張について説明します。
以下の内容を含みます。
null をサポートする
浮動小数点数の16進数フォーマットをサポートする
数値に単位を付けられるようにする
"><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/features/"><meta property="og:site_name" content="toml11"><meta property="og:title" content="features"><meta property="og:description" content="features # ここでは、toml11が提供する主な機能について、例を挙げながら説明します。
ファイル・文字列をパースする # ファイルや文字列をパースする関数と、それが出力するエラーの扱い方について説明します。
以下の内容を含みます。
ファイルをパースする 文字列をパースする バイト列をパースする 例外を投げずにファイルをパースする 例外を投げずに文字列をパースする 例外を投げずにバイト列をパースする toml::valueから値を取り出す # toml::valueが持つデータの型を調べ、取り出す方法、型変換を行う方法について説明します。
以下の内容を含みます。
メンバ関数を使って値の型を調べる メンバ関数を使って値にアクセスする コメントにアクセスする インラインテーブル・ドットキーの取り扱い 日付情報の取り扱い toml::get<T>を使って変換する toml::get_orを使って失敗時の値を指定する toml::find<T>を使って検索と変換を行う toml::find_orを使って失敗時の値を指定する ユーザー定義型との変換を定義する toml::visitで関数を適用する toml::valueを構築する エラーメッセージを作る # toml::valueの値を使って、TOMLファイル中の位置情報つきのエラーメッセージを生成する方法について説明します。
以下の内容を含みます。
toml::value の位置情報を取り出す エラーメッセージを構築する 出力に色を付ける TOMLファイルを出力する # toml::valueの値をフォーマットする方法と、可能なフォーマット指定について説明します。
以下の内容を含みます。
toml::valueの値ごとにフォーマットを指定する toml::valueをフォーマットして文字列化する toml::valueの型を変更する # toml::valueが格納する型integer_typeやtable_typeをカスタマイズする方法について説明します。
以下の内容を含みます。
type_configの定義 ordered_type_configを使用する コメントを保存しないようにする std::dequeなどの異なるコンテナを使用する boost::multiprecisionなどの異なる数値型を使用する TOMLリテラル # C++内にTOMLファイルを埋め込むための_tomlリテラルについて説明します。
以下の内容を含みます。
TOMLリテラルを使用する TOML言語バージョン # toml11がサポートするTOML言語のバージョン、主にTOML-v1.1.0で追加された言語機能を制御する方法について説明します。
以下の内容を含みます。
TOML言語の1.1.0を使用する TOML言語の1.1.0の一部の機能のみ使用する TOML言語拡張 # toml11独自のTOML言語拡張について説明します。
以下の内容を含みます。
null をサポートする 浮動小数点数の16進数フォーマットをサポートする 数値に単位を付けられるようにする"><meta property="og:locale" content="ja"><meta property="og:type" content="website"><title>features | 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/features/><link rel=alternate hreflang=en href=https://toruniina.github.io/toml11/docs/features/ title=features><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><link rel=alternate type=application/rss+xml href=https://toruniina.github.io/toml11/ja/docs/features/index.xml title=toml11></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/features/>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 checked>
<label for=section-b4cfb5b55e913a8d853eacf5e8fba05f class="flex justify-between"><a href=/toml11/ja/docs/features/ class=active>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>
<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/>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>features</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=#features>features</a><ul><li><a href=#ファイル文字列をパースする><a href=parsing_files>ファイル・文字列をパースする</a></a></li><li><a href=#tomlvalue><a href=value><code>toml::value</code>から値を取り出す</a></a></li><li><a href=#エラーメッセージを作る><a href=error_message>エラーメッセージを作る</a></a></li><li><a href=#tomlファイルを出力する><a href=serialize>TOMLファイルを出力する</a></a></li><li><a href=#tomlvalue-1><a href=configure_types><code>toml::value</code>の型を変更する</a></a></li><li><a href=#tomlリテラル><a href=literal>TOMLリテラル</a></a></li><li><a href=#toml言語バージョン><a href=toml_spec>TOML言語バージョン</a></a></li><li><a href=#toml言語拡張><a href=extension>TOML言語拡張</a></a></li></ul></li></ul></nav></aside></header><article class="markdown book-article"><h1 id=features>features
<a class=anchor href=#features>#</a></h1><p>ここでは、toml11が提供する主な機能について、例を挙げながら説明します。</p><h2 id=ファイル文字列をパースする><a href=parsing_files>ファイル・文字列をパースする</a>
<a class=anchor href=#%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e6%96%87%e5%ad%97%e5%88%97%e3%82%92%e3%83%91%e3%83%bc%e3%82%b9%e3%81%99%e3%82%8b>#</a></h2><p>ファイルや文字列をパースする関数と、それが出力するエラーの扱い方について説明します。</p><p>以下の内容を含みます。</p><ul><li>ファイルをパースする</li><li>文字列をパースする</li><li>バイト列をパースする</li><li>例外を投げずにファイルをパースする</li><li>例外を投げずに文字列をパースする</li><li>例外を投げずにバイト列をパースする</li></ul><h2 id=tomlvalue><a href=value><code>toml::value</code>から値を取り出す</a>
<a class=anchor href=#tomlvalue>#</a></h2><p><code>toml::value</code>が持つデータの型を調べ、取り出す方法、型変換を行う方法について説明します。</p><p>以下の内容を含みます。</p><ul><li>メンバ関数を使って値の型を調べる</li><li>メンバ関数を使って値にアクセスする</li><li>コメントにアクセスする</li><li>インラインテーブル・ドットキーの取り扱い</li><li>日付情報の取り扱い</li><li><code>toml::get&lt;T></code>を使って変換する</li><li><code>toml::get_or</code>を使って失敗時の値を指定する</li><li><code>toml::find&lt;T></code>を使って検索と変換を行う</li><li><code>toml::find_or</code>を使って失敗時の値を指定する</li><li>ユーザー定義型との変換を定義する</li><li><code>toml::visit</code>で関数を適用する</li><li><code>toml::value</code>を構築する</li></ul><h2 id=エラーメッセージを作る><a href=error_message>エラーメッセージを作る</a>
<a class=anchor href=#%e3%82%a8%e3%83%a9%e3%83%bc%e3%83%a1%e3%83%83%e3%82%bb%e3%83%bc%e3%82%b8%e3%82%92%e4%bd%9c%e3%82%8b>#</a></h2><p><code>toml::value</code>の値を使って、TOMLファイル中の位置情報つきのエラーメッセージを生成する方法について説明します。</p><p>以下の内容を含みます。</p><ul><li><code>toml::value</code> の位置情報を取り出す</li><li>エラーメッセージを構築する</li><li>出力に色を付ける</li></ul><h2 id=tomlファイルを出力する><a href=serialize>TOMLファイルを出力する</a>
<a class=anchor href=#toml%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%82%92%e5%87%ba%e5%8a%9b%e3%81%99%e3%82%8b>#</a></h2><p><code>toml::value</code>の値をフォーマットする方法と、可能なフォーマット指定について説明します。</p><p>以下の内容を含みます。</p><ul><li><code>toml::value</code>の値ごとにフォーマットを指定する</li><li><code>toml::value</code>をフォーマットして文字列化する</li></ul><h2 id=tomlvalue-1><a href=configure_types><code>toml::value</code>の型を変更する</a>
<a class=anchor href=#tomlvalue-1>#</a></h2><p><code>toml::value</code>が格納する型(<code>integer_type</code><code>table_type</code>をカスタマイズする方法について説明します。</p><p>以下の内容を含みます。</p><ul><li><code>type_config</code>の定義</li><li><code>ordered_type_config</code>を使用する</li><li>コメントを保存しないようにする</li><li><code>std::deque</code>などの異なるコンテナを使用する</li><li><code>boost::multiprecision</code>などの異なる数値型を使用する</li></ul><h2 id=tomlリテラル><a href=literal>TOMLリテラル</a>
<a class=anchor href=#toml%e3%83%aa%e3%83%86%e3%83%a9%e3%83%ab>#</a></h2><p>C++内にTOMLファイルを埋め込むための<code>_toml</code>リテラルについて説明します。</p><p>以下の内容を含みます。</p><ul><li>TOMLリテラルを使用する</li></ul><h2 id=toml言語バージョン><a href=toml_spec>TOML言語バージョン</a>
<a class=anchor href=#toml%e8%a8%80%e8%aa%9e%e3%83%90%e3%83%bc%e3%82%b8%e3%83%a7%e3%83%b3>#</a></h2><p>toml11がサポートするTOML言語のバージョン、主にTOML-v1.1.0で追加された言語機能を制御する方法について説明します。</p><p>以下の内容を含みます。</p><ul><li>TOML言語の1.1.0を使用する</li><li>TOML言語の1.1.0の一部の機能のみ使用する</li></ul><h2 id=toml言語拡張><a href=extension>TOML言語拡張</a>
<a class=anchor href=#toml%e8%a8%80%e8%aa%9e%e6%8b%a1%e5%bc%b5>#</a></h2><p>toml11独自のTOML言語拡張について説明します。</p><p>以下の内容を含みます。</p><ul><li><code>null</code> をサポートする</li><li>浮動小数点数の16進数フォーマットをサポートする</li><li>数値に単位を付けられるようにする</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=#features>features</a><ul><li><a href=#ファイル文字列をパースする><a href=parsing_files>ファイル・文字列をパースする</a></a></li><li><a href=#tomlvalue><a href=value><code>toml::value</code>から値を取り出す</a></a></li><li><a href=#エラーメッセージを作る><a href=error_message>エラーメッセージを作る</a></a></li><li><a href=#tomlファイルを出力する><a href=serialize>TOMLファイルを出力する</a></a></li><li><a href=#tomlvalue-1><a href=configure_types><code>toml::value</code>の型を変更する</a></a></li><li><a href=#tomlリテラル><a href=literal>TOMLリテラル</a></a></li><li><a href=#toml言語バージョン><a href=toml_spec>TOML言語バージョン</a></a></li><li><a href=#toml言語拡張><a href=extension>TOML言語拡張</a></a></li></ul></li></ul></nav></div></aside></main></body></html>