From 53f29d936592ab96e64c863dcb9997f9f58e8e5c Mon Sep 17 00:00:00 2001 From: Mark Gillard Date: Sun, 18 Apr 2021 15:04:46 +0300 Subject: [PATCH] restructuring and minor refactoring There's no new functionality here. It's purely tooling + CI stuff: - moved `python` => `tools` - moved documentation images to subfolder - moved `vs/tests` to tests/vs projects - moved `vs` solution etc to root - added semicolons to macros - added cpp.hint to help VS intellisense - migrated documentation generation to external lib --- .circleci/config.yml | 38 +- .gitattributes | 87 +- .gitignore | 11 +- .gitmodules | 26 +- vs/.runsettings => .runsettings | 0 CONTRIBUTING.md | 6 +- README.md | 32 +- cpp.hint | 14 + docs/Doxyfile | 275 +--- docs/Doxyfile-mcss | 35 - docs/badge-C++17.svg | 1 - docs/badge-TOML.svg | 1 - docs/badge-license-MIT.svg | 1 - docs/dox.toml | 56 + docs/github-icon.png | Bin 2077 -> 0 bytes docs/{ => images}/badge-C++20.svg | 0 docs/images/badge-TOML.svg | 1 + docs/{ => images}/badge-awesome.svg | 0 docs/{ => images}/banner.ai | Bin docs/{ => images}/banner_large.png | Bin docs/{ => images}/banner_small.png | Bin docs/{ => images}/favicon.ico | Bin docs/{ => images}/logo.ai | Bin docs/{ => images}/logo.png | Bin docs/muu.css | 337 ----- docs/muu.js | 18 - docs/{ => pages}/main_page.dox | 10 +- {vs => examples}/error_printer.vcxproj | 10 +- {vs => examples}/simple_parser.vcxproj | 12 +- {vs => examples}/toml_generator.vcxproj | 10 +- .../toml_to_json_transcoder.vcxproj | 10 +- extern/Catch2 | 1 - extern/mcss | 1 - extern/tloptional | 1 - external/Catch2 | 1 + external/dox | 1 + external/tloptional | 1 + {extern => external}/toml-spec-tests | 0 {extern => external}/toml-test | 0 include/toml++/toml.h | 6 +- include/toml++/toml_array.h | 133 +- include/toml++/toml_array.hpp | 2 +- include/toml++/toml_common.h | 52 +- include/toml++/toml_date_time.h | 4 +- include/toml++/toml_default_formatter.h | 12 +- include/toml++/toml_default_formatter.hpp | 22 +- include/toml++/toml_formatter.h | 10 +- include/toml++/toml_instantiations.hpp | 10 +- include/toml++/toml_json_formatter.h | 8 +- include/toml++/toml_json_formatter.hpp | 8 +- include/toml++/toml_node.h | 363 ++--- include/toml++/toml_node.hpp | 2 +- include/toml++/toml_node_view.h | 59 +- include/toml++/toml_parse_error.h | 14 +- include/toml++/toml_parser.h | 111 +- include/toml++/toml_parser.hpp | 36 +- include/toml++/toml_preprocessor.h | 186 ++- include/toml++/toml_print_to_stream.h | 20 +- include/toml++/toml_table.h | 203 ++- include/toml++/toml_table.hpp | 2 +- include/toml++/toml_utf8.h | 7 +- include/toml++/toml_utf8_streams.h | 8 +- include/toml++/toml_utf8_streams.hpp | 4 +- include/toml++/toml_value.h | 112 +- meson.build | 9 +- python/generate_documentation.py | 1263 ----------------- python/requirements.txt | 7 - python/utils.py | 202 --- tests/catch2.h | 2 +- tests/conformance_burntsushi_invalid.cpp | 4 +- tests/conformance_burntsushi_valid.cpp | 4 +- tests/conformance_iarna_invalid.cpp | 4 +- tests/conformance_iarna_valid.cpp | 4 +- tests/cpp.hint | 1 + tests/manipulating_values.cpp | 6 +- tests/parsing_dates_and_times.cpp | 6 +- tests/parsing_spec_example.cpp | 6 +- tests/tests.h | 6 +- tests/tloptional.h | 2 +- tests/using_iterators.cpp | 4 +- {vs/tests => tests/vs}/test_debug_x64.vcxproj | 69 +- .../vs}/test_debug_x64_cpplatest.vcxproj | 69 +- .../test_debug_x64_cpplatest_noexcept.vcxproj | 69 +- ...debug_x64_cpplatest_noexcept_unrel.vcxproj | 69 +- .../test_debug_x64_cpplatest_unrel.vcxproj | 69 +- .../vs}/test_debug_x64_noexcept.vcxproj | 69 +- .../vs}/test_debug_x64_noexcept_unrel.vcxproj | 69 +- .../vs}/test_debug_x64_unrel.vcxproj | 69 +- {vs/tests => tests/vs}/test_debug_x86.vcxproj | 69 +- .../vs}/test_debug_x86_cpplatest.vcxproj | 69 +- .../test_debug_x86_cpplatest_noexcept.vcxproj | 69 +- ...debug_x86_cpplatest_noexcept_unrel.vcxproj | 69 +- .../test_debug_x86_cpplatest_unrel.vcxproj | 69 +- .../vs}/test_debug_x86_noexcept.vcxproj | 69 +- .../vs}/test_debug_x86_noexcept_unrel.vcxproj | 69 +- .../vs}/test_debug_x86_unrel.vcxproj | 69 +- .../vs}/test_release_x64.vcxproj | 69 +- .../vs}/test_release_x64_cpplatest.vcxproj | 69 +- ...est_release_x64_cpplatest_noexcept.vcxproj | 69 +- ...lease_x64_cpplatest_noexcept_unrel.vcxproj | 69 +- .../test_release_x64_cpplatest_unrel.vcxproj | 69 +- .../vs}/test_release_x64_noexcept.vcxproj | 69 +- .../test_release_x64_noexcept_unrel.vcxproj | 69 +- .../vs}/test_release_x64_unrel.vcxproj | 69 +- .../vs}/test_release_x86.vcxproj | 69 +- .../vs}/test_release_x86_cpplatest.vcxproj | 69 +- ...est_release_x86_cpplatest_noexcept.vcxproj | 69 +- ...lease_x86_cpplatest_noexcept_unrel.vcxproj | 69 +- .../test_release_x86_cpplatest_unrel.vcxproj | 69 +- .../vs}/test_release_x86_noexcept.vcxproj | 69 +- .../test_release_x86_noexcept_unrel.vcxproj | 69 +- .../vs}/test_release_x86_unrel.vcxproj | 69 +- tests/windows_compat.cpp | 4 +- vs/toml++.natvis => toml++.natvis | 0 toml++.props | 199 +++ vs/toml++.sln => toml++.sln | 72 +- toml++.vcxproj | 94 ++ toml++.vcxproj.filters | 148 ++ toml.hpp | 725 +++++----- {python => tools}/ci_single_header_check.py | 18 +- .../generate_conformance_tests.py | 83 +- {python => tools}/generate_single_header.py | 13 +- .../generate_windows_test_targets.py | 79 +- tools/requirements.txt | 3 + tools/utils.py | 43 + vs/toml++.props | 107 -- vs/toml++.vcxproj | 95 -- vs/toml++.vcxproj.filters | 147 -- 128 files changed, 3210 insertions(+), 4749 deletions(-) rename vs/.runsettings => .runsettings (100%) create mode 100644 cpp.hint delete mode 100644 docs/Doxyfile-mcss delete mode 100644 docs/badge-C++17.svg delete mode 100644 docs/badge-TOML.svg delete mode 100644 docs/badge-license-MIT.svg create mode 100644 docs/dox.toml delete mode 100644 docs/github-icon.png rename docs/{ => images}/badge-C++20.svg (100%) create mode 100644 docs/images/badge-TOML.svg rename docs/{ => images}/badge-awesome.svg (100%) rename docs/{ => images}/banner.ai (100%) rename docs/{ => images}/banner_large.png (100%) rename docs/{ => images}/banner_small.png (100%) rename docs/{ => images}/favicon.ico (100%) rename docs/{ => images}/logo.ai (100%) rename docs/{ => images}/logo.png (100%) delete mode 100644 docs/muu.css delete mode 100644 docs/muu.js rename docs/{ => pages}/main_page.dox (97%) rename {vs => examples}/error_printer.vcxproj (91%) rename {vs => examples}/simple_parser.vcxproj (89%) rename {vs => examples}/toml_generator.vcxproj (91%) rename {vs => examples}/toml_to_json_transcoder.vcxproj (91%) delete mode 160000 extern/Catch2 delete mode 160000 extern/mcss delete mode 160000 extern/tloptional create mode 160000 external/Catch2 create mode 160000 external/dox create mode 160000 external/tloptional rename {extern => external}/toml-spec-tests (100%) rename {extern => external}/toml-test (100%) delete mode 100644 python/generate_documentation.py delete mode 100644 python/requirements.txt delete mode 100644 python/utils.py create mode 100644 tests/cpp.hint rename {vs/tests => tests/vs}/test_debug_x64.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x64_cpplatest.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x64_cpplatest_noexcept.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x64_cpplatest_noexcept_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x64_cpplatest_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x64_noexcept.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x64_noexcept_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x64_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x86.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x86_cpplatest.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x86_cpplatest_noexcept.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x86_cpplatest_noexcept_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x86_cpplatest_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x86_noexcept.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x86_noexcept_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_debug_x86_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x64.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x64_cpplatest.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x64_cpplatest_noexcept.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x64_cpplatest_noexcept_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x64_cpplatest_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x64_noexcept.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x64_noexcept_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x64_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x86.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x86_cpplatest.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x86_cpplatest_noexcept.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x86_cpplatest_noexcept_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x86_cpplatest_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x86_noexcept.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x86_noexcept_unrel.vcxproj (61%) rename {vs/tests => tests/vs}/test_release_x86_unrel.vcxproj (61%) rename vs/toml++.natvis => toml++.natvis (100%) create mode 100644 toml++.props rename vs/toml++.sln => toml++.sln (82%) create mode 100644 toml++.vcxproj create mode 100644 toml++.vcxproj.filters rename {python => tools}/ci_single_header_check.py (57%) rename {python => tools}/generate_conformance_tests.py (83%) rename {python => tools}/generate_single_header.py (94%) rename {python => tools}/generate_windows_test_targets.py (68%) create mode 100644 tools/requirements.txt create mode 100644 tools/utils.py delete mode 100644 vs/toml++.props delete mode 100644 vs/toml++.vcxproj delete mode 100644 vs/toml++.vcxproj.filters diff --git a/.circleci/config.yml b/.circleci/config.yml index b77b6f6..b18aea4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,19 +4,19 @@ jobs: debug_clang: docker: - - image: marzer/misc_cpp17_dev:0.2.0 + - image: marzer/cpp_dev:0.1.0 resource_class: large steps: - checkout - run: name: Checking toml.hpp command: | - cd python && python3 ci_single_header_check.py + cd tools && python3 ci_single_header_check.py - run: name: Pulling submodules command: | - git submodule update --init extern/Catch2 - git submodule update --init extern/tloptional + git submodule update --init --depth 1 external/Catch2 + git submodule update --init --depth 1 external/tloptional - run: name: Building and testing with clang command: | @@ -25,19 +25,19 @@ jobs: release_clang: docker: - - image: marzer/misc_cpp17_dev:0.2.0 + - image: marzer/cpp_dev:0.1.0 resource_class: large steps: - checkout - run: name: Checking toml.hpp command: | - cd python && python3 ci_single_header_check.py + cd tools && python3 ci_single_header_check.py - run: name: Pulling submodules command: | - git submodule update --init extern/Catch2 - git submodule update --init extern/tloptional + git submodule update --init --depth 1 external/Catch2 + git submodule update --init --depth 1 external/tloptional - run: name: Building and testing with clang command: | @@ -46,15 +46,15 @@ jobs: debug_gcc: docker: - - image: marzer/misc_cpp17_dev:0.2.0 + - image: marzer/cpp_dev:0.1.0 resource_class: large steps: - checkout - run: name: Pulling submodules command: | - git submodule update --init extern/Catch2 - git submodule update --init extern/tloptional + git submodule update --init --depth 1 external/Catch2 + git submodule update --init --depth 1 external/tloptional - run: name: Building and testing with gcc command: | @@ -63,15 +63,15 @@ jobs: release_gcc: docker: - - image: marzer/misc_cpp17_dev:0.2.0 + - image: marzer/cpp_dev:0.1.0 resource_class: large steps: - checkout - run: name: Pulling submodules command: | - git submodule update --init extern/Catch2 - git submodule update --init extern/tloptional + git submodule update --init --depth 1 external/Catch2 + git submodule update --init --depth 1 external/tloptional - run: name: Building and testing with gcc command: | @@ -80,18 +80,22 @@ jobs: generate_dox: docker: - - image: marzer/misc_cpp17_dev:0.2.0 + - image: marzer/cpp_dev:0.1.0 resource_class: small steps: - checkout - run: name: Pulling submodules command: | - git submodule update --init extern/mcss + git submodule update --init --depth 1 --recursive external/dox + - run: + name: Installing dependencies + command: | + pip3 install --upgrade -r external/dox/requirements.txt - run: name: Generating documentation command: | - cd python && python3 generate_documentation.py + cd docs && python3 ../external/dox --verbose - persist_to_workspace: root: docs paths: html diff --git a/.gitattributes b/.gitattributes index 71a3e24..77151ea 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,26 +1,61 @@ -* text=auto encoding=UTF-8 -*.c text encoding=UTF-8 eol=lf -*.cpp text encoding=UTF-8 eol=lf -*.cxx text encoding=UTF-8 eol=lf -*.dox text encoding=UTF-8 eol=lf -*.h text encoding=UTF-8 eol=lf -*.hpp text encoding=UTF-8 eol=lf -*.hxx text encoding=UTF-8 eol=lf -*.inl text encoding=UTF-8 eol=lf -*.toml text=auto encoding=UTF-8 -*.xml text=auto encoding=UTF-8 -*.py text encoding=UTF-8 eol=lf -*.natvis text encoding=UTF-8 eol=crlf -*.props text encoding=UTF-8 eol=crlf -*.vcxproj text encoding=UTF-8 eol=crlf -*.sln text encoding=UTF-8-BOM eol=crlf -*.runsettings text encoding=UTF-8 eol=crlf -*.md text encoding=UTF-8 eol=lf -*.css text encoding=UTF-8 eol=lf -.gitignore text encoding=UTF-8 eol=lf -.gitattributes text encoding=UTF-8 eol=lf -.editorconfig text encoding=UTF-8 eol=lf -meson.build text encoding=UTF-8 eol=lf -meson_options.txt text encoding=UTF-8 eol=lf -Doxyfile text encoding=UTF-8 eol=lf -Doxyfile-mcss text encoding=UTF-8 eol=lf +* text=auto encoding=UTF-8 + +*.c text eol=lf encoding=UTF-8 +*.cpp text eol=lf encoding=UTF-8 +*.css text eol=lf encoding=UTF-8 +*.cxx text eol=lf encoding=UTF-8 +*.dox text eol=lf encoding=UTF-8 +*.h text eol=lf encoding=UTF-8 +*.hint text eol=lf encoding=UTF-8 +*.hlsl text eol=crlf encoding=UTF-8 +*.hpp text eol=lf encoding=UTF-8 +*.htm text eol=lf encoding=UTF-8 +*.html text eol=lf encoding=UTF-8 +*.hxx text eol=lf encoding=UTF-8 +*.ini text eol=lf encoding=UTF-8 +*.inl text eol=lf encoding=UTF-8 +*.md text eol=lf encoding=UTF-8 +*.natvis text eol=lf encoding=UTF-8 +*.props text eol=lf encoding=UTF-8 +*.py text eol=lf encoding=UTF-8 +*.rc text eol=crlf encoding=UTF-8 +*.runsettings text eol=lf encoding=UTF-8 +*.sln text eol=crlf encoding=UTF-8-BOM +*.toml text eol=lf encoding=UTF-8 +*.txt text eol=lf encoding=UTF-8 +*.vcxproj text eol=crlf encoding=UTF-8-BOM +*.vcxproj.filters text eol=crlf encoding=UTF-8-BOM +*.xml text eol=lf encoding=UTF-8 +.clang-format text eol=lf encoding=UTF-8 +.editorconfig text eol=lf encoding=UTF-8 +.gitattributes text eol=lf encoding=UTF-8 +.gitignore text eol=lf encoding=UTF-8 +Doxyfile text eol=lf encoding=UTF-8 +Doxyfile-mcss text eol=lf encoding=UTF-8 +meson.build text eol=lf encoding=UTF-8 + +*.cs eol=lf diff=csharp + +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain + +*.ai binary +*.bin binary +*.bmp binary +*.dat binary +*.gif binary +*.ico binary +*.jpeg binary +*.jpg binary +*.png binary +*.psd binary +*.rc binary +*.xlsx binary diff --git a/.gitignore b/.gitignore index 84710a4..72aa02c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,15 @@ meson-private/ build.ninja compile_commands.json [Bb]uild*/ -[Dd]ocs/xml -[Dd]ocs/html + +# documentation +*.xml +*.xslt +*.xsd +*.html +*.temp +docs/html +docs/xml ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. diff --git a/.gitmodules b/.gitmodules index 870ae96..d220151 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,15 +1,15 @@ -[submodule "extern/Catch2"] - path = extern/Catch2 - url = https://github.com/catchorg/Catch2.git -[submodule "extern/mcss"] - path = extern/mcss - url = https://github.com/mosra/m.css.git -[submodule "extern/tloptional"] - path = extern/tloptional - url = https://github.com/TartanLlama/optional.git -[submodule "extern/toml-test"] - path = extern/toml-test +[submodule "external/toml-test"] + path = external/toml-test url = https://github.com/BurntSushi/toml-test.git -[submodule "extern/toml-spec-tests"] - path = extern/toml-spec-tests +[submodule "external/toml-spec-tests"] + path = external/toml-spec-tests url = https://github.com/iarna/toml-spec-tests.git +[submodule "external/dox"] + path = external/dox + url = https://github.com/marzer/dox.git +[submodule "external/Catch2"] + path = external/Catch2 + url = https://github.com/catchorg/Catch2.git +[submodule "external/tloptional"] + path = external/tloptional + url = https://github.com/TartanLlama/optional.git diff --git a/vs/.runsettings b/.runsettings similarity index 100% rename from vs/.runsettings rename to .runsettings diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9b55cdb..a9542ee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,8 @@ If you wish to submit a PR, please be aware that: 1. Make your changes as necessary - If you've added a new header file that isn't going to be transitively included by one of the others, add an include directive to `include/toml++/toml.h` -2. Run `python/generate_single_header.py` +2. Install the prerequisite python packages: `pip3 install -r tools/requirements.txt` +3. Run `tools/generate_single_header.py`
@@ -21,8 +22,7 @@ If you wish to submit a PR, please be aware that: Testing is done using [Catch2], included in the respository as a submodule under `extern/Catch2`. The first time you want to begin testing you'll need to ensure submodules have been fetched: ```bash -git submodule update --init extern/Catch2 -git submodule update --init extern/tloptional +git submodule update --init --depth 1 external/Catch2 external/tloptional ``` ### Testing on Windows with Visual Studio diff --git a/README.md b/README.md index b623731..e1b1e6f 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ -[![banner](docs/banner_small.png)][homepage] +[![banner](docs/images/banner_small.png)][homepage] [![Releases](https://img.shields.io/github/v/release/marzer/tomlplusplus?style=flat-square)](https://github.com/marzer/tomlplusplus/releases) -[![C++17](docs/badge-C++17.svg)][cpp_compilers] -[![C++20](docs/badge-C++20.svg)][cpp_compilers] -[![TOML](docs/badge-TOML.svg)][v1.0.0] -[![MIT license](docs/badge-license-MIT.svg)](./LICENSE) +[![C++17](docs/images/badge-C++17.svg)][cpp_compilers] +[![C++20](docs/images/badge-C++20.svg)][cpp_compilers] +[![TOML](docs/images/badge-TOML.svg)][v1.0.0] +[![MIT license](docs/images/badge-license-MIT.svg)](./LICENSE) [![CircleCI](https://img.shields.io/circleci/build/github/marzer/tomlplusplus?label=circle%20ci&logo=circleci&logoColor=white&style=flat-square)](https://circleci.com/gh/marzer/tomlplusplus) -[![Mentioned in Awesome C++](docs/badge-awesome.svg)](https://github.com/fffaraz/awesome-cpp) +[![Mentioned in Awesome C++](docs/images/badge-awesome.svg)](https://github.com/fffaraz/awesome-cpp) ==== # toml++ homepage

- ✨ This README is fine, but the toml++ homepage is better. ✨ + ✨️ This README is fine, but the toml++ homepage is better. ✨️


@@ -32,7 +32,7 @@ # Basic usage -> ℹ _The following example favours brevity. If you'd prefer full API documentation and lots of specific code snippets +> ℹ️ _The following example favours brevity. If you'd prefer full API documentation and lots of specific code snippets instead, visit the project [homepage]_ Given a [TOML] file `configuration.toml` containing the following: @@ -89,11 +89,11 @@ You'll find some more code examples in the `examples` directory, and plenty more # Adding toml++ to your project `toml++` comes in two flavours: Single-header and Regular. The API is the same for both. -### 🍦 Single-header flavour +### 🍦️ Single-header flavour 1. Drop `toml.hpp` wherever you like in your source tree 2. There is no step two -### 🍨 Regular flavour +### 🍨️ Regular flavour 1. Add `tomlplusplus/include` to your include paths 2. `#include ` @@ -108,7 +108,7 @@ depends: [ 'tomlpp^2.3.0', ] ``` -> ℹ _[What is DDS?](https://dds.pizza/)_ +> ℹ️ _[What is DDS?](https://dds.pizza/)_ ### Vcpkg ``` @@ -142,7 +142,7 @@ won't need to mess with these at all, but if you do, set them before including t | `TOML_UNRELEASED_FEATURES` | boolean | `0` | Enables support for [unreleased TOML language features] not yet part of a [numbered version]. | | `TOML_WINDOWS_COMPAT` | boolean | `1` on Windows | Enables support for transparent conversion between wide and narrow strings in some places when building for Windows. | -> ℹ _A number of these have ABI implications; the library uses inline namespaces to prevent you from accidentally +> ℹ️ _A number of these have ABI implications; the library uses inline namespaces to prevent you from accidentally linking incompatible combinations together._
@@ -155,7 +155,7 @@ support for a number of unreleased features from the [TOML master] and some sane The library advertises the most recent numbered language version it fully supports via the preprocessor defines `TOML_LANG_MAJOR`, `TOML_LANG_MINOR` and `TOML_LANG_PATCH`. -### 🔸 **Unreleased language features:** +### 🔸️ **Unreleased language features:** - [#516]: Allow newlines and trailing commas in inline tables - [#562]: Allow hex floating-point values - [#644]: Support `+` in key names @@ -163,9 +163,9 @@ defines `TOML_LANG_MAJOR`, `TOML_LANG_MINOR` and `TOML_LANG_PATCH`. - [#687]: Relax bare key restrictions to allow additional unicode characters - [#709]: Include an \xHH escape code sequence -> ℹ _`#define TOML_UNRELEASED_FEATURES 1` to enable these features (see [Configuration](#Configuration))._ +> ℹ️ _`#define TOML_UNRELEASED_FEATURES 1` to enable these features (see [Configuration](#Configuration))._ -### 🔹 **TOML v1.0.0:** +### 🔹️ **TOML v1.0.0:** All features supported, including: - [#356]: Allow leading zeros in the exponent part of a float - [#567]: Control characters are not permitted in comments @@ -173,7 +173,7 @@ All features supported, including: - [#665]: Make arrays heterogeneous - [#766]: Allow comments before commas in arrays -### 🔹 **TOML v0.5.0:** +### 🔹️ **TOML v0.5.0:** All features supported.
diff --git a/cpp.hint b/cpp.hint new file mode 100644 index 0000000..111e53f --- /dev/null +++ b/cpp.hint @@ -0,0 +1,14 @@ +#define TOML_API +#define TOML_ATTR(...) +#define TOML_ALWAYS_INLINE inline +#define TOML_NEVER_INLINE +#define TOML_TRIVIAL_ABI +#define TOML_ABSTRACT_BASE +#define TOML_EMPTY_BASES +#define TOML_MAY_THROW +#define TOML_CONSTEVAL constexpr +#define TOML_LIKELY(...) (__VA_ARGS__) +#define TOML_UNLIKELY(...) (__VA_ARGS__) +#define TOML_NODISCARD_CTOR +#define TOML_EXTERNAL_LINKAGE +#define TOML_INTERNAL_LINKAGE diff --git a/docs/Doxyfile b/docs/Doxyfile index cb6296f..6043863 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.16 +# Doxyfile 1.9.1 #--------------------------------------------------------------------------- # Project related configuration options @@ -6,9 +6,9 @@ DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = toml++ PROJECT_NUMBER = -PROJECT_BRIEF = TOML for modern C++ +PROJECT_BRIEF = "TOML for modern C++" PROJECT_LOGO = logo.png -OUTPUT_DIRECTORY = ./ +OUTPUT_DIRECTORY = CREATE_SUBDIRS = NO ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English @@ -36,31 +36,11 @@ JAVADOC_AUTOBRIEF = NO JAVADOC_BANNER = NO QT_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO +PYTHON_DOCSTRING = YES INHERIT_DOCS = YES SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 4 -ALIASES = \ - "cpp=@code{.cpp}" \ - "ecpp=@endcode" \ - "out=@code{.shell-session}" \ - "eout=@endcode" \ - "bash=@code{.sh}" \ - "ebash=@endcode" \ - "detail=@details" \ - "gh{1}=\1" \ - "gh2{2}=\2" \ - "godbolt{1}=Try this code on Compiler Explorer" \ - "m_div{1}=@xmlonly@endxmlonly" \ - "m_enddiv=@xmlonly@endxmlonly" \ - "m_span{1}=@xmlonly@endxmlonly" \ - "m_endspan=@xmlonly@endxmlonly" \ - "m_class{1}=@xmlonly@endxmlonly" \ - "m_footernavigation=@xmlonly@endxmlonly" \ - "m_examplenavigation{2}=@xmlonly@endxmlonly" \ - "m_keywords{1}=@xmlonly@endxmlonly" \ - "m_keyword{3}=@xmlonly@endxmlonly" \ - "m_enum_values_as_keywords=@xmlonly@endxmlonly" -TCL_SUBST = +ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO OPTIMIZE_FOR_FORTRAN = NO @@ -81,6 +61,7 @@ INLINE_GROUPED_CLASSES = NO INLINE_SIMPLE_STRUCTS = NO TYPEDEF_HIDES_STRUCT = NO LOOKUP_CACHE_SIZE = 1 +NUM_PROC_THREADS = 1 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- @@ -92,6 +73,7 @@ EXTRACT_STATIC = NO EXTRACT_LOCAL_CLASSES = NO EXTRACT_LOCAL_METHODS = NO EXTRACT_ANON_NSPACES = NO +RESOLVE_UNNAMED_PARAMS = YES HIDE_UNDOC_MEMBERS = YES HIDE_UNDOC_CLASSES = YES HIDE_FRIEND_COMPOUNDS = NO @@ -132,12 +114,12 @@ WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_AS_ERROR = NO WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = ./doc/doxygen_warnings.log +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = ../include -INPUT += ../docs +INPUT = ../include/ \ + pages/ INPUT_ENCODING = UTF-8 FILE_PATTERNS = *.h \ *.dox @@ -149,158 +131,13 @@ EXCLUDE_SYMBOLS = EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO -IMAGE_PATH = ./ +IMAGE_PATH = images/ INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO FILTER_SOURCE_PATTERNS = USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = NO -REFERENCES_LINK_SOURCE = NO -SOURCE_TOOLTIPS = YES -USE_HTAGS = NO -VERBATIM_HEADERS = NO -CLANG_ASSISTED_PARSING = NO -CLANG_OPTIONS = -CLANG_DATABASE_PATH = -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = YES -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = NO -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_EXTRA_STYLESHEET = -HTML_EXTRA_FILES = -HTML_COLORSTYLE_HUE = 224 -HTML_COLORSTYLE_SAT = 50 -HTML_COLORSTYLE_GAMMA = 67 -HTML_TIMESTAMP = NO -HTML_DYNAMIC_MENUS = YES -HTML_DYNAMIC_SECTIONS = NO -HTML_INDEX_NUM_ENTRIES = 100 -GENERATE_DOCSET = NO -DOCSET_FEEDNAME = "Doxygen generated docs" -DOCSET_BUNDLE_ID = org.doxygen.Project -DOCSET_PUBLISHER_ID = org.doxygen.Publisher -DOCSET_PUBLISHER_NAME = Publisher -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -CHM_INDEX_ENCODING = -BINARY_TOC = NO -TOC_EXPAND = NO -GENERATE_QHP = NO -QCH_FILE = -QHP_NAMESPACE = org.doxygen.Project -QHP_VIRTUAL_FOLDER = doc -QHP_CUST_FILTER_NAME = -QHP_CUST_FILTER_ATTRS = -QHP_SECT_FILTER_ATTRS = -QHG_LOCATION = -GENERATE_ECLIPSEHELP = NO -ECLIPSE_DOC_ID = org.doxygen.Project -DISABLE_INDEX = NO -GENERATE_TREEVIEW = YES -ENUM_VALUES_PER_LINE = 4 -TREEVIEW_WIDTH = 250 -EXT_LINKS_IN_WINDOW = NO -FORMULA_FONTSIZE = 10 -FORMULA_TRANSPARENT = YES -USE_MATHJAX = NO -MATHJAX_FORMAT = HTML-CSS -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest -MATHJAX_EXTENSIONS = -MATHJAX_CODEFILE = -SEARCHENGINE = NO -SERVER_BASED_SEARCH = NO -EXTERNAL_SEARCH = NO -SEARCHENGINE_URL = -SEARCHDATA_FILE = searchdata.xml -EXTERNAL_SEARCH_ID = -EXTRA_SEARCH_MAPPINGS = -#--------------------------------------------------------------------------- -# Configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -LATEX_MAKEINDEX_CMD = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4 -EXTRA_PACKAGES = -LATEX_HEADER = -LATEX_FOOTER = -LATEX_EXTRA_STYLESHEET = -LATEX_EXTRA_FILES = -PDF_HYPERLINKS = YES -USE_PDFLATEX = YES -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -LATEX_SOURCE_CODE = NO -LATEX_BIB_STYLE = plain -LATEX_TIMESTAMP = NO -LATEX_EMOJI_DIRECTORY = -#--------------------------------------------------------------------------- -# Configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -RTF_SOURCE_CODE = NO -#--------------------------------------------------------------------------- -# Configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_SUBDIR = -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# Configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = YES -XML_OUTPUT = xml -XML_PROGRAMLISTING = NO -XML_NS_MEMB_FILE_SCOPE = NO -#--------------------------------------------------------------------------- -# Configuration options related to the DOCBOOK output -#--------------------------------------------------------------------------- -GENERATE_DOCBOOK = NO -DOCBOOK_OUTPUT = docbook -DOCBOOK_PROGRAMLISTING = NO -#--------------------------------------------------------------------------- -# Configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# Configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES @@ -309,92 +146,6 @@ EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = NO INCLUDE_PATH = INCLUDE_FILE_PATTERNS = -PREDEFINED = \ - "DOXYGEN=1" \ - "NDEBUG=1" \ - "__cplusplus=201703L" \ - "__has_include(...)=0" \ - "__has_attribute(...)=0" \ - "__cpp_lib_char8_t=201811L" \ - "TOML_DISABLE_ENVIRONMENT_CHECKS=" \ - "TOML_ALWAYS_INLINE=inline" \ - "TOML_MAY_THROW=" \ - "TOML_NODISCARD_CTOR=" \ - "TOML_EXTERNAL_LINKAGE=" \ - "TOML_API=" \ - "TOML_ATTR(...)=" \ - "TOML_PUSH_WARNINGS=" \ - "TOML_DISABLE_SWITCH_WARNINGS=" \ - "TOML_DISABLE_INIT_WARNINGS=" \ - "TOML_DISABLE_SPAM_WARNINGS=" \ - "TOML_DISABLE_ARITHMETIC_WARNINGS=" \ - "TOML_DISABLE_SHADOW_WARNINGS=" \ - "TOML_DISABLE_WARNINGS=" \ - "TOML_ENABLE_WARNINGS=" \ - "TOML_POP_WARNINGS=" \ - "TOML_ASYMMETRICAL_EQUALITY_OPS(...)=" \ - "TOML_NAMESPACE_START=namespace toml" \ - "TOML_NAMESPACE_END=" \ - "TOML_NAMESPACE=toml" \ - "TOML_ABI_NAMESPACE_START(...)=" \ - "TOML_ABI_NAMESPACE_BOOL(...)=" \ - "TOML_ABI_NAMESPACE_END=" \ - "TOML_IMPL_NAMESPACE_START=namespace toml { namespace impl" \ - "TOML_IMPL_NAMESPACE_END=} }" \ - "TOML_ANON_NAMESPACE_START=namespace" \ - "TOML_ANON_NAMESPACE_END=" \ - "TOML_ANON_NAMESPACE=" \ - "TOML_USING_ANON_NAMESPACE=(void)0" \ - "TOML_EXTERNAL_LINKAGE=" \ - "TOML_TRIVIAL_ABI=" \ - "TOML_EMPTY_BASES=" \ - "TOML_ABSTRACT_BASE" \ - "TOML_INTERNAL_LINKAGE=static" -EXPAND_AS_DEFINED = +PREDEFINED = +EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = NO -#--------------------------------------------------------------------------- -# Configuration options related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -EXTERNAL_PAGES = YES -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = NO -DIA_PATH = -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -DOT_NUM_THREADS = 0 -DOT_FONTNAME = Helvetica -DOT_FONTSIZE = 10 -DOT_FONTPATH = -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -UML_LIMIT_NUM_FIELDS = 10 -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = YES -CALLER_GRAPH = YES -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -INTERACTIVE_SVG = NO -DOT_PATH = -DOTFILE_DIRS = -MSCFILE_DIRS = -DIAFILE_DIRS = -PLANTUML_JAR_PATH = -PLANTUML_CFG_FILE = -PLANTUML_INCLUDE_PATH = -DOT_GRAPH_MAX_NODES = 50 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES diff --git a/docs/Doxyfile-mcss b/docs/Doxyfile-mcss deleted file mode 100644 index f8f5873..0000000 --- a/docs/Doxyfile-mcss +++ /dev/null @@ -1,35 +0,0 @@ -@INCLUDE = ./Doxyfile - -HTML_EXTRA_STYLESHEET = \ - https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600 \ - ../css/m-dark+documentation.compiled.css \ - muu.css - -HTML_EXTRA_FILES = \ - muu.js \ - logo.png \ - banner_small.png \ - github-icon.png \ - badge-awesome.svg \ - badge-C++17.svg \ - badge-C++20.svg \ - badge-license-MIT.svg \ - badge-TOML.svg - - -##! M_THEME_COLOR = #22272e -##! M_LINKS_NAVBAR1 = \ -##! namespaces -##! M_LINKS_NAVBAR2 = \ -##! annotated \ -##! "Github" -##! M_SEARCH_DOWNLOAD_BINARY = NO -##! M_CLASS_TREE_EXPAND_LEVELS = 3 -##! M_FILE_TREE_EXPAND_LEVELS = 3 -##! M_PAGE_FINE_PRINT = Github • \ -##! Report an issue \ -##!

Documentation generated using m.css -##! M_HTML_HEADER = \ -##! \ -##! -##! M_FAVICON = favicon.ico diff --git a/docs/badge-C++17.svg b/docs/badge-C++17.svg deleted file mode 100644 index 14d427e..0000000 --- a/docs/badge-C++17.svg +++ /dev/null @@ -1 +0,0 @@ - standardC++17 \ No newline at end of file diff --git a/docs/badge-TOML.svg b/docs/badge-TOML.svg deleted file mode 100644 index 723dfa0..0000000 --- a/docs/badge-TOML.svg +++ /dev/null @@ -1 +0,0 @@ -TOML: v1.0.0TOMLv1.0.0 \ No newline at end of file diff --git a/docs/badge-license-MIT.svg b/docs/badge-license-MIT.svg deleted file mode 100644 index 52456a7..0000000 --- a/docs/badge-license-MIT.svg +++ /dev/null @@ -1 +0,0 @@ - licenseMIT \ No newline at end of file diff --git a/docs/dox.toml b/docs/dox.toml new file mode 100644 index 0000000..55d22f2 --- /dev/null +++ b/docs/dox.toml @@ -0,0 +1,56 @@ +name = 'toml++' +description = 'TOML for modern C++' +cpp = 17 +github = 'marzer/tomlplusplus' +license = [ 'MIT', 'https://github.com/marzer/tomlplusplus/blob/master/LICENSE' ] +show_includes = false +logo = 'images/logo.png' +favicon = 'images/favicon.ico' +navbar = [ 'namespaces', 'annotated' ] +extra_files = [ + 'images/banner_small.png', + 'images/badge-awesome.svg', + 'images/badge-TOML.svg', + 'images/badge-C++20.svg' +] + + + +[warnings] +enabled = true +treat_as_errors = false +undocumented = false + + + +[defines] +'TOML_ASYMMETRICAL_EQUALITY_OPS(...)' = 'static_assert(true)' +'TOML_ABI_NAMESPACE_START(...)' = '' +'TOML_ABI_NAMESPACE_BOOL(...)' = '' + + + +[meta] +'google-site-verification' = 'gbtcNgKlNiPSMKkYMw4zWFVWGPH_oU93m9n_-nb4qK8' + + + +[highlighting] +types = [] +macros = [ + 'TOML_[A-Z0-9_]+?', + 'print_value' +] +string_literals = [ '_toml' ] + + + +[badges] +'1. C++20' = [ 'badge-C++20.svg', 'https://en.cppreference.com/w/cpp/compiler_support' ] +'2. TOML v1.0.0' = [ 'badge-TOML.svg', 'https://toml.io/en/v1.0.0' ] +'3. CircleCI' = [ 'https://img.shields.io/circleci/build/github/marzer/tomlplusplus?label=circle%20ci&logo=circleci&logoColor=white&style=flat-square', 'https://circleci.com/gh/marzer/tomlplusplus' ] +'4. Mentioned in Awesome C++' = [ 'badge-awesome.svg', 'https://github.com/fffaraz/awesome-cpp' ] + + + +[autolinks] diff --git a/docs/github-icon.png b/docs/github-icon.png deleted file mode 100644 index 6e62b6c3085ffebc4403b1e8c53781817278135e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2077 zcmbtVc~nzp7LRPQh#=y~HuNP#OGlEt1PDn;fP@eh4Mvi(R1`w;LLwwDBo7jBDI|8Z zQ-okoN2@T%qKJZQ(s3LF;z$`cU<8$|6&c*dj>1euXi@s2VEf0M{xk2K_rCkx^ZWho z{qDWrd7ld6qn#bS95EP-b8HMZ0bMDU*WM2O`i38DK^IRXDj5;NGDIiVKp3_Z&VYbe zr8pBxfW*@LoU0HMgRzcKh?0?H{uYJ=RuaV)3{kICqihU@8Ln50C0P&xWI&k;6$|(L zuU$AmA!Xr`g83j{9SO-5F$Ee(SP(Cg6l6*0Qe1c#z|=EP0VRZp0lhL?rDf<@xHq~C z)V8=uIN%Kg$ztK&CY8(=0Fkf;0)mNDf`lAI0Yd0RG8Lp#f&u^vNDd)^AtZ7j0VFd( zDkG2%EIl|hnno&PByf34vCth0Cr1!9gGAElbVOYs5!Pgq$aFfL1X4&83IRnBwD~GT ztS6|ne#;76NGs7O)QAFB0TxAZ2AqqqaA>A)kDyfZ`R{~P+NDCFB_rv@Y7&_Ul9Woz zx!$0)NCNb88vhfm73HfTQUaufb2SpQA2PpXGFrP|4`czN*)X`UBv%QkkXSAYhkA%o zg_J>#ilWfy97-^S%qEkg*z72fObe!i?7+xi8k@>l=EkbDh*%|ombr?bx#VBvG9opQ z7=bk+7|v$lc-i?1RVKhkT>x7GYgA|hgNYPNQI~RrG>SY(%G1C~;7wH+ieE&2I~7t` zf<{-%VFcF7VKoB;Wr0ETU>Q0HQVAhM9F#$zNixI)DP1O`QXv{043XlN)KKob8vGw> zBs5`?rR~2MgJl;wTNd-(P@|i7*8)YlymehxhxhdUSl{LOzW0?Fp|fk(}`E3G5K2fUG~{^REN z1y0`X#=8?2Rx-REW>lkF|`R#$l9o=s;_(nQz=t7nF^G6c8L;OS|VSeOdZE}KuU zSl_*7`bwe`o?8~Ac3p60z=tMmJkE`h)@2^M^kQN+_yf;)e%+N&0)AcU>Wi?>98auW0p~W>}{Aw@=ZLX@K>_dY@U4F>) zHL>2O_2@{6>0^1Rp!Q;XbICtGU!W{&eN_~VT|M^i{8on!l_ zoV+Wis!a}@t_@WzH%z_teGV_lRydgcONK@v}QC z0_L{7KKI^*^w#m6g_P#C#cs$x*WuMA#`nu>zmh-&BXjN*DGr)Pd&(o)MmN8geEtg) zrs>}?#WKnHZ7Je5bL9NO-itjBN9vkuWzqh%Lk(evF=r6p>h|MT!sru6*v>Ug1{2qN zH%>}ohn(f~dl)DCj)9e{n!QsWTxvV;Qdm66YidpT{!46QGU2XbftT6wsAvB8 z?N?8NG;3Go2x9(Heb72D4wmjVd)>@@QGTj^a$M-t)o~g`L@oBBz7*Z36*kvbJ>P2B zHiq+QWK?(^5C$e>v@hbz9<1(j-u^17Hp~&b+3)U-J2`In>d?>;2QaG1-ZSc~%^4u*GfE7AH diff --git a/docs/badge-C++20.svg b/docs/images/badge-C++20.svg similarity index 100% rename from docs/badge-C++20.svg rename to docs/images/badge-C++20.svg diff --git a/docs/images/badge-TOML.svg b/docs/images/badge-TOML.svg new file mode 100644 index 0000000..01db3c4 --- /dev/null +++ b/docs/images/badge-TOML.svg @@ -0,0 +1 @@ +TOML: v1.0.0TOMLv1.0.0 \ No newline at end of file diff --git a/docs/badge-awesome.svg b/docs/images/badge-awesome.svg similarity index 100% rename from docs/badge-awesome.svg rename to docs/images/badge-awesome.svg diff --git a/docs/banner.ai b/docs/images/banner.ai similarity index 100% rename from docs/banner.ai rename to docs/images/banner.ai diff --git a/docs/banner_large.png b/docs/images/banner_large.png similarity index 100% rename from docs/banner_large.png rename to docs/images/banner_large.png diff --git a/docs/banner_small.png b/docs/images/banner_small.png similarity index 100% rename from docs/banner_small.png rename to docs/images/banner_small.png diff --git a/docs/favicon.ico b/docs/images/favicon.ico similarity index 100% rename from docs/favicon.ico rename to docs/images/favicon.ico diff --git a/docs/logo.ai b/docs/images/logo.ai similarity index 100% rename from docs/logo.ai rename to docs/images/logo.ai diff --git a/docs/logo.png b/docs/images/logo.png similarity index 100% rename from docs/logo.png rename to docs/images/logo.png diff --git a/docs/muu.css b/docs/muu.css deleted file mode 100644 index eaf6bb5..0000000 --- a/docs/muu.css +++ /dev/null @@ -1,337 +0,0 @@ -html, body -{ - scroll-padding-top: 3.5rem; -} - -body -{ - margin-top: 3rem; -} - -@media screen and (min-width: 768px) and (max-width: 991px) -{ - body - { - margin-top: 6rem; - } -} - -a -{ - text-decoration: none !important; -} - -header -{ - position: fixed; - left: 0; - right: 0; - top: 0; - z-index: 100; -} - -header, header * -{ - white-space: nowrap; -} - -article, article > header, article div > section -{ - margin-bottom: 5rem; -} - -article div > section > section -{ - margin-bottom: 2.25rem; -} - -article section.m-doc-details > div -{ - background-color: rgba(0,0,0,0.07) -} - -article section.m-doc-details > div > h3:first-child -{ - background-color: #22272e; -} - -pre, code, .muu-enable-if > a -{ - font-family: 'Consolas', 'Source Code Pro', monospace; -} - -a.muu-external -{ - font-weight: normal; -} -pre a.muu-external, -pre a.muu-injected -{ - font-weight: inherit !important; - color: inherit !important; -} - -.muu-enable-if -{ - margin-bottom: 2px; -} - -.muu-enable-if > * -{ - display: inline-block; - border-radius: 0.2rem; - background-clip: padding-box !important; - padding: 0px 2px; - text-decoration: none; -} - -.muu-enable-if > a -{ - white-space: nowrap; - font-size: 0.7rem; - font-weight: bold; - background-color: #858585; - color: #050505; -} - -.muu-enable-if > a:hover -{ - background-color: #747474; - color: initial; -} - -.muu-enable-if > span -{ - display: none; - padding-left: 2em; -} - -@media screen and (min-width: 576px) -{ - nav .m-thin - { - margin-left: 0.5em; - } - - nav .github - { - padding-left: 44px !important; - background-image: url("github-icon.png"); - background-repeat: no-repeat; - background-size: 25px 25px; - background-position: -30px center; - background-origin: content-box; - } -} - -@media screen and (max-width: 575px) -{ - nav .m-thin, nav .github - { - display: none; - } -} - -/* code blocks w/ output examples */ -pre.m-code + pre.m-console -{ - margin-top: -1.0rem; - border-top: 1px solid #444444; - font-size: 0.8rem; - background-color: #1a1c1d !important; -} -pre.m-code + pre.m-console span -{ - color: #bababa; /* is yououou */ -} - -/* "Parameters", "Returns" etc */ -.m-doc-details div table.m-table th, -.m-doc-details div table.m-table td strong em, -.m-doc-details div table.m-table td strong em, -body article p strong em, -body article table strong em -{ - color: #a5c9ea; - font-style: normal; -} - -/* comments */ -.m-code .c1 -{ - color: rgb(87,166,74); -} - -/* int and float literals */ -.m-code .mb, -.m-code .mi, -.m-code .mf, -.m-code .mh -{ - color: rgb(181,206,168); -} - -/* keywords */ -.m-code .k -{ - color: rgb(86,156,214); -} -.m-code .kt, -.m-code .k, -.m-code .nc -{ - font-weight: normal; -} - -/* identifier names */ -.m-code .n -{ - color: rgb(220,220,220); -} - -/* punctuators (brackets etc) */ -.m-code .p -{ - color: rgb(120,120,120); -} - -/* preprocessor directives */ -.m-code .cp -{ - color: rgb(120,120,120); -} - -/* macros */ -.m-code .m -{ - color: rgb(190,183,255); -} - -/* string literals, "includes" */ -.m-code .s, -.m-code .sa, -.m-code .dl, -.m-code .cpf -{ - color: rgb(214,157,133); -} - -/* user types and typedefs */ -.m-code .ut, -.m-code .nc -{ - color: rgb(78,201,176); -} - -/* namespace::scopes:: */ -.m-code .ns -{ - color: rgb(140,140,140); -} - -/* github badges (index.html) */ -.gh-badges -{ - padding-bottom: 0.25rem; - margin-left: -0.9rem; - margin-right: -0.9rem; - margin-top: -0.5rem; -} -@media screen and (min-width: 992px) -{ - .gh-badges - { - display: flex; - justify-content: space-between; - } - .gh-badges br - { - display: none; - } -} -@media screen and (max-width: 991px) -{ - .gh-badges - { - text-align: center; - line-height: 1.75rem; - } - .gh-badges a - { - margin-left: 0.2rem; - margin-right: 0.2rem; - margin-bottom: 0.4rem; - } -} - -/* page category subheading ("module" etc) */ -h1 span.m-thin -{ - color: #747474; -} - -/* banner on index page */ -main > article > .m-container.m-container-inflatable > .m-row > div.m-col-l-10.m-push-l-1 > img.m-image -{ - border-color: #405363; - border-style: solid; - border-width: 0.1rem; - margin-left: -1rem; - margin-right: -1rem; - margin-top: -1.75rem; - max-width: calc(100% + 2rem); -} - -/* include */ -.m-doc-details div h3 -{ - overflow: auto; -} -h1 .m-doc-include, -h3 .m-doc-include -{ - float: right; -} -h1 .m-doc-include *, -h3 .m-doc-include * -{ - opacity: 1.0 !important; -} -h1 .m-doc-include .cp, -h3 .m-doc-include .cp -{ - color: #747474; -} - -/* "Try this code on Compiler Explorer" */ -.godbolt -{ - font-family: 'Source Sans Pro', sans-serif; -} -p.godbolt -{ - text-align: center; - padding: 0.0rem; - text-indent: 0.0rem; - opacity: 0.5; -} -p.godbolt:hover -{ - opacity: 1.0; -} -a.godbolt -{ - padding: 0.5rem; - display: inline-block; -} -pre > p.godbolt -{ - float: right; -} -@media screen and (max-width: 767px) -{ - .godbolt - { - display: none; - } -} diff --git a/docs/muu.js b/docs/muu.js deleted file mode 100644 index 5ad0a10..0000000 --- a/docs/muu.js +++ /dev/null @@ -1,18 +0,0 @@ -function ToggleEnableIf(anchor) -{ - if (!anchor.hasOwnProperty('enableIfHidden')) - anchor['enableIfHidden'] = true; - anchor.enableIfHidden = !anchor.enableIfHidden; - - content = anchor.parentNode.getElementsByTagName('span')[0] - if (anchor.enableIfHidden) - { - anchor.style.display = ""; - content.style.display = ""; - } - else - { - anchor.style.display = "none"; - content.style.display = "block"; - } -} diff --git a/docs/main_page.dox b/docs/pages/main_page.dox similarity index 97% rename from docs/main_page.dox rename to docs/pages/main_page.dox index e257f5a..6dfb750 100644 --- a/docs/main_page.dox +++ b/docs/pages/main_page.dox @@ -424,7 +424,7 @@ ////////////////////////////////// /// /// \subsection mainpage-adding-lib-old-school "The old fashioned way" -/// Clone \gh2{marzer/tomlplusplus, the repository} from GitHub, and then: +/// Clone \github{marzer/tomlplusplus, the repository} from GitHub, and then: /// ///

[emoji icecream] Single-header flavour

/// 1. Drop `toml.hpp` wherever you like in your source tree @@ -475,7 +475,7 @@ /// /// \subsection mainpage-adding-lib-python Special mention: Python /// Yes, you read correctly, python. There exists a python wrapper built around toml++ called -/// \gh2{bobfang1992/pytomlpp, pytomlpp}: +/// \github{bobfang1992/pytomlpp, pytomlpp}: /// /// \bash /// pip install pytomlpp @@ -496,9 +496,9 @@ ////////////////////////////////////////////////////////////////////// /// /// \section mainpage-contributing Contributing -/// Contributions are very welcome! Either by \gh2{marzer/tomlplusplus/issues, reporting issues} +/// Contributions are very welcome! Either by \github{marzer/tomlplusplus/issues, reporting issues} /// or submitting pull requests. If you wish to submit a pull request, -/// please see \gh2{marzer/tomlplusplus/blob/master/CONTRIBUTING.md, CONTRIBUTING} +/// please see \github{marzer/tomlplusplus/blob/master/CONTRIBUTING.md, CONTRIBUTING} /// for all the details you need to get going. /// ////////////////////////////////////////////////////////////////////// @@ -516,7 +516,7 @@ ////////////////////////////////////////////////////////////////////// /// /// \section mainpage-contact Contacting the author -/// For bug reports and feature requests please use the \gh2{marzer/tomlplusplus/issues, Github Issues} +/// For bug reports and feature requests please use the \github{marzer/tomlplusplus/issues, Github Issues} /// system. For anything else you're welcome to reach out via other means. In order of likely response speed: /// - Twitter: [marzer8789](https://twitter.com/marzer8789) /// - Email: [mark.gillard@outlook.com.au](mailto:mark.gillard@outlook.com.au) diff --git a/vs/error_printer.vcxproj b/examples/error_printer.vcxproj similarity index 91% rename from vs/error_printer.vcxproj rename to examples/error_printer.vcxproj index 0ac9432..d339545 100644 --- a/vs/error_printer.vcxproj +++ b/examples/error_printer.vcxproj @@ -33,18 +33,18 @@ - + $(SolutionDir)..\examples\ - + - + - + - \ No newline at end of file + diff --git a/vs/simple_parser.vcxproj b/examples/simple_parser.vcxproj similarity index 89% rename from vs/simple_parser.vcxproj rename to examples/simple_parser.vcxproj index 2d457f1..4644429 100644 --- a/vs/simple_parser.vcxproj +++ b/examples/simple_parser.vcxproj @@ -33,19 +33,19 @@ - + $(SolutionDir)..\examples\ - + - - + + - + - \ No newline at end of file + diff --git a/vs/toml_generator.vcxproj b/examples/toml_generator.vcxproj similarity index 91% rename from vs/toml_generator.vcxproj rename to examples/toml_generator.vcxproj index e4a8188..95f971d 100644 --- a/vs/toml_generator.vcxproj +++ b/examples/toml_generator.vcxproj @@ -34,18 +34,18 @@ - + $(SolutionDir)..\examples\ - + - + - + - \ No newline at end of file + diff --git a/vs/toml_to_json_transcoder.vcxproj b/examples/toml_to_json_transcoder.vcxproj similarity index 91% rename from vs/toml_to_json_transcoder.vcxproj rename to examples/toml_to_json_transcoder.vcxproj index 036aeb3..6891f40 100644 --- a/vs/toml_to_json_transcoder.vcxproj +++ b/examples/toml_to_json_transcoder.vcxproj @@ -34,18 +34,18 @@ - + $(SolutionDir)..\examples\ - + - + - + - \ No newline at end of file + diff --git a/extern/Catch2 b/extern/Catch2 deleted file mode 160000 index 87074da..0000000 --- a/extern/Catch2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 87074da73ecb1c2e7c35fd14f50ca21c4c002adc diff --git a/extern/mcss b/extern/mcss deleted file mode 160000 index 42d4a9a..0000000 --- a/extern/mcss +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 42d4a9a48f31f5df6e246c948403b54b50574a2a diff --git a/extern/tloptional b/extern/tloptional deleted file mode 160000 index 0dfc7b4..0000000 --- a/extern/tloptional +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0dfc7b4e41b1245e47936d6c99bf8e3d80e42b9f diff --git a/external/Catch2 b/external/Catch2 new file mode 160000 index 0000000..5c88067 --- /dev/null +++ b/external/Catch2 @@ -0,0 +1 @@ +Subproject commit 5c88067bd339465513af4aec606bd2292f1b594a diff --git a/external/dox b/external/dox new file mode 160000 index 0000000..7b0185b --- /dev/null +++ b/external/dox @@ -0,0 +1 @@ +Subproject commit 7b0185b36ed56e4963315aafdc444818b97d21f3 diff --git a/external/tloptional b/external/tloptional new file mode 160000 index 0000000..e28828e --- /dev/null +++ b/external/tloptional @@ -0,0 +1 @@ +Subproject commit e28828efa021bf51f1c8cc3248642ec5a636c8d7 diff --git a/extern/toml-spec-tests b/external/toml-spec-tests similarity index 100% rename from extern/toml-spec-tests rename to external/toml-spec-tests diff --git a/extern/toml-test b/external/toml-test similarity index 100% rename from extern/toml-test rename to external/toml-test diff --git a/include/toml++/toml.h b/include/toml++/toml.h index 2af0678..405b8f3 100644 --- a/include/toml++/toml.h +++ b/include/toml++/toml.h @@ -12,8 +12,8 @@ #include "toml_preprocessor.h" -TOML_PUSH_WARNINGS -TOML_DISABLE_SPAM_WARNINGS +TOML_PUSH_WARNINGS; +TOML_DISABLE_SPAM_WARNINGS; #include "toml_common.h" #include "toml_date_time.h" @@ -50,7 +50,7 @@ TOML_DISABLE_SPAM_WARNINGS #endif // TOML_IMPLEMENTATION -TOML_POP_WARNINGS // TOML_DISABLE_SPAM_WARNINGS +TOML_POP_WARNINGS; // TOML_DISABLE_SPAM_WARNINGS // macro hygiene #if TOML_UNDEF_MACROS diff --git a/include/toml++/toml_array.h b/include/toml++/toml_array.h index 40af08b..311360d 100644 --- a/include/toml++/toml_array.h +++ b/include/toml++/toml_array.h @@ -6,6 +6,7 @@ #pragma once #include "toml_value.h" +/// \cond TOML_IMPL_NAMESPACE_START { template @@ -165,7 +166,7 @@ TOML_IMPL_NAMESPACE_START return *(raw_ + idx)->get(); } - TOML_DISABLE_WARNINGS + TOML_DISABLE_WARNINGS; template > operator array_iterator() const noexcept @@ -173,7 +174,7 @@ TOML_IMPL_NAMESPACE_START return array_iterator{ raw_ }; } - TOML_ENABLE_WARNINGS + TOML_ENABLE_WARNINGS; }; template @@ -248,7 +249,8 @@ TOML_IMPL_NAMESPACE_START return make_node(std::move(val.value)); } } -TOML_IMPL_NAMESPACE_END +TOML_IMPL_NAMESPACE_END; +/// \endcond TOML_NAMESPACE_START { @@ -313,6 +315,8 @@ TOML_NAMESPACE_START : public node { private: + /// \cond + friend class TOML_PARSER_TYPENAME; std::vector> elements; @@ -334,6 +338,11 @@ TOML_NAMESPACE_START void lh_dtor() noexcept; #endif + [[nodiscard]] size_t total_leaf_count() const noexcept; + + void flatten_child(array&& child, size_t& dest_index) noexcept; + /// \endcond + public: using value_type = node; @@ -423,6 +432,9 @@ TOML_NAMESPACE_START #endif } + /// \name Type checks + /// @{ + [[nodiscard]] node_type type() const noexcept override; [[nodiscard]] bool is_table() const noexcept override; [[nodiscard]] bool is_array() const noexcept override; @@ -449,6 +461,11 @@ TOML_NAMESPACE_START return is_homogeneous(impl::node_type_of); } + /// @} + + /// \name Array operations + /// @{ + /// \brief Gets a reference to the element at a specific index. [[nodiscard]] node& operator[] (size_t index) noexcept; /// \brief Gets a reference to the element at a specific index. @@ -512,10 +529,9 @@ TOML_NAMESPACE_START /// \param pos The insertion position. /// \param val The node or value being inserted. /// - /// \returns Valid input:
- /// An iterator to the newly-inserted element. - ///

- /// `val` is an empty toml::node_view:
+ /// \returns \conditional_return{Valid input} + /// An iterator to the newly-inserted element. + /// \conditional_return{Input is an empty toml::node_view} /// end() /// /// \attention The return value will always be `end()` if the input value was an empty toml::node_view, @@ -559,13 +575,11 @@ TOML_NAMESPACE_START /// \param count The number of times the node or value should be inserted. /// \param val The node or value being inserted. /// - /// \returns Valid input:
+ /// \returns \conditional_return{Valid input} /// An iterator to the newly-inserted element. - ///

- /// `count == 0`:
+ /// \conditional_return{count == 0} /// A copy of pos - ///

- /// `val` is an empty toml::node_view:
+ /// \conditional_return{Input is an empty toml::node_view} /// end() /// /// \attention The return value will always be `end()` if the input value was an empty toml::node_view, @@ -604,13 +618,11 @@ TOML_NAMESPACE_START /// \param first Iterator to the first node or value being inserted. /// \param last Iterator to the one-past-the-last node or value being inserted. /// - /// \returns Valid input:
+ /// \returns \conditional_return{Valid input} /// An iterator to the first newly-inserted element. - ///

- /// `first >= last`:
+ /// \conditional_return{first >= last} /// A copy of pos - ///

- /// All objects in the range were empty toml::node_views:
+ /// \conditional_return{All objects in the range were empty toml::node_views} /// A copy of pos template iterator insert(const_iterator pos, Iter first, Iter last) noexcept @@ -656,14 +668,12 @@ TOML_NAMESPACE_START /// \param pos The insertion position. /// \param ilist An initializer list containing the values to be inserted. /// - /// \returns Valid input:
- /// An iterator to the first newly-inserted element. - ///

- /// `ilist.size() == 0`:
- /// A copy of pos - ///

- /// All objects in the list were empty toml::node_views:
- /// A copy of pos + /// \returns \conditional_return{Valid input} + /// An iterator to the first newly-inserted element. + /// \conditional_return{Input list is empty} + /// A copy of pos + /// \conditional_return{All objects in the list were empty toml::node_views} + /// A copy of pos template iterator insert(const_iterator pos, std::initializer_list ilist) noexcept { @@ -955,6 +965,40 @@ TOML_NAMESPACE_START return nullptr; } + /// \brief Flattens this array, recursively hoisting the contents of child arrays up into itself. + /// + /// \detail \cpp + /// + /// auto arr = toml::array{ 1, 2, toml::array{ 3, 4, toml::array{ 5 } }, 6, toml::array{} }; + /// std::cout << arr << "\n"; + /// + /// arr.flatten(); + /// std::cout << arr << "\n"; + /// + /// \ecpp + /// + /// \out + /// [ 1, 2, [ 3, 4, [ 5 ] ], 6, [] ] + /// [ 1, 2, 3, 4, 5, 6 ] + /// \eout + /// + /// \remarks Arrays inside child tables are not flattened. + /// + /// \returns A reference to the array. + array& flatten()&; + + /// \brief Flattens this array, recursively hoisting the contents of child arrays up into itself (rvalue overload). + /// \returns An rvalue reference to the array. + array&& flatten()&& + { + return static_cast(this->flatten()); + } + + /// @} + + /// \name Equality + /// @{ + /// \brief Equality operator. /// /// \param lhs The LHS array. @@ -999,10 +1043,6 @@ TOML_NAMESPACE_START return true; } - [[nodiscard]] size_t total_leaf_count() const noexcept; - - void flatten_child(array&& child, size_t& dest_index) noexcept; - public: /// \brief Initializer list equality operator. @@ -1012,7 +1052,7 @@ TOML_NAMESPACE_START { return container_equality(lhs, rhs); } - TOML_ASYMMETRICAL_EQUALITY_OPS(const array&, const std::initializer_list&, template ) + TOML_ASYMMETRICAL_EQUALITY_OPS(const array&, const std::initializer_list&, template ); /// \brief Vector equality operator. template @@ -1021,36 +1061,9 @@ TOML_NAMESPACE_START { return container_equality(lhs, rhs); } - TOML_ASYMMETRICAL_EQUALITY_OPS(const array&, const std::vector&, template ) + TOML_ASYMMETRICAL_EQUALITY_OPS(const array&, const std::vector&, template ); - /// \brief Flattens this array, recursively hoisting the contents of child arrays up into itself. - /// - /// \detail \cpp - /// - /// auto arr = toml::array{ 1, 2, toml::array{ 3, 4, toml::array{ 5 } }, 6, toml::array{} }; - /// std::cout << arr << "\n"; - /// - /// arr.flatten(); - /// std::cout << arr << "\n"; - /// - /// \ecpp - /// - /// \out - /// [ 1, 2, [ 3, 4, [ 5 ] ], 6, [] ] - /// [ 1, 2, 3, 4, 5, 6 ] - /// \eout - /// - /// \remarks Arrays inside child tables are not flattened. - /// - /// \returns A reference to the array. - array& flatten() &; - - /// \brief Flattens this array, recursively hoisting the contents of child arrays up into itself (rvalue overload). - /// \returns An rvalue reference to the array. - array&& flatten() && - { - return static_cast(this->flatten()); - } + /// @} /// \brief Prints the array out to a stream as formatted TOML. template @@ -1058,4 +1071,4 @@ TOML_NAMESPACE_START // implemented in toml_default_formatter.h }; } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; diff --git a/include/toml++/toml_array.hpp b/include/toml++/toml_array.hpp index 4fc018a..ef5b7dd 100644 --- a/include/toml++/toml_array.hpp +++ b/include/toml++/toml_array.hpp @@ -355,4 +355,4 @@ TOML_NAMESPACE_START return is_homogeneous(node_type::table); } } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; diff --git a/include/toml++/toml_common.h b/include/toml++/toml_common.h index c45fd79..c47793e 100644 --- a/include/toml++/toml_common.h +++ b/include/toml++/toml_common.h @@ -10,7 +10,7 @@ //# INCLUDES //#==================================================================================================================== -TOML_DISABLE_WARNINGS +TOML_DISABLE_WARNINGS; #include #include #include @@ -30,7 +30,7 @@ TOML_DISABLE_WARNINGS #if TOML_HAS_INCLUDE() #include #endif -TOML_ENABLE_WARNINGS +TOML_ENABLE_WARNINGS; #ifdef __cpp_lib_launder #define TOML_LAUNDER(x) std::launder(x) @@ -42,7 +42,7 @@ TOML_ENABLE_WARNINGS //# ENVIRONMENT GROUND-TRUTHS //#==================================================================================================================== -#ifndef DOXYGEN +/// \cond #ifndef TOML_DISABLE_ENVIRONMENT_CHECKS #define TOML_ENV_MESSAGE \ "If you're seeing this error it's because you're building toml++ for an environment that doesn't conform to " \ @@ -61,13 +61,14 @@ static_assert(std::numeric_limits::digits10 == 15, TOML_ENV_MESSAGE); #undef TOML_ENV_MESSAGE #endif // !TOML_DISABLE_ENVIRONMENT_CHECKS -#endif // !DOXYGEN +/// \endcond //#==================================================================================================================== //# UNDOCUMENTED TYPEDEFS AND FORWARD DECLARATIONS //#==================================================================================================================== -#ifndef DOXYGEN // undocumented forward declarations are hidden from doxygen because they fuck it up =/ +/// \cond +// undocumented forward declarations are hidden from doxygen because they fuck it up =/ namespace toml // non-abi namespace; this is not an error { @@ -103,7 +104,7 @@ TOML_NAMESPACE_START // abi namespace TOML_ABI_NAMESPACE_BOOL(TOML_HAS_CUSTOM_OPTIONAL_TYPE, custopt, stdopt) struct date_time; - TOML_ABI_NAMESPACE_END + TOML_ABI_NAMESPACE_END; class node; class array; @@ -182,12 +183,12 @@ TOML_NAMESPACE_START // abi namespace #define TOML_PARSER_TYPENAME TOML_NAMESPACE::impl::parser #endif class parser; - TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS + TOML_ABI_NAMESPACE_END; // TOML_EXCEPTIONS } } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; -#endif // !DOXYGEN +/// \endcond //#==================================================================================================================== //# TYPEDEFS AND FORWARD DECLARATIONS @@ -271,12 +272,13 @@ TOML_NAMESPACE_START // abi namespace }; template inserter(T&&) -> inserter; } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; //#==================================================================================================================== //# VALUE AND NODE TRAITS //#==================================================================================================================== +/// \cond TOML_IMPL_NAMESPACE_START { // general value traits @@ -529,7 +531,8 @@ TOML_IMPL_NAMESPACE_START template inline constexpr node_type node_type_of = node_type_getter>>::value; } -TOML_IMPL_NAMESPACE_END +TOML_IMPL_NAMESPACE_END; +/// \endcond TOML_NAMESPACE_START { @@ -577,12 +580,13 @@ TOML_NAMESPACE_START template inline constexpr bool is_node_view = impl::is_one_of, node_view, node_view>; } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; //#==================================================================================================================== //# INTERNAL HELPERS //#==================================================================================================================== +/// \cond TOML_IMPL_NAMESPACE_START { template @@ -677,7 +681,8 @@ TOML_IMPL_NAMESPACE_START "date-time"sv }; } -TOML_IMPL_NAMESPACE_END +TOML_IMPL_NAMESPACE_END; +/// \endcond TOML_NAMESPACE_START { @@ -689,7 +694,7 @@ TOML_NAMESPACE_START return static_cast(n); } } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; //#==================================================================================================================== //# SOURCE POSITIONS & REGIONS @@ -824,10 +829,10 @@ TOML_NAMESPACE_START #if TOML_WINDOWS_COMPAT /// \brief The path to the corresponding source document as a wide-string. + /// + /// \availability This function is only available when #TOML_WINDOWS_COMPAT is enabled. /// /// \remarks This will return an empty optional if no path was provided to toml::parse(). - /// - /// \attention This function is only available when #TOML_WINDOWS_COMPAT is enabled. [[nodiscard]] optional wide_path() const noexcept { @@ -839,9 +844,9 @@ TOML_NAMESPACE_START #endif }; - TOML_ABI_NAMESPACE_END // TOML_LARGE_FILES + TOML_ABI_NAMESPACE_END; // TOML_LARGE_FILES } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; //#==================================================================================================================== //# OTHER @@ -864,7 +869,7 @@ TOML_NAMESPACE_START /// \brief Format integer values as hexadecimal. format_as_hexadecimal = 3, }; - TOML_MAKE_BITOPS(value_flags) + TOML_MAKE_BITOPS(value_flags); /// \brief Format flags for modifying how TOML data is printed to streams. enum class format_flags : uint8_t @@ -884,7 +889,7 @@ TOML_NAMESPACE_START /// \brief Values with special format flags will be formatted accordingly. allow_value_format_flags = 8, }; - TOML_MAKE_BITOPS(format_flags) + TOML_MAKE_BITOPS(format_flags); /// \brief Pretty-prints the value of a node_type to a stream. /// @@ -917,8 +922,7 @@ TOML_NAMESPACE_START } } - #ifndef DOXYGEN - + /// \cond namespace impl { #define TOML_P2S_DECL(Type) \ @@ -949,7 +953,7 @@ TOML_NAMESPACE_START extern template TOML_API std::ostream& operator << (std::ostream&, node_type); #endif // !TOML_HEADER_ONLY - #endif // !DOXYGEN + /// \endcond } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; diff --git a/include/toml++/toml_date_time.h b/include/toml++/toml_date_time.h index 8bdfd19..ef728c4 100644 --- a/include/toml++/toml_date_time.h +++ b/include/toml++/toml_date_time.h @@ -400,7 +400,7 @@ TOML_NAMESPACE_START } }; - TOML_ABI_NAMESPACE_END // TOML_HAS_CUSTOM_OPTIONAL_TYPE + TOML_ABI_NAMESPACE_END; // TOML_HAS_CUSTOM_OPTIONAL_TYPE /// \brief Prints a date_time out to a stream in RFC 3339 format. /// \detail \cpp @@ -425,4 +425,4 @@ TOML_NAMESPACE_START extern template TOML_API std::ostream& operator << (std::ostream&, const date_time&); #endif } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; diff --git a/include/toml++/toml_default_formatter.h b/include/toml++/toml_default_formatter.h index a20a3c7..6c7c66a 100644 --- a/include/toml++/toml_default_formatter.h +++ b/include/toml++/toml_default_formatter.h @@ -9,16 +9,18 @@ #include "toml_array.h" #include "toml_utf8.h" -TOML_PUSH_WARNINGS -TOML_DISABLE_SWITCH_WARNINGS +TOML_PUSH_WARNINGS; +TOML_DISABLE_SWITCH_WARNINGS; +/// \cond TOML_IMPL_NAMESPACE_START { [[nodiscard]] TOML_API std::string default_formatter_make_key_segment(const std::string&) noexcept; [[nodiscard]] TOML_API size_t default_formatter_inline_columns(const node&) noexcept; [[nodiscard]] TOML_API bool default_formatter_forces_multiline(const node&, size_t = 0) noexcept; } -TOML_IMPL_NAMESPACE_END +TOML_IMPL_NAMESPACE_END; +/// \endcond TOML_NAMESPACE_START { @@ -406,7 +408,7 @@ TOML_NAMESPACE_START #endif // !DOXYGEN } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; -TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS +TOML_POP_WARNINGS; // TOML_DISABLE_SWITCH_WARNINGS diff --git a/include/toml++/toml_default_formatter.hpp b/include/toml++/toml_default_formatter.hpp index b8870b1..b739425 100644 --- a/include/toml++/toml_default_formatter.hpp +++ b/include/toml++/toml_default_formatter.hpp @@ -12,13 +12,13 @@ //# }} #include "toml_default_formatter.h" -TOML_DISABLE_WARNINGS +TOML_DISABLE_WARNINGS; #include -TOML_ENABLE_WARNINGS +TOML_ENABLE_WARNINGS; -TOML_PUSH_WARNINGS -TOML_DISABLE_SWITCH_WARNINGS -TOML_DISABLE_ARITHMETIC_WARNINGS +TOML_PUSH_WARNINGS; +TOML_DISABLE_SWITCH_WARNINGS; +TOML_DISABLE_ARITHMETIC_WARNINGS; TOML_IMPL_NAMESPACE_START { @@ -160,7 +160,7 @@ TOML_IMPL_NAMESPACE_START return (default_formatter_inline_columns(node) + starting_column_bias) >= default_formatter_line_wrap; } } -TOML_IMPL_NAMESPACE_END +TOML_IMPL_NAMESPACE_END; TOML_NAMESPACE_START { @@ -199,14 +199,14 @@ TOML_NAMESPACE_START base::clear_naked_newline(); } } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; // implementations of windows wide string nonsense #if TOML_WINDOWS_COMPAT -TOML_DISABLE_WARNINGS +TOML_DISABLE_WARNINGS; #include // fuckkkk :( -TOML_ENABLE_WARNINGS +TOML_ENABLE_WARNINGS; TOML_IMPL_NAMESPACE_START { @@ -260,8 +260,8 @@ TOML_IMPL_NAMESPACE_START #endif // __cpp_lib_char8_t } -TOML_IMPL_NAMESPACE_END +TOML_IMPL_NAMESPACE_END; #endif // TOML_WINDOWS_COMPAT -TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_ARITHMETIC_WARNINGS +TOML_POP_WARNINGS; // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_ARITHMETIC_WARNINGS diff --git a/include/toml++/toml_formatter.h b/include/toml++/toml_formatter.h index d5f7791..c12073f 100644 --- a/include/toml++/toml_formatter.h +++ b/include/toml++/toml_formatter.h @@ -6,9 +6,10 @@ #pragma once #include "toml_print_to_stream.h" -TOML_PUSH_WARNINGS -TOML_DISABLE_SWITCH_WARNINGS +TOML_PUSH_WARNINGS; +TOML_DISABLE_SWITCH_WARNINGS; +/// \cond TOML_IMPL_NAMESPACE_START { template @@ -232,6 +233,7 @@ TOML_IMPL_NAMESPACE_START #endif } -TOML_IMPL_NAMESPACE_END +TOML_IMPL_NAMESPACE_END; +/// \endcond -TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS +TOML_POP_WARNINGS; // TOML_DISABLE_SWITCH_WARNINGS diff --git a/include/toml++/toml_instantiations.hpp b/include/toml++/toml_instantiations.hpp index 6c3f4dc..1414113 100644 --- a/include/toml++/toml_instantiations.hpp +++ b/include/toml++/toml_instantiations.hpp @@ -14,11 +14,11 @@ #endif //# }} -TOML_DISABLE_WARNINGS +TOML_DISABLE_WARNINGS; #include #include #include -TOML_ENABLE_WARNINGS +TOML_ENABLE_WARNINGS; #include "toml_node_view.h" #include "toml_default_formatter.h" @@ -36,7 +36,7 @@ TOML_IMPL_NAMESPACE_START // print to stream machinery template TOML_API void print_floating_point_to_stream(double, std::ostream&, bool); } -TOML_IMPL_NAMESPACE_END +TOML_IMPL_NAMESPACE_END; // public namespace TOML_NAMESPACE_START @@ -148,8 +148,8 @@ TOML_NAMESPACE_START template TOML_API parse_result parse_file(std::wstring_view) TOML_MAY_THROW; #endif - TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS + TOML_ABI_NAMESPACE_END; // TOML_EXCEPTIONS #endif // TOML_PARSER } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; diff --git a/include/toml++/toml_json_formatter.h b/include/toml++/toml_json_formatter.h index 95d0b4c..b5caf94 100644 --- a/include/toml++/toml_json_formatter.h +++ b/include/toml++/toml_json_formatter.h @@ -6,8 +6,8 @@ #pragma once #include "toml_formatter.h" -TOML_PUSH_WARNINGS -TOML_DISABLE_SWITCH_WARNINGS +TOML_PUSH_WARNINGS; +TOML_DISABLE_SWITCH_WARNINGS; TOML_NAMESPACE_START { @@ -154,6 +154,6 @@ TOML_NAMESPACE_START extern template TOML_API std::ostream& operator << (std::ostream&, json_formatter&&); #endif } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; -TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS +TOML_POP_WARNINGS; // TOML_DISABLE_SWITCH_WARNINGS diff --git a/include/toml++/toml_json_formatter.hpp b/include/toml++/toml_json_formatter.hpp index 83cb42d..e9ceb8d 100644 --- a/include/toml++/toml_json_formatter.hpp +++ b/include/toml++/toml_json_formatter.hpp @@ -13,8 +13,8 @@ #include "toml_json_formatter.h" -TOML_PUSH_WARNINGS -TOML_DISABLE_SWITCH_WARNINGS +TOML_PUSH_WARNINGS; +TOML_DISABLE_SWITCH_WARNINGS; TOML_NAMESPACE_START { @@ -58,6 +58,6 @@ TOML_NAMESPACE_START base::clear_naked_newline(); } } -TOML_NAMESPACE_END +TOML_NAMESPACE_END; -TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS +TOML_POP_WARNINGS; // TOML_DISABLE_SWITCH_WARNINGS diff --git a/include/toml++/toml_node.h b/include/toml++/toml_node.h index c5627bc..14c49b0 100644 --- a/include/toml++/toml_node.h +++ b/include/toml++/toml_node.h @@ -67,6 +67,35 @@ TOML_NAMESPACE_START friend class TOML_PARSER_TYPENAME; source_region source_{}; + /// \cond + + template + [[nodiscard]] + decltype(auto) get_value_exact() const noexcept; + + template + [[nodiscard]] + TOML_ATTR(pure) + static decltype(auto) do_ref(N&& n) noexcept + { + using type = impl::unwrap_node; + static_assert( + (impl::is_native || impl::is_one_of) && !impl::is_cvref, + "The template type argument of node::ref() must be one of:" + TOML_SA_UNWRAPPED_NODE_TYPE_LIST + ); + TOML_ASSERT( + n.template is() + && "template type argument T provided to toml::node::ref() didn't match the node's actual type" + ); + if constexpr (impl::is_native) + return std::forward(n).template ref_cast().get(); + else + return std::forward(n).template ref_cast(); + } + + /// \endcond + protected: node() noexcept = default; @@ -109,7 +138,8 @@ TOML_NAMESPACE_START virtual ~node() noexcept = default; - + /// \name Type checks + /// @{ #if defined(DOXYGEN) || !TOML_ICC || TOML_ICC_CL @@ -183,35 +213,6 @@ TOML_NAMESPACE_START else if constexpr (std::is_same_v) return is_date_time(); } - /// \brief Returns a pointer to the node as a toml::table, if it is one. - [[nodiscard]] virtual table* as_table() noexcept; - /// \brief Returns a pointer to the node as a toml::array, if it is one. - [[nodiscard]] virtual array* as_array() noexcept; - /// \brief Returns a pointer to the node as a toml::value, if it is one. - [[nodiscard]] virtual toml::value* as_string() noexcept; - /// \brief Returns a pointer to the node as a toml::value, if it is one. - [[nodiscard]] virtual toml::value* as_integer() noexcept; - /// \brief Returns a pointer to the node as a toml::value, if it is one. - [[nodiscard]] virtual toml::value* as_floating_point() noexcept; - /// \brief Returns a pointer to the node as a toml::value, if it is one. - [[nodiscard]] virtual toml::value* as_boolean() noexcept; - /// \brief Returns a pointer to the node as a toml::value, if it is one. - [[nodiscard]] virtual toml::value* as_date() noexcept; - /// \brief Returns a pointer to the node as a toml::value