{"id":13495030,"url":"https://github.com/ToruNiina/toml11","last_synced_at":"2025-03-28T15:32:38.216Z","repository":{"id":37770979,"uuid":"88736062","full_name":"ToruNiina/toml11","owner":"ToruNiina","description":"TOML for Modern C++","archived":false,"fork":false,"pushed_at":"2024-10-20T18:20:44.000Z","size":4481,"stargazers_count":1035,"open_issues_count":24,"forks_count":160,"subscribers_count":19,"default_branch":"main","last_synced_at":"2024-10-29T15:48:52.501Z","etag":null,"topics":["c-plus-plus","c-plus-plus-11","c-plus-plus-14","c-plus-plus-17","c-plus-plus-20","header-only","parser","serializer","toml","toml-parser"],"latest_commit_sha":null,"homepage":"https://toruniina.github.io/toml11/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ToruNiina.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-19T11:16:11.000Z","updated_at":"2024-10-29T01:01:11.000Z","dependencies_parsed_at":"2023-10-10T17:01:19.716Z","dependency_job_id":"5ebc6eef-4ef9-4c8c-8643-184c0ed626b9","html_url":"https://github.com/ToruNiina/toml11","commit_stats":{"total_commits":1136,"total_committers":36,"mean_commits":"31.555555555555557","dds":0.08714788732394363,"last_synced_commit":"c32a20e1ee690d6e6bf6f37e6d603402d49b15f0"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToruNiina%2Ftoml11","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToruNiina%2Ftoml11/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToruNiina%2Ftoml11/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ToruNiina%2Ftoml11/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ToruNiina","download_url":"https://codeload.github.com/ToruNiina/toml11/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222389532,"owners_count":16976489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","c-plus-plus-11","c-plus-plus-14","c-plus-plus-17","c-plus-plus-20","header-only","parser","serializer","toml","toml-parser"],"created_at":"2024-07-31T19:01:30.521Z","updated_at":"2025-03-28T15:32:38.209Z","avatar_url":"https://github.com/ToruNiina.png","language":"C++","funding_links":[],"categories":["Configuration","C++","Data Formats"],"sub_categories":[],"readme":"# toml11\n\n[![Build Status on GitHub Actions](https://github.com/ToruNiina/toml11/workflows/build/badge.svg)](https://github.com/ToruNiina/toml11/actions)\n[![Build status](https://ci.appveyor.com/api/projects/status/m2n08a926asvg5mg/branch/main?svg=true)](https://ci.appveyor.com/project/ToruNiina/toml11/branch/main)\n[![Version](https://img.shields.io/github/release/ToruNiina/toml11.svg?style=flat)](https://github.com/ToruNiina/toml11/releases)\n[![License](https://img.shields.io/github/license/ToruNiina/toml11.svg?style=flat)](LICENSE)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1209136.svg)](https://doi.org/10.5281/zenodo.1209136)\n\n[日本語版](https://github.com/ToruNiina/toml11/blob/main/README_ja.md)\n\ntoml11 is a feature-rich TOML language library for C++11/14/17/20.\n\n- It complies with [the latest TOML language specification](https://toml.io/en/v1.0.0).\n- It passes all the standard TOML language [test cases](https://github.com/toml-lang/toml-test).\n- It supports new features merged into the upcoming TOML version (v1.1.0).\n- It provides clear error messages, including the location of the error.\n- It parses and retains comments, associating them with corresponding values.\n- It maintains formatting information such as hex integers and considers these during serialization.\n- It provides exception-less parse function.\n- It supports complex type conversions from TOML values.\n- It allows customization of the types stored in `toml::value`.\n- It provides some extensions not present in the TOML language standard.\n\n## Example\n\n```toml\n# example.toml\ntitle = \"an example toml file\"\nnums  = [3, 1, 4, 1, 5] # pi!\n```\n\n```cpp\n#include \u003ctoml.hpp\u003e\n#include \u003ciostream\u003e\n\nint main()\n{\n    // select TOML version at runtime (optional)\n    auto data = toml::parse(\"example.toml\", toml::spec::v(1,1,0));\n\n    // find a value with the specified type from a table\n    std::string title = toml::find\u003cstd::string\u003e(data, \"title\");\n\n    // convert the whole array into STL-like container automatically\n    std::vector\u003cint\u003e nums = toml::find\u003cstd::vector\u003cint\u003e\u003e(data, \"nums\");\n\n    // access with STL-like manner\n    if( ! data.contains(\"foo\"))\n    {\n        data[\"foo\"] = \"bar\";\n    }\n    if(data.at(\"nums\").is_array())\n    {\n        data[\"nums\"].as_array().push_back(9);\n    }\n\n    // check comments\n    assert(data.at(\"nums\").comments().at(0) == \"# pi!\");\n\n    // pass a fallback\n    std::string name = toml::find_or\u003cstd::string\u003e(data, \"name\", \"not found\");\n\n    // serialization considering format info\n    data.at(\"nums\").as_array_fmt().fmt = toml::array_format::multiline;\n    data.at(\"nums\").as_array_fmt().indent_type = toml::indent_char::space;\n    data.at(\"nums\").as_array_fmt().body_indent = 2;\n\n    std::cout \u003c\u003c toml::format(data) \u003c\u003c std::endl;\n\n    return 0;\n}\n```\n\n\nFor more details, please refer to the [documentation](https://toruniina.github.io/toml11/).\n\n## Table of Contents\n\n- [toml11](#toml11)\n  - [Example](#example)\n  - [Table of Contents](#table-of-contents)\n  - [Integration](#integration)\n    - [Single Include File](#single-include-file)\n    - [git submodule](#git-submodule)\n    - [CMake `FetchContent`](#cmake-fetchcontent)\n    - [CMake Package Manager (CPM)](#cmake-package-manager-cpm)\n    - [Install Using CMake](#install-using-cmake)\n    - [Precompile Library](#precompile-library)\n    - [Building Example](#building-example)\n    - [Building Tests](#building-tests)\n  - [Features](#features)\n    - [Parsing a File](#parsing-a-file)\n    - [finding a value](#finding-a-value)\n    - [comments](#comments)\n    - [error messages](#error-messages)\n    - [serialization](#serialization)\n    - [Configuring Types](#configuring-types)\n  - [Examples](#examples)\n  - [Changes from v3](#changes-from-v3)\n    - [Breaking Changes](#breaking-changes)\n    - [Added features](#added-features)\n  - [Contributors](#contributors)\n  - [Licensing terms](#licensing-terms)\n\n## Integration\n\nThere are several ways to use toml11.\n\nHere is a brief overview of each method. For more details, please refer to the [documentation](https://toruniina.github.io/toml11/docs/installation/).\n\n### Single Include File\n\nCopy `single_include/toml.hpp` to your preferred location and add it to your include path.\n\n### git submodule\n\nBy adding toml11 as a subdirectory using `git submodule` (or any other way),\nyou can either add `toml11/include` to your include path or use `add_subdirectory(toml11)` in your CMake project.\n\n### CMake `FetchContent`\n\nUsing `FetchContent`, you can automatically download it.\n\n```cmake\ninclude(FetchContent)\nFetchContent_Declare(\n  toml11\n  GIT_REPOSITORY https://github.com/ToruNiina/toml11.git\n  GIT_TAG        v4.4.0\n)\nFetchContent_MakeAvailable(toml11)\n\nadd_executable(main main.cpp)\ntarget_link_libraries(main PRIVATE toml11::toml11)\n```\n\n### CMake Package Manager (CPM)\n\nAfter [adding cpm to your project](https://github.com/cpm-cmake/CPM.cmake?tab=readme-ov-file#adding-cpm), you can use toml11 by doing:\n\n```cmake\ninclude(cmake/CPM.cmake)\n\nCPMAddPackage(\"gh:ToruNiina/toml11@4.4.0\")\n\n# OR\n\nCPMAddPackage(\n    NAME toml11\n    GITHUB_REPOSITORY \"ToruNiina/toml11\"\n    VERSION 4.4.0\n    OPTIONS\n    \"TOML11_PRECOMPILE ON\" # to pre-compile\n    \"TOML11_ENABLE_ACCESS_CHECK ON\" # to use value.accessed()\n    )\n\nadd_executable(main main.cpp)\ntarget_link_libraries(main PUBLIC toml11::toml11)\n```\n\n### Install Using CMake\n\nYou can install toml11 using CMake with the following steps:\n\n```console\n$ git clone https://github.com/ToruNiina/toml11\n$ cd toml11\n$ git submodule update --init --recursive\n$ cmake -B ./build/\n$ cmake --build ./build/\n$ cmake --install ./build/ --prefix /path/to/toml11\n```\n\n### Precompile Library\n\nBy setting `-DTOML11_PRECOMPILE=ON`, you can precompile some of the library functions.\nIn this case, the standard library features available will vary with the C++ version, and part of the interface will change.\nTherefore, you need to specify `CMAKE_CXX_STANDARD`.\n\n```console\n$ cmake -B ./build/ -DTOML11_PRECOMPILE=ON -DCMAKE_CXX_STANDARD=11/14/17/20\n$ cmake --build ./build/\n```\n\nWhen linking the library, use `target_link_libraries` in CMake\n\n```cmake\ntarget_link_libraries(your_target PUBLIC toml11::toml11)\n```\n\nor pass `-DTOML11_COMPILE_SOURCES` to the compiler.\n\n### Building Example\n\nTo compile the examples in the `examples/` directory, set `-DTOML11_BUILD_EXAMPLES=ON`.\n\n```console\n$ cmake -B ./build/ -DTOML11_BUILD_EXAMPLES=ON\n$ cmake --build ./build/\n```\n\n### Building Tests\n\nTo compile unit tests, set `-DTOML11_BUILD_TESTS=ON`.\nAdditionally, to compile the encoder and decoder for toml-test, set `-DTOML11_BUILD_TOML_TESTS=ON`.\n\n```console\n$ cmake -B ./build/ -DTOML11_BUILD_EXAMPLES=ON\n$ cmake --build ./build/\n```\n\n## Features\n\nHere is a brief overview of the features provided by toml11.\n\nFor more details, please refer to the [documentation](https://toruniina.github.io/toml11/docs/features/).\n\n### Parsing a File\n\nTo parse a file, use `toml::parse`.\n\nThe overall type of the file is always a table.\nHowever, since `toml::value` contains metadata such as comments and formatting information,\n`toml::parse` returns a `toml::value` rather than a `toml::table`.\n\n```cpp\nconst toml::value input = toml::parse(\"input.toml\");\n```\n\nTo parse a string directly, use `toml::parse_str`.\n\n```cpp\nconst toml::value input = toml::parse_str(\"a = 42\");\n```\n\nWhen parsing string literals, you can use the `\"\"_toml` literal.\n\n```cpp\nusing namespace toml::literals::toml_literals;\nconst toml::value lit = \"a = 42\"_toml;\n```\n\n`toml::parse`, `parse_str` and `_toml` literal throw a `toml::syntax_error` exception in case of a syntax error.\n\nThe error message obtained with `what()` will look like this:\n\n```\n[error] bad integer: `_` must be surrounded by digits\n --\u003e internal string at line 64 in file main.cpp\n   |\n 1 | a = 123__456\n   |        ^-- invalid underscore\nHint: valid  : -42, 1_000, 1_2_3_4_5, 0xC0FFEE, 0b0010, 0o755\nHint: invalid: _42, 1__000, 0123\n```\n\nError messages can also be colorized by calling `toml::color::enable()`.\n\nBy using `toml::try_parse`, you can receive a `toml::result\u003ctoml::value, std::vector\u003ctoml::error_info\u003e\u003e` without throwing exceptions.\n\n```cpp\nconst auto input = toml::try_parse(\"input.toml\");\nif(input.is_ok())\n{\n    std::cout \u003c\u003c input.unwrap().at(\"a\").as_integer() \u003c\u003c std::endl;\n}\n```\n\nAdditionally, toml11 allows easy and precise control over the version of the TOML language being used.\n\nYou can enable specific new features from TOML v1.1.0 while using TOML v1.0.0.\n\n```cpp\ntoml::spec s = toml::spec::v(1, 0, 0);\ns.v1_1_0_allow_trailing_comma_in_inline_tables = true;\n\nconst toml::value input = toml::parse(\"input.toml\");\n```\n\nMoreover, several language extensions not included in the TOML standard are available.\n\n```cpp\ntoml::spec s = toml::spec::v(1, 0, 0);\ns.ext_hex_float  = true; // this allows hexadecimal floating-point numbers\ns.ext_null_value = true; // this allows `key = null` value\ns.ext_num_suffix = true; // this allows numeric suffixes like `100_msec`\n```\n\nFor more detail and reference of each feature, please refer to the [documentation](https://toruniina.github.io/toml11/docs/features/).\n\n### finding a value\n\n`toml::value` provides member functions for accessing values, such as `at()`, `is_xxx()`, and `as_xxx()`.\n\n```cpp\nconst toml::value input = toml::parse(\"input.toml\");\nif(input.contains(\"a\") \u0026\u0026 input.at(\"a\").is_integer())\n{\n    std::cout \u003c\u003c input.at(\"a\").as_integer() \u003c\u003c std::endl;\n}\n```\n\nBy using `toml::find`, you can perform type conversion and search simultaneously.\n\n```cpp\nconst toml::value input = toml::parse(\"input.toml\");\nstd::cout \u003c\u003c toml::find\u003cint\u003e(input, \"a\") \u003c\u003c std::endl;\n```\n\nIf type conversion or value lookup fails, a `toml::type_error` is thrown. The error message will look like this:\n\n```\n[error] toml::value::as_string(): bad_cast to string\n --\u003e input.toml\n   |\n 1 | a = 123_456\n   |     ^^^^^^^-- the actual type is integer\n```\n\nYou can access nested tables or arrays of tables in the same way.\n\n```cpp\n// [a]\n// b = [\n//   {c = 42},\n//   {c = 54}\n// ]\nconst toml::value input = toml::parse(\"input.toml\");\nstd::cout \u003c\u003c toml::find\u003cint\u003e(input, \"a\", \"b\", 1, \"c\") \u003c\u003c std::endl;\n```\n\nMost STL containers and those with similar interfaces can be converted.\n\n```cpp\n// array = [3,1,4,1,5]\nconst toml::value input = toml::parse(\"input.toml\");\n\nconst auto a1 = toml::find\u003cstd::vector\u003cint\u003e\u003e(input, \"array\");\nconst auto a2 = toml::find\u003cstd::array\u003cint, 5\u003e\u003e(input, \"array\");\nconst auto a3 = toml::find\u003cstd::deque\u003cint\u003e\u003e(input, \"array\");\nconst auto a4 = toml::find\u003cboost::container::small_vector\u003cint, 8\u003e\u003e(input, \"array\");\n```\n\nYou can perform advanced type conversions on complex TOML values.\n\n```toml\nmixed_array = [\n    42,\n    3.14,\n    {a = \"foo\", b = \"bar\"}\n]\n```\n\n```cpp\nconst toml::value input = toml::parse(\"input.toml\");\n\nconst auto mixed = toml::find\u003c\n        std::tuple\u003cint, double, std::map\u003cstd::string, std::string\u003e\u003e\n    \u003e(input, \"mixed_array\") \u003c\u003c std::endl;\n```\n\nUser-defined types can also be converted by using macros or defining some specific functions.\n\n```cpp\nnamespace extlib\n{\nstruct foo\n{\n    int a;\n    std::string b;\n};\n} // extlib\nTOML11_DEFINE_CONVERSION_NON_INTRUSIVE(extlib::foo, a, b)\n\n// ...\n\nconst auto input = R\"(\n  [foo]\n  a = 42\n  b = \"bar\"\n)\"_toml;\nconst extlib::foo f = toml::find\u003cextlib::foo\u003e(input, \"foo\");\n```\n\nUsing `toml::find_or`, you can get a default value in case of failure.\n\n```cpp\nconst toml::value input = toml::parse(\"input.toml\");\nstd::cout \u003c\u003c toml::find_or(input, \"a\", 6*9) \u003c\u003c std::endl;\n```\n\nFor more details, please refer to the [documentation](https://toruniina.github.io/toml11/docs/features/value/).\n\n### comments\n\ntoml11 stores comments related to values within the value itself.\n\nComments related to a value include a series of comments written immediately before the value\nand any comments written after the value without a newline in between.\n\n```toml\n# This is a comment for a.\n# This is also a comment for a.\na = 42 # This is also a comment for a.\n\n# This is separated by a newline, so it is not a comment for b.\n\n# This is a comment for b.\nb = \"foo\"\n```\n\nThese comments are stored in `toml::value` with an interface similar to `std::vector\u003cstd::string\u003e`.\n\n```cpp\nconst toml::value input = toml::parse(\"input.toml\");\nstd::cout \u003c\u003c input.at(\"a\").comments().size() \u003c\u003c std::endl;\nstd::cout \u003c\u003c input.at(\"a\").comments().at(0) \u003c\u003c std::endl;\n```\n\nFor more details, please refer to the [documentation](https://toruniina.github.io/toml11/docs/features/value/#accessing-comments).\n\n### error messages\n\nOne of the goals of toml11 is to provide clear and understandable error messages.\n\nFor parsing errors, you might see an error message like the following:\n\n```\n[error] bad integer: `_` must be surrounded by digits\n --\u003e internal string at line 64 in file main.cpp\n   |\n 1 | a = 123__456\n   |        ^-- invalid underscore\nHint: valid  : -42, 1_000, 1_2_3_4_5, 0xC0FFEE, 0b0010, 0o755\nHint: invalid: _42, 1__000, 0123\n```\n\nIf you request a type different from the actual stored type, an error message like this will be displayed:\n\n```\n[error] toml::value::as_string(): bad_cast to string\n --\u003e input.toml\n   |\n 1 | a = 123_456\n   |     ^^^^^^^-- the actual type is integer\n```\n\nSuch error messages can also be produced for user-specific algorithm that is not related to TOML syntax.\n\n```cpp\nconst toml::value\u0026 a = input.at(\"a\");\nif(a.as_integer() \u003c 0)\n{\n    const toml::error_info err = toml::make_error_info(\n            \"positive integer is required\",\n            a, \"but got negative value\"\n        );\n    std::cerr \u003c\u003c toml::format_error(err) \u003c\u003c std::endl;\n}\n```\n\nFor more details, please refer to the [documentation](https://toruniina.github.io/toml11/docs/features/error_message/).\n\n### serialization\n\nYou can format a `toml::value` into a `std::string` using `toml::format`.\n\n```cpp\nconst toml::value input = toml::parse(\"input.toml\");\nstd::cout \u003c\u003c toml::format(input) \u003c\u003c std::endl;\n```\n\n`toml::format` references the formatting information, allowing you to change the formatting method.\n\n```cpp\ntoml::value output(toml::table{ {\"a\", 0xDEADBEEF} });\noutput.at(\"a\").as_integer_fmt().fmt = toml::integer_format::hex;\noutput.at(\"a\").as_integer_fmt().spacer = 4; // position of `_`\n\nstd::cout \u003c\u003c toml::format(input) \u003c\u003c std::endl;\n// a = 0xdead_beef\n```\n\nYou can also specify the formatting for tables and arrays.\n\n```cpp\ntoml::value output(toml::table{\n  {\"array-of-tables\", toml::array{}},\n  {\"subtable\", toml::table{}},\n});\n\nauto\u0026 aot = output.at(\"array-of-tables\");\naot.as_array_fmt().fmt = toml::array_format::multiline; // one element per line\naot.as_array_fmt().body_indent    = 4;\naot.as_array_fmt().closing_indent = 2;\n\ntoml::value v1(toml::table{ {\"a\", 42}, {\"b\", 3.14} });\nv1.as_table_fmt().fmt = toml::table_format::oneline;\naot.push_back(std::move(v1));\n\ntoml::value v2(toml::table{ {\"a\", 42}, {\"b\", 3.14} });\nv2.as_table_fmt().fmt = toml::table_format::oneline;\naot.push_back(std::move(v2));\n\noutput.at(\"subtable\").as_table_fmt().fmt = toml::table_format::dotted;\noutput.at(\"subtable\")[\"a\"] = 42;\noutput.at(\"subtable\")[\"b\"] = 3.14;\n\nstd::cout \u003c\u003c toml::format(output) \u003c\u003c std::endl;\n// subtable.b = 3.14\n// subtable.a = 42\n// array-of-tables = [\n//     {b = 3.14, a = 42},\n//     {b = 3.14, a = 42},\n//   ]\n```\n\nThese settings are read during parsing and will be maintained as long as the value type does not change when modified.\n\nFor details on possible formatting specifications, please refer to the [documentation](https://toruniina.github.io/toml11/docs/features/serialize/).\n\n### Configuring Types\n\nMany types in `toml::value`, such as `integer_type`, `array_type`, `table_type`, etc, can be modified by changing the `type_config` type.\n\nOne commonly used example is an `ordered_map` that keeps the added order.\ntoml11 provides a`type_config` that changes `table_type` to `ordered_map` as `toml::ordered_type_config`.\n\n```cpp\nconst toml::ordered_value input = toml::parse\u003ctoml::ordered_type_config\u003e(\"input.toml\");\n```\n\nHere, `toml::ordered_value` is an alias of `toml::basic_value\u003ctoml::ordered_type_config\u003e`.\n\nNote that, since `toml::value` uses `std::unordered_map`, once you convert it to `toml::value`, then the order of the values will be randomized.\n\nFor more details about how to implement `type_config` variant, please refer to the [documentation](https://toruniina.github.io/toml11/docs/features/configure_types/).\n\nAlso, refer to the [`examples` directory](https://github.com/ToruNiina/toml11/tree/main/examples) for complex use cases such as using multi-precision integers, changing containers, and normalizing Unicode.\nUse these examples as references for implementing such configurations.\n\n## Examples\n\nThe [`examples`](https://github.com/ToruNiina/toml11/tree/main/examples) directory provides various implementation examples in addition to type configurations.\n\n- [boost_container](https://github.com/ToruNiina/toml11/tree/main/examples/boost_container)\n  - This example shows how to use `boost::container` containers for `array_type` and `table_type`.\n- [boost_multiprecision](https://github.com/ToruNiina/toml11/tree/main/examples/boost_multiprecision)\n  - This example demonstrates the use of `boost::multiprecision` multi-precision numeric types for `integer_type` and `floating_type`.\n- [parse_file](https://github.com/ToruNiina/toml11/tree/main/examples/parse_file)\n  - This example includes type conversion implementations, covering slightly more complex cases. The corresponding TOML file is included.\n- [reflect](https://github.com/ToruNiina/toml11/tree/main/examples/reflect)\n  - This example shows self-type conversion using boost-ext/reflect for user-defined types.\n- [unicode](https://github.com/ToruNiina/toml11/tree/main/examples/unicode)\n  - This example demonstrates normalizing Unicode strings when searching for keys using uni-algo.\n\n## Changes from v3\n\ntoml11 v4 introduces several breaking changes.\n\nEfforts have been made to minimize the need for changes for those using simple functionality.\nHowever, if you were utilizing advanced features, some adjustments may be necessary.\n\nNevertheless, we believe that the added or streamlined features will provide enhanced convenience in return.\n\n### Breaking Changes\n\n- Changed branch from `master` to `main`.\n- Changed template arguments of `toml::basic_value`.\n- Removed `toml::string` and explicitly store formatting information of all the values.\n- Modified arguments of `toml::format` to accommodate formatting information.\n- Changed default arguments of `toml::parse` to take `toml::spec` for specifying TOML version information.\n- Updated the interface of `toml::source_location` to accommodate multiline regions.\n- Modified arguments of `toml::format_error`.\n- Renamed `toml::format_underline` to `toml::format_location`.\n- Unified control method of `toml::color` to `toml::color::enable/disable()`.\n\n### Added features\n\n- Added `toml::parse_str`.\n- Added `toml::try_parse`.\n- Added support for parsing byte sequences.\n- Added formatting information to `toml::value`.\n- Changed to saving comments in `toml::value` by default.\n- Added `single_include/toml.hpp`.\n- Enabled to use as a precompiled library.\n\n## Contributors\n\nI appreciate the help of the contributors who introduced the great feature to this library.\n\n- Guillaume Fraux (@Luthaf)\n  - Windows support and CI on Appvayor\n  - Intel Compiler support\n- Quentin Khan (@xaxousis)\n  - Found \u0026 Fixed a bug around ODR\n  - Improved error messages for invalid keys to show the location where the parser fails\n- Petr Beneš (@wbenny)\n  - Fixed warnings on MSVC\n- Ivan Shynkarenka (@chronoxor)\n  - Fixed Visual Studio 2019 warnings\n  - Fix compilation error in `\u003cfilesystem\u003e` with MinGW\n- Khoi Dinh Trinh (@khoitd1997)\n  - Fixed warnings while type conversion\n- @KerstinKeller\n  - Added installation script to CMake\n- J.C. Moyer (@jcmoyer)\n  - Fixed an example code in the documentation\n- Jt Freeman (@blockparty-sh)\n  - Fixed feature test macro around `localtime_s`\n  - Suppress warnings in Debug mode\n- OGAWA Kenichi (@kenichiice)\n  - Suppress warnings on intel compiler\n  - Fix include path in README\n- Jordan Williams (@jwillikers)\n  - Fixed clang range-loop-analysis warnings\n  - Fixed feature test macro to suppress -Wundef\n  - Use cache variables in CMakeLists.txt\n  - Automate test set fetching, update and refactor CMakeLists.txt\n- Scott McCaskill\n  - Parse 9 digits (nanoseconds) of fractional seconds in a `local_time`\n- Shu Wang (@halfelf)\n  - fix \"Finding a value in an array\" example in README\n- @maass-tv and @SeverinLeonhardt\n  - Fix MSVC warning C4866\n- Mohammed Alyousef (@MoAlyousef)\n  - Made testing optional in CMake\n- Alex Merry (@amerry)\n  - Add missing include files\n- sneakypete81 (@sneakypete81)\n  - Fix typo in error message\n- Oliver Kahrmann (@founderio)\n  - Fix missing filename in error message if parsed file is empty\n- Karl Nilsson (@karl-nilsson)\n  - Fix many spelling errors\n- ohdarling88 (@ohdarling)\n  - Fix a bug in a constructor of serializer\n- estshorter (@estshorter)\n  - Fix MSVC warning C26478\n- Philip Top (@phlptp)\n  - Improve checking standard library feature availability check\n- Louis Marascio (@marascio)\n  - Fix free-nonheap-object warning\n- Axel Huebl (@ax3l)\n  - Make installation optional if the library is embedded\n- Ken Matsui (@ken-matsui)\n  - Support user-defined error message prefix\n  - Support dynamic color mode\n  - Support `std::optional` members for `TOML11_DEFINE_CONVERSION_NON_INTRUSIVE`\n  - Make `thread_local` for `color_mode` optional\n  - Add `toml::find_or_default`\n  - Fix static assertions in success that checks if specified type is void\n- Giel van Schijndel (@muggenhor)\n  - Remove needless copy in `parse` function\n- Lukáš Hrázký (@lukash)\n  - Add a `parse(FILE *)` interface and improve file-related error messages\n- spiderman idog (@spiderman-idog)\n  - Fix typo in README\n- Jajauma's GitHub (@Jajauma)\n  - Avoid possible lexer truncation warnings\n- Moritz Klammler (@ctcmkl)\n  - Many patches in (#200) including:\n  - Improve CMake scripts, build process, and test file handling\n  - Detect error when `discard_comments` is accessed\n  - And more.\n- Chris White (@cxw42)\n  - Fix address-sanitizer error when parsing literal strings having invalid UTF-8 characters\n  - Fix function name in error messages\n- offa (@offa)\n  - Update checkout action to v3\n  - Update Required CMake version\n  - Cleanup old CI settings\n- Sergey Vidyuk (@VestniK)\n  - Fix for case when vector iterator is raw pointer\n- Kfir Gollan (@kfirgollan)\n  - Add installation example with checkinstall and cmake\n- Martin Tournoij (@arp242)\n  - Escape control characters in keys\n- @DavidKorczynski\n  - Add fuzzing test based on ClusterFuzzLite\n- Esonhugh Skyworship (@Esonhugh)\n  - Fix function signature of `strerror_r` on macos\n- Alberto (@0X1A)\n  - Fix issues with CMake package configuration when used with vcpkg\n- Egor Pugin (@egorpugin)\n  - Fix incorrect operator\u003c\u003c() argument type that gives build error\n- Andreas Keller (@andreaskeller96)\n  - Fix not checking for \\r\\n when parsing line comments\n- 萧迩珀 (@CDK6182CHR)\n  - Support template into_toml members\n- Pino Toscano (@pinotree)\n  - Suppress warnings by manually cast file size to `std::streamsize`\n- Jack W (@jackwil1)\n  - Fix typos in documentation template syntax\n- amatej (@kontura)\n  - Fix: `toml::detail::region::last_` may be used uninitialized\n- Severin Leonhardt (@SeverinLeonhardt)\n  - Fix use with CMake 3.21 and older\n- hayt (@hayt)\n  - fix: prevent size_t-max length string allocation\n- somebody (@oldoldtea), (lz)\n  - Update README for better ToC, fixing example code\n- Sunlight (@SunPodder)\n  - Add `erase(...)` function to `ordered_map`\n\n## Licensing terms\n\nThis product is licensed under the terms of the [MIT License](LICENSE).\n\n- Copyright (c) 2017-2024 Toru Niina\n\nAll rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FToruNiina%2Ftoml11","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FToruNiina%2Ftoml11","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FToruNiina%2Ftoml11/lists"}