Skip to content

Commit

Permalink
added for_each() for tables and arrays
Browse files Browse the repository at this point in the history
also:
- refactoring
- documentation fixes
- updated conformance tests
- made submodules shallow
  • Loading branch information
marzer committed Apr 24, 2022
1 parent db04ac8 commit bf13bbd
Show file tree
Hide file tree
Showing 56 changed files with 1,448 additions and 238 deletions.
16 changes: 9 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
[submodule "external/toml-test"]
path = external/toml-test
url = https://github.com/BurntSushi/toml-test.git
shallow = true
[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
branch = v2.x
shallow = true
[submodule "external/tloptional"]
path = external/tloptional
url = https://github.com/TartanLlama/optional.git
shallow = true
[submodule "external/json"]
path = external/json
url = https://github.com/nlohmann/json.git
shallow = true
[submodule "external/Catch2"]
path = external/Catch2
url = https://github.com/catchorg/Catch2.git
branch = v2.x
shallow = true
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,19 @@ template:
-->


## Unreleased
## [v3.1.0](https://github.com/marzer/tomlplusplus/releases/tag/v3.1.0) - 2022-04-22

#### Fixes:
- Fixed potential segfault when calling `at_path()` with an empty string
- Fixed UB in internal unicode machinery (#144) (@kchalmer)
- Fixed a number of spurious warnings with Clang 10 (#145, #146) (@chronoxor)

#### Additions:
- Added `toml::array::for_each()`
- Added `toml::table::for_each()`
- Added config options `TOML_EXPORTED_CLASS`, `TOML_EXPORTED_MEMBER_FUNCTION`, `TOML_EXPORTED_STATIC_FUNCTION` & `TOML_EXPORTED_FREE_FUNCTION`
- Add support for escape sequence `\e` when using `TOML_ENABLE_UNRELEASED_FEATURES` ([toml/790](https://github.com/toml-lang/toml/pull/790))
- Add support for more unicode in bare keys when using `TOML_ENABLE_UNRELEASED_FEATURES` ([toml/891](https://github.com/toml-lang/toml/pull/891))
- Added support for escape sequence `\e` when using `TOML_ENABLE_UNRELEASED_FEATURES` ([toml/790](https://github.com/toml-lang/toml/pull/790))
- Added support for more unicode in bare keys when using `TOML_ENABLE_UNRELEASED_FEATURES` ([toml/891](https://github.com/toml-lang/toml/pull/891))

#### Removals/Deprecations:
- Deprecated old `TOML_API` option in favour new `TOML_EXPORTED_X` options
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14)

project(
tomlplusplus
VERSION 3.0.1
VERSION 3.1.0
DESCRIPTION "Header-only TOML config file parser and serializer for C++17"
HOMEPAGE_URL "https://marzer.github.io/tomlplusplus/"
LANGUAGES CXX
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ You'll find some more code examples in the `examples` directory, and plenty more
2. `#include <toml++/toml.h>`
### Conan
Add `tomlplusplus/3.0.1` to your conanfile.
Add `tomlplusplus/3.1.0` to your conanfile.
### DDS
Add `tomlpp` to your `package.json5`, e.g.:
```
depends: [
'tomlpp^3.0.1',
'tomlpp^3.1.0',
]
```
> ℹ&#xFE0F; _[What is DDS?](https://dds.pizza/)_
Expand All @@ -121,12 +121,21 @@ include(FetchContent)
FetchContent_Declare(
tomlplusplus
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
GIT_TAG v3.0.1
GIT_TAG v3.1.0
)
FetchContent_MakeAvailable(tomlplusplus)
```
> ℹ&#xFE0F; _[What is FetchContent?](https://cmake.org/cmake/help/latest/module/FetchContent.html)_
### Git submodules
```
git submodule add --depth 1 https://github.com/marzer/tomlplusplus.git tomlplusplus
git config -f .gitmodules submodule.tomlplusplus.shallow true
```
> ℹ&#xFE0F; The toml++ repository has some submodules of its own, but **they are only used for testing**!
> You do not need to use the `--recursive` option for regular library consumption.
### Other environments and package managers
`toml++` is a fairly new project and I'm not up-to-speed with all of the available packaging and integration options
in the C++ ecosystem. I'm also a cmake novice, for better or worse. If there's an integration option missing be
Expand Down
16 changes: 13 additions & 3 deletions docs/pages/main_page.dox
Original file line number Diff line number Diff line change
Expand Up @@ -457,15 +457,15 @@


\subsection mainpage-adding-lib-conan Conan
Add `tomlplusplus/3.0.1` to your conanfile.
Add `tomlplusplus/3.1.0` to your conanfile.



\subsection mainpage-adding-lib-dds DDS
Add `tomlpp` to your `package.json5`, e.g.:
\bash
depends: [
'tomlpp^3.0.1',
'tomlpp^3.1.0',
]
\ebash

Expand Down Expand Up @@ -497,7 +497,7 @@
FetchContent_Declare(
tomlplusplus
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
GIT_TAG v3.0.1
GIT_TAG v3.1.0
)
FetchContent_MakeAvailable(tomlplusplus)
\endcode
Expand All @@ -506,6 +506,16 @@



\subsection mainpage-adding-lib-git-submodules Git submodules
\bash
git submodule add --depth 1 https://github.com/marzer/tomlplusplus.git tomlplusplus
git config -f .gitmodules submodule.tomlplusplus.shallow true
\ebash
\note The toml++ repository has some submodules of its own, but **they are only used for testing**! You do not need to
use the `--recursive` option for regular library consumption.



\subsection mainpage-adding-lib-other Other environments and package managers
toml++ is a fairly new project and I'm not up-to-speed with all of the available packaging and integration options
in the C++ ecosystem. I'm also a cmake novice, for better or worse. If there's an integration option missing
Expand Down
2 changes: 1 addition & 1 deletion external/json
Submodule json updated 84 files
+1 −0 .clang-tidy
+0 −57 .github/ISSUE_TEMPLATE/Bug_report.md
+93 −0 .github/ISSUE_TEMPLATE/bug.yaml
+6 −5 .github/workflows/codeql-analysis.yml
+4 −3 .github/workflows/macos.yml
+19 −18 .github/workflows/ubuntu.yml
+12 −46 .github/workflows/windows.yml
+9 −2 CMakeLists.txt
+7 −14 README.md
+3 −3 appveyor.yml
+1 −1 benchmarks/CMakeLists.txt
+366 −336 cmake/ci.cmake
+204 −0 cmake/test.cmake
+1 −1 doc/mkdocs/docs/api/basic_json/at.md
+1 −1 doc/mkdocs/docs/api/basic_json/index.md
+3 −2 doc/mkdocs/docs/api/json_pointer/back.md
+14 −5 doc/mkdocs/docs/api/json_pointer/index.md
+3 −2 doc/mkdocs/docs/api/json_pointer/json_pointer.md
+2 −2 doc/mkdocs/docs/api/json_pointer/operator_slash.md
+2 −2 doc/mkdocs/docs/api/json_pointer/operator_slasheq.md
+5 −4 doc/mkdocs/docs/api/json_pointer/operator_string.md
+4 −3 doc/mkdocs/docs/api/json_pointer/push_back.md
+12 −0 doc/mkdocs/docs/api/json_pointer/string_t.md
+3 −2 doc/mkdocs/docs/api/json_pointer/to_string.md
+4 −0 doc/mkdocs/docs/api/macros/index.md
+63 −2 doc/mkdocs/docs/features/macros.md
+2 −9 doc/mkdocs/docs/integration/cmake.md
+1 −0 doc/mkdocs/mkdocs.yml
+24 −24 include/nlohmann/detail/conversions/from_json.hpp
+41 −30 include/nlohmann/detail/exceptions.hpp
+38 −20 include/nlohmann/detail/input/binary_reader.hpp
+5 −4 include/nlohmann/detail/input/json_sax.hpp
+18 −17 include/nlohmann/detail/input/parser.hpp
+14 −14 include/nlohmann/detail/iterators/iter_impl.hpp
+2 −2 include/nlohmann/detail/iterators/json_reverse_iterator.hpp
+2 −2 include/nlohmann/detail/iterators/primitive_iterator.hpp
+127 −75 include/nlohmann/detail/json_pointer.hpp
+9 −0 include/nlohmann/detail/macro_scope.hpp
+12 −8 include/nlohmann/detail/macro_unscope.hpp
+6 −2 include/nlohmann/detail/meta/cpp_future.hpp
+19 −4 include/nlohmann/detail/meta/type_traits.hpp
+4 −3 include/nlohmann/detail/output/binary_writer.hpp
+3 −2 include/nlohmann/detail/output/serializer.hpp
+139 −0 include/nlohmann/detail/string_concat.hpp
+12 −10 include/nlohmann/detail/string_escape.hpp
+165 −88 include/nlohmann/json.hpp
+3 −2 include/nlohmann/ordered_map.hpp
+937 −588 single_include/nlohmann/json.hpp
+96 −132 test/CMakeLists.txt
+20 −0 test/cmake_fetch_content2/CMakeLists.txt
+15 −0 test/cmake_fetch_content2/project/CMakeLists.txt
+8 −0 test/cmake_fetch_content2/project/main.cpp
+1 −3 test/src/unit-algorithms.cpp
+2 −0 test/src/unit-allocator.cpp
+51 −6 test/src/unit-alt-string.cpp
+16 −36 test/src/unit-bson.cpp
+36 −106 test/src/unit-cbor.cpp
+4 −8 test/src/unit-class_const_iterator.cpp
+95 −8 test/src/unit-class_iterator.cpp
+199 −323 test/src/unit-class_parser.cpp
+8 −0 test/src/unit-comparison.cpp
+34 −72 test/src/unit-constructor1.cpp
+115 −6 test/src/unit-convenience.cpp
+142 −269 test/src/unit-conversions.cpp
+16 −46 test/src/unit-deserialization.cpp
+96 −201 test/src/unit-element_access1.cpp
+115 −236 test/src/unit-element_access2.cpp
+0 −7 test/src/unit-items.cpp
+40 −80 test/src/unit-iterators1.cpp
+180 −296 test/src/unit-iterators2.cpp
+59 −106 test/src/unit-json_patch.cpp
+129 −119 test/src/unit-json_pointer.cpp
+37 −97 test/src/unit-modifiers.cpp
+45 −73 test/src/unit-msgpack.cpp
+77 −126 test/src/unit-reference_access.cpp
+46 −125 test/src/unit-regression1.cpp
+107 −69 test/src/unit-regression2.cpp
+4 −8 test/src/unit-serialization.cpp
+32 −64 test/src/unit-ubjson.cpp
+0 −1 test/src/unit-udt.cpp
+7 −21 test/src/unit-unicode1.cpp
+1 −1 third_party/amalgamate/amalgamate.py
+1 −4 third_party/cpplint/README.rst
+14 −6 third_party/cpplint/cpplint.py
2 changes: 1 addition & 1 deletion external/toml-test
Loading

0 comments on commit bf13bbd

Please sign in to comment.