mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-18 02:08:09 +08:00
Merge pull request #291 from franzpoeschel/namespace-versioning
Use an inline namespace to distinguish emitted symbols by version numbers e4051f77d7
This commit is contained in:
296
docs/changelog/index.html
Normal file
296
docs/changelog/index.html
Normal file
@@ -0,0 +1,296 @@
|
||||
<!doctype html><html lang=en dir=ltr><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="
|
||||
Change Log
|
||||
#
|
||||
|
||||
|
||||
v4.4.0
|
||||
#
|
||||
|
||||
|
||||
Added
|
||||
#
|
||||
|
||||
|
||||
Add toml::find_or_default() (#280) (by Ken Matsui @ken-matsui)
|
||||
Add erase to ordered_map (#282) (#283) (by Sunlight @SunPodder)
|
||||
Add bool basic_value::accessed() const to detect whether the value has been accessed
|
||||
|
||||
enabled only if TOML11_ENABLE_ACCESS_CHECK is defined
|
||||
|
||||
|
||||
Add compare operators to toml::spec
|
||||
|
||||
|
||||
Fixed
|
||||
#
|
||||
|
||||
|
||||
Use is_void<T> instead of is_same<T, void> (#281) (by Ken Matsui @ken-matsui)
|
||||
|
||||
|
||||
Changed
|
||||
#
|
||||
|
||||
|
||||
Improve toml::parse performance by 2x
|
||||
Stop using deprecated Ubuntu 20 image on GitHub Actions
|
||||
|
||||
|
||||
v4.3.0
|
||||
#
|
||||
|
||||
|
||||
Added
|
||||
#
|
||||
|
||||
|
||||
Support std::optional as a template argument of toml::find
|
||||
Support multiple arguments toml::visit(visitor, args...)
|
||||
|
||||
|
||||
Fixed
|
||||
#
|
||||
|
||||
|
||||
toml::detail::region::last_ may be used uninitialized (#267) (#268) (by amatej @kontura)
|
||||
Fix use with CMake 3.21 and older (#271) (by Severin Leonhardt @SeverinLeonhardt)
|
||||
fix: prevent size_t-max length string allocation (#275) (#276) (by @hayt)
|
||||
update README.md (#277) (by somebody @oldoldtea) (by lz)
|
||||
Make parsing faster for very long line (#278)
|
||||
Avoid known problem in MSVC (#279)
|
||||
Check if source_location::file_name() is null before formatting
|
||||
|
||||
|
||||
Changed
|
||||
#
|
||||
|
||||
|
||||
Update hugo-book theme
|
||||
Add MSVC 2017 to appveyor build
|
||||
|
||||
|
||||
v4.2.0
|
||||
#
|
||||
|
||||
|
||||
Added
|
||||
#
|
||||
|
||||
|
||||
Support std::optional members for TOML11_DEFINE_CONVERSION_NON_INTRUSIVE (by Ken Matsui)
|
||||
Make thread_local for color_mode optional (by Ken Matsui)
|
||||
add usage with CPM to README
|
||||
add explanation about ordered_map to README and update doc
|
||||
|
||||
|
||||
Fixed
|
||||
#
|
||||
|
||||
|
||||
Manually cast file size to std::streamsize (by Pino Toscano)
|
||||
Typographical error in table_format output
|
||||
Format an empty array specified as array-of-table in one line
|
||||
Added a missing include file
|
||||
Fix typos in documentation template syntax (by Jack W)
|
||||
Fix toml::find_or for deeply nested tables
|
||||
|
||||
|
||||
v4.1.0
|
||||
#
|
||||
|
||||
|
||||
Added
|
||||
#
|
||||
|
||||
|
||||
support std::get<std::u8string>
|
||||
support toml::value(std::u8string)
|
||||
support string_type = std::u8string
|
||||
support operator<<(std::ostream&, toml::value)
|
||||
add bool uppercase to toml::integer_format
|
||||
support template into_toml() (by 萧迩珀)
|
||||
|
||||
|
||||
Fixed
|
||||
#
|
||||
|
||||
|
||||
Fix not checking for \r\n when parsing line comments (by Andreas Keller)
|
||||
|
||||
|
||||
Changed
|
||||
#
|
||||
|
||||
|
||||
speedup CI tests by multicore build
|
||||
|
||||
|
||||
v4.0.3
|
||||
#
|
||||
|
||||
|
||||
Fixed
|
||||
#
|
||||
|
||||
|
||||
remove default template argument from forward declaration in toml_fwd.hpp
|
||||
enable to call toml::make_error_info with multiple toml::values
|
||||
enable to copy/move toml::result having std::reference_wrapper
|
||||
fix document generation error with the latest version of hugo
|
||||
fix several tiny errors that causes warning
|
||||
fix CMake compatibility warning
|
||||
|
||||
|
||||
Changed
|
||||
#
|
||||
|
||||
add -Werror / /WX to build script
|
||||
set MSVC warning level to /W4
|
||||
add explanation of features to README"><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/docs/changelog/"><meta property="og:site_name" content="toml11"><meta property="og:title" content="changelog"><meta property="og:description" content="Change Log # v4.4.0 # Added # Add toml::find_or_default() (#280) (by Ken Matsui @ken-matsui) Add erase to ordered_map (#282) (#283) (by Sunlight @SunPodder) Add bool basic_value::accessed() const to detect whether the value has been accessed enabled only if TOML11_ENABLE_ACCESS_CHECK is defined Add compare operators to toml::spec Fixed # Use is_void<T> instead of is_same<T, void> (#281) (by Ken Matsui @ken-matsui) Changed # Improve toml::parse performance by 2x Stop using deprecated Ubuntu 20 image on GitHub Actions v4.3.0 # Added # Support std::optional as a template argument of toml::find Support multiple arguments toml::visit(visitor, args...) Fixed # toml::detail::region::last_ may be used uninitialized (#267) (#268) (by amatej @kontura) Fix use with CMake 3.21 and older (#271) (by Severin Leonhardt @SeverinLeonhardt) fix: prevent size_t-max length string allocation (#275) (#276) (by @hayt) update README.md (#277) (by somebody @oldoldtea) (by lz) Make parsing faster for very long line (#278) Avoid known problem in MSVC (#279) Check if source_location::file_name() is null before formatting Changed # Update hugo-book theme Add MSVC 2017 to appveyor build v4.2.0 # Added # Support std::optional members for TOML11_DEFINE_CONVERSION_NON_INTRUSIVE (by Ken Matsui) Make thread_local for color_mode optional (by Ken Matsui) add usage with CPM to README add explanation about ordered_map to README and update doc Fixed # Manually cast file size to std::streamsize (by Pino Toscano) Typographical error in table_format output Format an empty array specified as array-of-table in one line Added a missing include file Fix typos in documentation template syntax (by Jack W) Fix toml::find_or for deeply nested tables v4.1.0 # Added # support std::get<std::u8string> support toml::value(std::u8string) support string_type = std::u8string support operator<<(std::ostream&, toml::value) add bool uppercase to toml::integer_format support template into_toml() (by 萧迩珀) Fixed # Fix not checking for \r\n when parsing line comments (by Andreas Keller) Changed # speedup CI tests by multicore build v4.0.3 # Fixed # remove default template argument from forward declaration in toml_fwd.hpp enable to call toml::make_error_info with multiple toml::values enable to copy/move toml::result having std::reference_wrapper fix document generation error with the latest version of hugo fix several tiny errors that causes warning fix CMake compatibility warning Changed # add -Werror / /WX to build script set MSVC warning level to /W4 add explanation of features to README"><meta property="og:locale" content="en"><meta property="og:type" content="website"><title>changelog | 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/docs/changelog/><link rel=alternate hreflang=ja href=https://toruniina.github.io/toml11/ja/docs/changelog/ title=changelog><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/en.search.min.db4a558804ac41f081539588cec8e4a415587801da466728166bb5341dd62411.js integrity="sha256-20pViASsQfCBU5WIzsjkpBVYeAHaRmcoFmu1NB3WJBE=" crossorigin=anonymous></script><link rel=alternate type=application/rss+xml href=https://toruniina.github.io/toml11/docs/changelog/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/><span>toml11</span></a></h2><div class="book-search hidden"><input type=text id=book-search-input placeholder=Search aria-label=Search 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>
|
||||
English</a></label><ul><li><a href=https://toruniina.github.io/toml11/ja/docs/changelog/>日本語</a></li></ul></li></ul><ul><li><a href=/toml11/docs/installation/>installation</a><ul></ul></li><li><input type=checkbox id=section-291123c850af98d8b815ccdbb4c33657 class=toggle>
|
||||
<label for=section-291123c850af98d8b815ccdbb4c33657 class="flex justify-between"><a href=/toml11/docs/features/>features</a></label><ul><li><a href=/toml11/docs/features/parsing_files/>parsing files</a></li><li><a href=/toml11/docs/features/value/>getting values</a></li><li><a href=/toml11/docs/features/error_message/>error message</a></li><li><a href=/toml11/docs/features/serialize/>serializing values</a></li><li><a href=/toml11/docs/features/configure_types/>configuring types</a></li><li><a href=/toml11/docs/features/literal/>toml literal</a></li><li><a href=/toml11/docs/features/toml_spec/>toml spec</a></li><li><a href=/toml11/docs/features/extension/>extension</a></li></ul></li><li><input type=checkbox id=section-e2e812e55021b82e114feaae98f1a02e class=toggle>
|
||||
<label for=section-e2e812e55021b82e114feaae98f1a02e class="flex justify-between"><a href=/toml11/docs/reference/>reference</a></label><ul><li><a href=/toml11/docs/reference/color/>color.hpp</a></li><li><a href=/toml11/docs/reference/comments/>comments.hpp</a></li><li><a href=/toml11/docs/reference/conversion/>conversion.hpp</a></li><li><a href=/toml11/docs/reference/datetime/>datetime.hpp</a></li><li><a href=/toml11/docs/reference/error_info/>error_info.hpp</a></li><li><a href=/toml11/docs/reference/exception/>exception.hpp</a></li><li><a href=/toml11/docs/reference/find/>find.hpp</a></li><li><a href=/toml11/docs/reference/format/>format.hpp</a></li><li><a href=/toml11/docs/reference/from/>from.hpp</a></li><li><a href=/toml11/docs/reference/get/>get.hpp</a></li><li><a href=/toml11/docs/reference/into/>into.hpp</a></li><li><a href=/toml11/docs/reference/literal/>literal.hpp</a></li><li><a href=/toml11/docs/reference/ordered_map/>ordered_map.hpp</a></li><li><a href=/toml11/docs/reference/parser/>parser.hpp</a></li><li><a href=/toml11/docs/reference/result/>result.hpp</a></li><li><a href=/toml11/docs/reference/serializer/>serializer.hpp</a></li><li><a href=/toml11/docs/reference/source_location/>source_location.hpp</a></li><li><a href=/toml11/docs/reference/spec/>spec.hpp</a></li><li><a href=/toml11/docs/reference/toml_fwd/>toml_fwd.hpp</a></li><li><a href=/toml11/docs/reference/toml/>toml.hpp</a></li><li><a href=/toml11/docs/reference/types/>types.hpp</a></li><li><a href=/toml11/docs/reference/value_t/>value_t.hpp</a></li><li><a href=/toml11/docs/reference/value/>value.hpp</a></li><li><a href=/toml11/docs/reference/version/>version.hpp</a></li><li><a href=/toml11/docs/reference/visit/>visit.hpp</a></li></ul></li><li><a href=/toml11/docs/changelog/ class=active>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>changelog</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=#change-log>Change Log</a></li><li><a href=#v440>v4.4.0</a><ul><li><a href=#added>Added</a></li><li><a href=#fixed>Fixed</a></li><li><a href=#changed>Changed</a></li></ul></li><li><a href=#v430>v4.3.0</a><ul><li><a href=#added-1>Added</a></li><li><a href=#fixed-1>Fixed</a></li><li><a href=#changed-1>Changed</a></li></ul></li><li><a href=#v420>v4.2.0</a><ul><li><a href=#added-2>Added</a></li><li><a href=#fixed-2>Fixed</a></li></ul></li><li><a href=#v410>v4.1.0</a><ul><li><a href=#added-3>Added</a></li><li><a href=#fixed-3>Fixed</a></li><li><a href=#changed-2>Changed</a></li></ul></li><li><a href=#v403>v4.0.3</a><ul><li><a href=#fixed-4>Fixed</a></li><li><a href=#changed-3>Changed</a></li></ul></li><li><a href=#v402>v4.0.2</a><ul><li><a href=#fixed-5>Fixed</a></li><li><a href=#changed-4>Changed</a></li></ul></li><li><a href=#v401>v4.0.1</a><ul><li><a href=#fixed-6>Fixed</a></li><li><a href=#added-4>Added</a></li></ul></li><li><a href=#changes-from-v3-to-v4>Changes from v3 to v4</a><ul><li><a href=#breaking-changes>Breaking Changes</a><ul><li><a href=#changed-template-parameters-of-tomlbasic_value>Changed <code>template</code> Parameters of <code>toml::basic_value</code></a></li><li><a href=#removed-stdinitializer_list-support-for-tomlbasic_value>Removed <code>std::initializer_list</code> Support for <code>toml::basic_value</code></a></li><li><a href=#renamed-tomlbasic_valueis_uninitialized-to-is_empty>Renamed <code>toml::basic_value::is_uninitialized()</code> to <code>is_empty()</code></a></li><li><a href=#added-format-information-and-removed-tomlstring>Added Format Information and Removed <code>toml::string</code></a></li><li><a href=#changed-arguments-of-tomlformat>Changed Arguments of <code>toml::format</code></a></li><li><a href=#changed-member-functions-of-tomlsource_location>Changed Member Functions of <code>toml::source_location</code></a></li><li><a href=#renamed-tomlformat_underline-to-tomlformat_location>Renamed <code>toml::format_underline</code> to <code>toml::format_location</code></a></li></ul></li><li><a href=#changed-arguments-of-tomlformat_error>Changed Arguments of <code>toml::format_error</code></a><ul><li><a href=#changed-control-of-tomlcolor>Changed Control of <code>toml::color</code></a></li></ul></li><li><a href=#non-breaking-changes>Non-Breaking Changes</a><ul><li><a href=#added-parse_str>Added <code>parse_str</code></a></li><li><a href=#added-try_parse>Added <code>try_parse</code></a></li><li><a href=#support-for-parsing-byte-sequences>Support for Parsing Byte Sequences</a></li><li><a href=#added-tomlspec>Added <code>toml::spec</code></a></li><li><a href=#added-format-information>Added Format Information</a></li><li><a href=#changed-to-preserve_comments-by-default>Changed to <code>preserve_comments</code> by Default</a></li><li><a href=#changed-to-preserve-comments-by-default>Changed to Preserve Comments by Default</a></li><li><a href=#added-single_includetomlhpp>Added <code>single_include/toml.hpp</code></a></li><li><a href=#option-to-use-precompiled-library>Option to Use Precompiled Library</a></li><li><a href=#reference-documentation>Reference Documentation</a></li></ul></li></ul></li></ul></nav></aside></header><article class="markdown book-article"><h1 id=change-log>Change Log
|
||||
<a class=anchor href=#change-log>#</a></h1><h1 id=v440>v4.4.0
|
||||
<a class=anchor href=#v440>#</a></h1><h2 id=added>Added
|
||||
<a class=anchor href=#added>#</a></h2><ul><li>Add <code>toml::find_or_default()</code> (#280) (by Ken Matsui @ken-matsui)</li><li>Add <code>erase</code> to <code>ordered_map</code> (#282) (#283) (by Sunlight @SunPodder)</li><li>Add <code>bool basic_value::accessed() const</code> to detect whether the value has been accessed<ul><li>enabled only if <code>TOML11_ENABLE_ACCESS_CHECK</code> is defined</li></ul></li><li>Add compare operators to <code>toml::spec</code></li></ul><h2 id=fixed>Fixed
|
||||
<a class=anchor href=#fixed>#</a></h2><ul><li>Use <code>is_void<T></code> instead of <code>is_same<T, void></code> (#281) (by Ken Matsui @ken-matsui)</li></ul><h2 id=changed>Changed
|
||||
<a class=anchor href=#changed>#</a></h2><ul><li>Improve <code>toml::parse</code> performance by 2x</li><li>Stop using deprecated Ubuntu 20 image on GitHub Actions</li></ul><h1 id=v430>v4.3.0
|
||||
<a class=anchor href=#v430>#</a></h1><h2 id=added-1>Added
|
||||
<a class=anchor href=#added-1>#</a></h2><ul><li>Support <code>std::optional</code> as a template argument of <code>toml::find</code></li><li>Support multiple arguments <code>toml::visit(visitor, args...)</code></li></ul><h2 id=fixed-1>Fixed
|
||||
<a class=anchor href=#fixed-1>#</a></h2><ul><li><code>toml::detail::region::last_</code> may be used uninitialized (#267) (#268) (by amatej @kontura)</li><li>Fix use with CMake 3.21 and older (#271) (by Severin Leonhardt @SeverinLeonhardt)</li><li>fix: prevent size_t-max length string allocation (#275) (#276) (by @hayt)</li><li>update README.md (#277) (by somebody @oldoldtea) (by lz)</li><li>Make parsing faster for very long line (#278)</li><li>Avoid known problem in MSVC (#279)</li><li>Check if <code>source_location::file_name()</code> is null before formatting</li></ul><h2 id=changed-1>Changed
|
||||
<a class=anchor href=#changed-1>#</a></h2><ul><li>Update hugo-book theme</li><li>Add MSVC 2017 to appveyor build</li></ul><h1 id=v420>v4.2.0
|
||||
<a class=anchor href=#v420>#</a></h1><h2 id=added-2>Added
|
||||
<a class=anchor href=#added-2>#</a></h2><ul><li>Support <code>std::optional</code> members for <code>TOML11_DEFINE_CONVERSION_NON_INTRUSIVE</code> (by Ken Matsui)</li><li>Make <code>thread_local</code> for <code>color_mode</code> optional (by Ken Matsui)</li><li>add usage with CPM to README</li><li>add explanation about <code>ordered_map</code> to README and update doc</li></ul><h2 id=fixed-2>Fixed
|
||||
<a class=anchor href=#fixed-2>#</a></h2><ul><li>Manually cast file size to <code>std::streamsize</code> (by Pino Toscano)</li><li>Typographical error in <code>table_format</code> output</li><li>Format an empty array specified as array-of-table in one line</li><li>Added a missing include file</li><li>Fix typos in documentation template syntax (by Jack W)</li><li>Fix <code>toml::find_or</code> for deeply nested tables</li></ul><h1 id=v410>v4.1.0
|
||||
<a class=anchor href=#v410>#</a></h1><h2 id=added-3>Added
|
||||
<a class=anchor href=#added-3>#</a></h2><ul><li>support <code>std::get<std::u8string></code></li><li>support <code>toml::value(std::u8string)</code></li><li>support <code>string_type = std::u8string</code></li><li>support <code>operator<<(std::ostream&, toml::value)</code></li><li>add <code>bool uppercase</code> to <code>toml::integer_format</code></li><li>support <code>template into_toml()</code> (by 萧迩珀)</li></ul><h2 id=fixed-3>Fixed
|
||||
<a class=anchor href=#fixed-3>#</a></h2><ul><li>Fix not checking for <code>\r\n</code> when parsing line comments (by Andreas Keller)</li></ul><h2 id=changed-2>Changed
|
||||
<a class=anchor href=#changed-2>#</a></h2><ul><li>speedup CI tests by multicore build</li></ul><h1 id=v403>v4.0.3
|
||||
<a class=anchor href=#v403>#</a></h1><h2 id=fixed-4>Fixed
|
||||
<a class=anchor href=#fixed-4>#</a></h2><ul><li>remove default template argument from forward declaration in <code>toml_fwd.hpp</code></li><li>enable to call <code>toml::make_error_info</code> with multiple <code>toml::value</code>s</li><li>enable to copy/move <code>toml::result</code> having <code>std::reference_wrapper</code></li><li>fix document generation error with the latest version of hugo</li><li>fix several tiny errors that causes warning</li><li>fix CMake compatibility warning</li></ul><h2 id=changed-3>Changed
|
||||
<a class=anchor href=#changed-3>#</a></h2><p>add <code>-Werror</code> / <code>/WX</code> to build script
|
||||
set MSVC warning level to <code>/W4</code>
|
||||
add explanation of features to README</p><h1 id=v402>v4.0.2
|
||||
<a class=anchor href=#v402>#</a></h1><h2 id=fixed-5>Fixed
|
||||
<a class=anchor href=#fixed-5>#</a></h2><ul><li>check return value of fread in <code>parse(FILE*)</code></li><li>version macro defined in <code>toml11/version.hpp</code></li><li>update docs about compilation</li><li>update docs about file open mode</li></ul><h2 id=changed-4>Changed
|
||||
<a class=anchor href=#changed-4>#</a></h2><ul><li>use version macros defined in <code>toml11/version.hpp</code> as the project version in <code>CMakeLists.txt</code></li></ul><h1 id=v401>v4.0.1
|
||||
<a class=anchor href=#v401>#</a></h1><h2 id=fixed-6>Fixed
|
||||
<a class=anchor href=#fixed-6>#</a></h2><ul><li>Resolved naming conflict of <code>sematic_version::{major, minor}</code> with macros defined in <code><sys/sysmacro.h></code></li><li>Fixed the definition of <code>operator<<</code> in <code>discard_comments</code> (by Egor Pugin)</li><li>Fixed the issue where the first blank line was not output in <code>format_location</code></li><li>Fixed the issue where error messages pointing to <code>source_location</code> referring to lines containing only newline characters were displayed in two lines</li><li>Corrected links in the README</li><li>Corrected the title of the README in <code>example/unicode</code></li></ul><h2 id=added-4>Added
|
||||
<a class=anchor href=#added-4>#</a></h2><ul><li>Configured CI to automatically update <code>single_include/toml.hpp</code> when changes are made to <code>main</code></li></ul><h1 id=changes-from-v3-to-v4>Changes from v3 to v4
|
||||
<a class=anchor href=#changes-from-v3-to-v4>#</a></h1><h2 id=breaking-changes>Breaking Changes
|
||||
<a class=anchor href=#breaking-changes>#</a></h2><h3 id=changed-template-parameters-of-tomlbasic_value>Changed <code>template</code> Parameters of <code>toml::basic_value</code>
|
||||
<a class=anchor href=#changed-template-parameters-of-tomlbasic_value>#</a></h3><p>In toml11 v3, <code>toml::basic_value</code> took separate template arguments for the comment container, table-type container, and array-type container.</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> Comment,
|
||||
</span></span><span style=display:flex><span> <span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> ...<span style=color:#f92672>></span> <span style=color:#66d9ef>class</span> <span style=color:#a6e22e>Table</span> <span style=color:#f92672>=</span> std<span style=color:#f92672>::</span>unordered_map,
|
||||
</span></span><span style=display:flex><span> <span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> ...<span style=color:#f92672>></span> <span style=color:#66d9ef>class</span> <span style=color:#a6e22e>Array</span> <span style=color:#f92672>=</span> std<span style=color:#f92672>::</span>vector<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></code></pre></div><p>However, this approach does not accommodate changes to types such as <code>integer_type</code>.</p><p>In toml11 v4, <code>toml::basic_value</code> now accepts a single <code>TypeConfig</code>, allowing for more types to be customized.</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> TypeConfig<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></code></pre></div><p>By default, the types stored in <code>toml::value</code> remain unchanged.</p><p>For more information on changing types, please refer to the
|
||||
<a href=https://toruniina.github.io/toml11/docs/reference/types/><code>type_config</code></a> documentation.</p><h3 id=removed-stdinitializer_list-support-for-tomlbasic_value>Removed <code>std::initializer_list</code> Support for <code>toml::basic_value</code>
|
||||
<a class=anchor href=#removed-stdinitializer_list-support-for-tomlbasic_value>#</a></h3><p>In toml11 v3, there was an overload for <code>toml::value</code> that accepted <code>std::initializer_list</code>. This allowed for more intuitive initialization of <code>toml::value</code> with arrays and tables.</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:#75715e>// toml11 v3
|
||||
</span></span></span><span style=display:flex><span><span style=color:#75715e></span>toml<span style=color:#f92672>::</span>value v{<span style=color:#ae81ff>1</span>,<span style=color:#ae81ff>2</span>,<span style=color:#ae81ff>3</span>,<span style=color:#ae81ff>4</span>,<span style=color:#ae81ff>5</span>};
|
||||
</span></span><span style=display:flex><span>toml<span style=color:#f92672>::</span>value v{ {<span style=color:#e6db74>"a"</span>, <span style=color:#ae81ff>42</span>}, {<span style=color:#e6db74>"b"</span>, <span style=color:#e6db74>"foo"</span>} };
|
||||
</span></span></code></pre></div><p>However, this caused the following issues:</p><p>First, it was impossible to distinguish between a single-element array and a regular value, as it always became an array.</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:#75715e>// toml11 v3
|
||||
</span></span></span><span style=display:flex><span><span style=color:#75715e></span>toml<span style=color:#f92672>::</span>value v{<span style=color:#ae81ff>1</span>}; <span style=color:#75715e>// Becomes [1,] instead of 1
|
||||
</span></span></span></code></pre></div><p>With the widespread use of uniform initialization, this became very inconvenient.</p><p>Second, it was unclear whether the value represented a table with all string values or a nested array.</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:#75715e>// toml11 v3
|
||||
</span></span></span><span style=display:flex><span><span style=color:#75715e></span>toml<span style=color:#f92672>::</span>value v{ {<span style=color:#e6db74>"a"</span>, <span style=color:#e6db74>"foo"</span>}, {<span style=color:#e6db74>"b"</span>, <span style=color:#e6db74>"bar"</span>} };
|
||||
</span></span><span style=display:flex><span><span style=color:#75715e>// Could be either:
|
||||
</span></span></span><span style=display:flex><span><span style=color:#75715e>// {a = "foo", b = "bar"}
|
||||
</span></span></span><span style=display:flex><span><span style=color:#75715e>// [["a", "foo"], ["b", "bar"]]
|
||||
</span></span></span></code></pre></div><p>These issues were difficult to resolve due to language specifications.</p><p>To avoid confusion, toml11 v4 has removed <code>std::initializer_list</code> support.</p><p>When initializing <code>toml::value</code> with an array, you must explicitly specify <code>toml::array</code>, and when initializing with a table, you must explicitly specify <code>toml::table</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:#75715e>// toml11 v4
|
||||
</span></span></span><span style=display:flex><span><span style=color:#75715e></span>toml<span style=color:#f92672>::</span>value v(toml<span style=color:#f92672>::</span>array{<span style=color:#ae81ff>1</span>,<span style=color:#ae81ff>2</span>,<span style=color:#ae81ff>3</span>,<span style=color:#ae81ff>4</span>,<span style=color:#ae81ff>5</span>});
|
||||
</span></span><span style=display:flex><span>toml<span style=color:#f92672>::</span>value v(toml<span style=color:#f92672>::</span>table{ {<span style=color:#e6db74>"a"</span>, <span style=color:#ae81ff>42</span>}, {<span style=color:#e6db74>"b"</span>, <span style=color:#e6db74>"foo"</span>} });
|
||||
</span></span><span style=display:flex><span>
|
||||
</span></span><span style=display:flex><span>toml<span style=color:#f92672>::</span>value v{toml<span style=color:#f92672>::</span>array{<span style=color:#ae81ff>1</span>}}; <span style=color:#75715e>// [1,]
|
||||
</span></span></span><span style=display:flex><span><span style=color:#75715e></span>toml<span style=color:#f92672>::</span>value v{<span style=color:#ae81ff>1</span>} <span style=color:#75715e>// 1
|
||||
</span></span></span><span style=display:flex><span><span style=color:#75715e></span>
|
||||
</span></span><span style=display:flex><span>toml<span style=color:#f92672>::</span>value v{toml<span style=color:#f92672>::</span>table{{<span style=color:#e6db74>"a"</span>, <span style=color:#e6db74>"foo"</span>}, {<span style=color:#e6db74>"b"</span>, <span style=color:#e6db74>"bar"</span>}}};
|
||||
</span></span><span style=display:flex><span>toml<span style=color:#f92672>::</span>value v{toml<span style=color:#f92672>::</span>array{toml<span style=color:#f92672>::</span>array{<span style=color:#e6db74>"a"</span>, <span style=color:#e6db74>"foo"</span>}, toml<span style=color:#f92672>::</span>array{<span style=color:#e6db74>"b"</span>, <span style=color:#e6db74>"bar"</span>}}};
|
||||
</span></span></code></pre></div><p>While this makes initializing <code>toml::value</code> with tables or arrays slightly less convenient, it ensures that the values will not become unpredictable by requiring explicit type information.</p><h3 id=renamed-tomlbasic_valueis_uninitialized-to-is_empty>Renamed <code>toml::basic_value::is_uninitialized()</code> to <code>is_empty()</code>
|
||||
<a class=anchor href=#renamed-tomlbasic_valueis_uninitialized-to-is_empty>#</a></h3><p>In toml11 v3, the function to check whether a <code>basic_value</code> was uninitialized was called <code>is_uninitialized</code>.</p><p>However, in toml11 v4, the library supports <code>null</code> values as an extension, allowing for the intentional construction of empty values.
|
||||
Therefore, the function has been renamed to <code>is_empty</code> to reflect this change.</p><h3 id=added-format-information-and-removed-tomlstring>Added Format Information and Removed <code>toml::string</code>
|
||||
<a class=anchor href=#added-format-information-and-removed-tomlstring>#</a></h3><p>In toml11 v3, to retain information on whether a string was <code>basic</code> or <code>literal</code>, the library used a thin wrapper around <code>std::string</code> called <code>toml::string</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:#75715e>// toml11 v3
|
||||
</span></span></span><span style=display:flex><span><span style=color:#75715e></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>enum</span> <span style=color:#66d9ef>class</span> <span style=color:#a6e22e>string_t</span> <span style=color:#f92672>:</span> std<span style=color:#f92672>::</span><span style=color:#66d9ef>uint8_t</span>
|
||||
</span></span><span style=display:flex><span>{
|
||||
</span></span><span style=display:flex><span> basic <span style=color:#f92672>=</span> <span style=color:#ae81ff>0</span>,
|
||||
</span></span><span style=display:flex><span> literal <span style=color:#f92672>=</span> <span style=color:#ae81ff>1</span>,
|
||||
</span></span><span style=display:flex><span>};
|
||||
</span></span><span style=display:flex><span>
|
||||
</span></span><span style=display:flex><span><span style=color:#66d9ef>struct</span> <span style=color:#a6e22e>string</span>
|
||||
</span></span><span style=display:flex><span>{
|
||||
</span></span><span style=display:flex><span> string_t kind;
|
||||
</span></span><span style=display:flex><span> std<span style=color:#f92672>::</span>string str;
|
||||
</span></span><span style=display:flex><span>};
|
||||
</span></span><span style=display:flex><span>} <span style=color:#75715e>// namespace toml
|
||||
</span></span></span></code></pre></div><p>In toml11 v4, to accommodate more format information such as the numeric base or whether arrays should be multiline, every type now has an associated <code>xxx_format</code> type, which is stored alongside the value.</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:#75715e>// toml11 v4
|
||||
</span></span></span><span style=display:flex><span><span style=color:#75715e></span><span style=color:#66d9ef>enum</span> <span style=color:#66d9ef>class</span> <span style=color:#a6e22e>string_format</span> <span style=color:#f92672>:</span> std<span style=color:#f92672>::</span><span style=color:#66d9ef>uint8_t</span>
|
||||
</span></span><span style=display:flex><span>{
|
||||
</span></span><span style=display:flex><span> basic <span style=color:#f92672>=</span> <span style=color:#ae81ff>0</span>,
|
||||
</span></span><span style=display:flex><span> literal <span style=color:#f92672>=</span> <span style=color:#ae81ff>1</span>,
|
||||
</span></span><span style=display:flex><span> multiline_basic <span style=color:#f92672>=</span> <span style=color:#ae81ff>2</span>,
|
||||
</span></span><span style=display:flex><span> multiline_literal <span style=color:#f92672>=</span> <span style=color:#ae81ff>3</span>
|
||||
</span></span><span style=display:flex><span>};
|
||||
</span></span><span style=display:flex><span>
|
||||
</span></span><span style=display:flex><span><span style=color:#66d9ef>struct</span> <span style=color:#a6e22e>string_format_info</span>
|
||||
</span></span><span style=display:flex><span>{
|
||||
</span></span><span style=display:flex><span> string_format fmt <span style=color:#f92672>=</span> string_format<span style=color:#f92672>::</span>basic;
|
||||
</span></span><span style=display:flex><span> <span style=color:#66d9ef>bool</span> start_with_newline <span style=color:#f92672>=</span> false;
|
||||
</span></span><span style=display:flex><span>};
|
||||
</span></span></code></pre></div><p>This change allows for more detailed format information to be preserved, ensuring that format specifics for numeric types, arrays, and tables are maintained even after parsing.</p><h3 id=changed-arguments-of-tomlformat>Changed Arguments of <code>toml::format</code>
|
||||
<a class=anchor href=#changed-arguments-of-tomlformat>#</a></h3><p>In toml11 v3, <code>toml::format</code> accepted values such as the precision and width of numeric types.</p><p>However, this approach did not allow for detailed formatting specifications, resulting in serialized files that did not match expectations.</p><p>In toml11 v4, each <code>toml::value</code> now carries its own format information, enabling more detailed formatting options to be preserved within the <code>toml::value</code> itself.</p><p>As a result, <code>toml::format</code> no longer accepts specific formatting values. Instead, it now only takes a <code>toml::spec</code>, which includes language feature flags used during formatting.</p><h3 id=changed-member-functions-of-tomlsource_location>Changed Member Functions of <code>toml::source_location</code>
|
||||
<a class=anchor href=#changed-member-functions-of-tomlsource_location>#</a></h3><p>In toml11 v3, the member types of <code>toml::source_location</code> were designed to handle only single lines.</p><p>In toml11 v4, the member types of <code>toml::source_location</code> are designed to handle multiple lines.</p><h3 id=renamed-tomlformat_underline-to-tomlformat_location>Renamed <code>toml::format_underline</code> to <code>toml::format_location</code>
|
||||
<a class=anchor href=#renamed-tomlformat_underline-to-tomlformat_location>#</a></h3><p>In toml11 v3, the function used to format location information from <code>toml::source_location</code> was called <code>toml::format_underline</code>.</p><p>To make the name clearer, it has been renamed to <code>toml::format_location</code>.</p><h2 id=changed-arguments-of-tomlformat_error>Changed Arguments of <code>toml::format_error</code>
|
||||
<a class=anchor href=#changed-arguments-of-tomlformat_error>#</a></h2><p>In toml11 v3, there was no class to represent error information, resulting in complex arguments for <code>toml::format_error</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> C, <span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> ...<span style=color:#f92672>></span> <span style=color:#66d9ef>class</span> <span style=color:#a6e22e>T</span>, <span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> ...<span style=color:#f92672>></span> <span style=color:#66d9ef>class</span> <span style=color:#a6e22e>A</span><span style=color:#f92672>></span>
|
||||
</span></span><span style=display:flex><span>std<span style=color:#f92672>::</span>string format_error(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> err_msg,
|
||||
</span></span><span style=display:flex><span> <span style=color:#66d9ef>const</span> basic_value<span style=color:#f92672><</span>C, T, A<span style=color:#f92672>>&</span> v, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> comment,
|
||||
</span></span><span style=display:flex><span> std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> hints <span style=color:#f92672>=</span> {},
|
||||
</span></span><span style=display:flex><span> <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>bool</span> colorize <span style=color:#f92672>=</span> TOML11_ERROR_MESSAGE_COLORIZED);
|
||||
</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> C, <span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> ...<span style=color:#f92672>></span> <span style=color:#66d9ef>class</span> <span style=color:#a6e22e>T</span>, <span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> ...<span style=color:#f92672>></span> <span style=color:#66d9ef>class</span> <span style=color:#a6e22e>A</span><span style=color:#f92672>></span>
|
||||
</span></span><span style=display:flex><span><span style=color:#66d9ef>inline</span> std<span style=color:#f92672>::</span>string format_error(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> err_msg,
|
||||
</span></span><span style=display:flex><span> <span style=color:#66d9ef>const</span> toml<span style=color:#f92672>::</span>basic_value<span style=color:#f92672><</span>C, T, A<span style=color:#f92672>>&</span> v1, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> comment1,
|
||||
</span></span><span style=display:flex><span> <span style=color:#66d9ef>const</span> toml<span style=color:#f92672>::</span>basic_value<span style=color:#f92672><</span>C, T, A<span style=color:#f92672>>&</span> v2, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> comment2,
|
||||
</span></span><span style=display:flex><span> std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> hints <span style=color:#f92672>=</span> {},
|
||||
</span></span><span style=display:flex><span> <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>bool</span> colorize <span style=color:#f92672>=</span> TOML11_ERROR_MESSAGE_COLORIZED);
|
||||
</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> C, <span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> ...<span style=color:#f92672>></span> <span style=color:#66d9ef>class</span> <span style=color:#a6e22e>T</span>, <span style=color:#66d9ef>template</span><span style=color:#f92672><</span><span style=color:#66d9ef>typename</span> ...<span style=color:#f92672>></span> <span style=color:#66d9ef>class</span> <span style=color:#a6e22e>A</span><span style=color:#f92672>></span>
|
||||
</span></span><span style=display:flex><span><span style=color:#66d9ef>inline</span> std<span style=color:#f92672>::</span>string format_error(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> err_msg,
|
||||
</span></span><span style=display:flex><span> <span style=color:#66d9ef>const</span> toml<span style=color:#f92672>::</span>basic_value<span style=color:#f92672><</span>C, T, A<span style=color:#f92672>>&</span> v1, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> comment1,
|
||||
</span></span><span style=display:flex><span> <span style=color:#66d9ef>const</span> toml<span style=color:#f92672>::</span>basic_value<span style=color:#f92672><</span>C, T, A<span style=color:#f92672>>&</span> v2, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> comment2,
|
||||
</span></span><span style=display:flex><span> <span style=color:#66d9ef>const</span> toml<span style=color:#f92672>::</span>basic_value<span style=color:#f92672><</span>C, T, A<span style=color:#f92672>>&</span> v3, <span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> comment3,
|
||||
</span></span><span style=display:flex><span> std<span style=color:#f92672>::</span>vector<span style=color:#f92672><</span>std<span style=color:#f92672>::</span>string<span style=color:#f92672>></span> hints <span style=color:#f92672>=</span> {},
|
||||
</span></span><span style=display:flex><span> <span style=color:#66d9ef>const</span> <span style=color:#66d9ef>bool</span> colorize <span style=color:#f92672>=</span> TOML11_ERROR_MESSAGE_COLORIZED);
|
||||
</span></span></code></pre></div><p>In toml11 v4, we have introduced <code>class error_info</code> and <code>make_error_info</code>, simplifying the arguments for <code>format_error</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>std<span style=color:#f92672>::</span>string format_error(<span style=color:#66d9ef>const</span> error_info<span style=color:#f92672>&</span> err);
|
||||
</span></span><span style=display:flex><span>std<span style=color:#f92672>::</span>string format_error(<span style=color:#66d9ef>const</span> std<span style=color:#f92672>::</span>string<span style=color:#f92672>&</span> errkind, <span style=color:#66d9ef>const</span> error_info<span style=color:#f92672>&</span> err);
|
||||
</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> ... 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> source_location loc, std<span style=color:#f92672>::</span>string msg, Ts<span style=color:#f92672>&&</span> ... tail);
|
||||
</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> 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><h3 id=changed-control-of-tomlcolor>Changed Control of <code>toml::color</code>
|
||||
<a class=anchor href=#changed-control-of-tomlcolor>#</a></h3><p>In toml11 v3, to control whether to colorize the output, we used the manipulator <code>toml::colorize</code> in conjunction with <code>toml::color::enable/disable</code>.</p><p>The manipulator allowed us to decide whether to apply color to each stream,
|
||||
but in v4, the frequency of using streams has decreased,
|
||||
and issues such as the fact that <code>std::ios_base::xalloc</code> used internally is not thread-safe in C++11 have arisen.
|
||||
Therefore, we have decided to use only <code>toml::color::enable/disable</code> and have removed <code>toml::colorize</code>.</p><h2 id=non-breaking-changes>Non-Breaking Changes
|
||||
<a class=anchor href=#non-breaking-changes>#</a></h2><h3 id=added-parse_str>Added <code>parse_str</code>
|
||||
<a class=anchor href=#added-parse_str>#</a></h3><p>In toml11 v3, there was no function to directly parse a string itself.
|
||||
Therefore, when parsing a string, it was necessary to use <code>std::istringstream</code>.</p><p>To address this inconvenience, we have added <code>toml::parse_str</code>, allowing for direct parsing of strings.</p><h3 id=added-try_parse>Added <code>try_parse</code>
|
||||
<a class=anchor href=#added-try_parse>#</a></h3><p>In toml11 v3, when a parser encountered an error, it threw <code>toml::syntax_error</code>.</p><p>However, there are cases where you do not want to throw exceptions due to environments where exceptions cannot be thrown, or for reasons of performance.</p><p>In toml11 v4, we have implemented <code>toml::try_parse</code> using <code>toml::result</code>, which communicates parsing failures without throwing exceptions.</p><p>This doesn’t mean exceptions are never thrown. Errors in the standard library being used, such as <code>std::bad_alloc</code> due to allocation failure from memory exhaustion, may still be thrown.</p><h3 id=support-for-parsing-byte-sequences>Support for Parsing Byte Sequences
|
||||
<a class=anchor href=#support-for-parsing-byte-sequences>#</a></h3><p>To allow for parsing TOML content obtained through means other than files, we have added <code>toml::parse</code> and <code>toml::try_parse</code> functions that accept <code>std::vector<unsigned char></code>.</p><h3 id=added-tomlspec>Added <code>toml::spec</code>
|
||||
<a class=anchor href=#added-tomlspec>#</a></h3><p>In toml11 v3, all new features of the TOML language were incorporated, and features that were decided to be introduced in future versions of the TOML language were controlled by the macro <code>TOML11_USE_UNRELEASED_TOML_FEATURES</code>.</p><p>This was because, at the time of developing toml11 v3, the TOML language had not yet reached version 1.0.0, being at versions 0.4.0 to 0.5.0.</p><p>As not all users are familiar with the latest TOML language specification, displaying error messages based on an older language usage could confuse the entire community. Therefore, until reaching version 1.0.0, it was necessary to provide new language specifications as quickly as possible and encourage users to update.</p><p>However, the current TOML language specification is at version 1.0.0. Therefore, there was a need to be mindful of the choice to continue using version 1.0.0 even after TOML v1.1.0 was released.</p><p>To allow for more flexibility in selecting the TOML language specification, we introduced <code>toml::spec</code>, enabling the TOML language version to be changed at runtime.</p><p>Additionally, in <code>toml::spec</code>, flags are set for each language feature, allowing for the testing of specific language features only.</p><p>This mechanism is also used for TOML-specific language extensions in toml11 v4.</p><h3 id=added-format-information>Added Format Information
|
||||
<a class=anchor href=#added-format-information>#</a></h3><p>In toml11 v3, format information was not saved except for strings, and during serialization, only width and precision were considered.</p><p>However, this resulted in hexadecimal integers being serialized as decimal integers and no reliable way to ensure inline tables.</p><p>In toml11 v4, format information (<code>integer_format</code>, etc.) has been added to all TOML types, and it is now considered during parsing and serialization.</p><p>This allows for more detailed format information to be set for values, such as hexadecimal integers or inline tables.</p><h3 id=changed-to-preserve_comments-by-default>Changed to <code>preserve_comments</code> by Default
|
||||
<a class=anchor href=#changed-to-preserve_comments-by-default>#</a></h3><p>In toml11 v3, comments were not parsed by default and were also not serialized.</p><p>This was because comments were a later introduced feature and were being read through a special hack.</p><p>In toml11 v4, comments are parsed, preserved, and serialized by default.</p><p>Furthermore, the parser implementation has been significantly changed to ensure comments are parsed alongside other elements.</p><h3 id=changed-to-preserve-comments-by-default>Changed to Preserve Comments by Default
|
||||
<a class=anchor href=#changed-to-preserve-comments-by-default>#</a></h3><p>In toml11 v3, comments were neither parsed nor serialized by default. This was because comment support was a late addition, implemented through a special hack.</p><p>In toml11 v4, comments are now parsed, preserved, and serialized by default. The parser implementation has also been significantly revised so that comments are parsed just like any other element.</p><h3 id=added-single_includetomlhpp>Added <code>single_include/toml.hpp</code>
|
||||
<a class=anchor href=#added-single_includetomlhpp>#</a></h3><p>toml11 is a versatile library with different header files for various features to enhance development efficiency. However, this required a certain amount of effort to install.</p><p>Starting with toml11 v4, a <code>single_include/toml.hpp</code> file has been added, which combines all the header files in the correct order. This allows the library to be installed by simply copying a single file.</p><h3 id=option-to-use-precompiled-library>Option to Use Precompiled Library
|
||||
<a class=anchor href=#option-to-use-precompiled-library>#</a></h3><p>Due to the extensive use of templates in toml11, compile times have been long.</p><p>In toml11 v4, the number of precompilable functions has been increased, allowing them to be compiled ahead of time into a library. This is expected to reduce compile times when using the library in large-scale development projects.</p><h3 id=reference-documentation>Reference Documentation
|
||||
<a class=anchor href=#reference-documentation>#</a></h3><p>Previously, all features were documented in the README, with no detailed function definitions or reference materials available in Japanese.</p><p>In toml11 v4, reference documentation has been included, provided in both Japanese and English. However, since the library author is a native Japanese speaker, the Japanese content is considered primary. If there are discrepancies between the Japanese and English content, the Japanese version takes precedence.</p></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=#change-log>Change Log</a></li><li><a href=#v440>v4.4.0</a><ul><li><a href=#added>Added</a></li><li><a href=#fixed>Fixed</a></li><li><a href=#changed>Changed</a></li></ul></li><li><a href=#v430>v4.3.0</a><ul><li><a href=#added-1>Added</a></li><li><a href=#fixed-1>Fixed</a></li><li><a href=#changed-1>Changed</a></li></ul></li><li><a href=#v420>v4.2.0</a><ul><li><a href=#added-2>Added</a></li><li><a href=#fixed-2>Fixed</a></li></ul></li><li><a href=#v410>v4.1.0</a><ul><li><a href=#added-3>Added</a></li><li><a href=#fixed-3>Fixed</a></li><li><a href=#changed-2>Changed</a></li></ul></li><li><a href=#v403>v4.0.3</a><ul><li><a href=#fixed-4>Fixed</a></li><li><a href=#changed-3>Changed</a></li></ul></li><li><a href=#v402>v4.0.2</a><ul><li><a href=#fixed-5>Fixed</a></li><li><a href=#changed-4>Changed</a></li></ul></li><li><a href=#v401>v4.0.1</a><ul><li><a href=#fixed-6>Fixed</a></li><li><a href=#added-4>Added</a></li></ul></li><li><a href=#changes-from-v3-to-v4>Changes from v3 to v4</a><ul><li><a href=#breaking-changes>Breaking Changes</a><ul><li><a href=#changed-template-parameters-of-tomlbasic_value>Changed <code>template</code> Parameters of <code>toml::basic_value</code></a></li><li><a href=#removed-stdinitializer_list-support-for-tomlbasic_value>Removed <code>std::initializer_list</code> Support for <code>toml::basic_value</code></a></li><li><a href=#renamed-tomlbasic_valueis_uninitialized-to-is_empty>Renamed <code>toml::basic_value::is_uninitialized()</code> to <code>is_empty()</code></a></li><li><a href=#added-format-information-and-removed-tomlstring>Added Format Information and Removed <code>toml::string</code></a></li><li><a href=#changed-arguments-of-tomlformat>Changed Arguments of <code>toml::format</code></a></li><li><a href=#changed-member-functions-of-tomlsource_location>Changed Member Functions of <code>toml::source_location</code></a></li><li><a href=#renamed-tomlformat_underline-to-tomlformat_location>Renamed <code>toml::format_underline</code> to <code>toml::format_location</code></a></li></ul></li><li><a href=#changed-arguments-of-tomlformat_error>Changed Arguments of <code>toml::format_error</code></a><ul><li><a href=#changed-control-of-tomlcolor>Changed Control of <code>toml::color</code></a></li></ul></li><li><a href=#non-breaking-changes>Non-Breaking Changes</a><ul><li><a href=#added-parse_str>Added <code>parse_str</code></a></li><li><a href=#added-try_parse>Added <code>try_parse</code></a></li><li><a href=#support-for-parsing-byte-sequences>Support for Parsing Byte Sequences</a></li><li><a href=#added-tomlspec>Added <code>toml::spec</code></a></li><li><a href=#added-format-information>Added Format Information</a></li><li><a href=#changed-to-preserve_comments-by-default>Changed to <code>preserve_comments</code> by Default</a></li><li><a href=#changed-to-preserve-comments-by-default>Changed to Preserve Comments by Default</a></li><li><a href=#added-single_includetomlhpp>Added <code>single_include/toml.hpp</code></a></li><li><a href=#option-to-use-precompiled-library>Option to Use Precompiled Library</a></li><li><a href=#reference-documentation>Reference Documentation</a></li></ul></li></ul></li></ul></nav></div></aside></main></body></html>
|
Reference in New Issue
Block a user