Skip to content

Commit 8e669aa

Browse files
committed
release v3.0.1
1 parent 71b57a3 commit 8e669aa

File tree

15 files changed

+83
-37
lines changed

15 files changed

+83
-37
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ template:
1414
-->
1515

1616

17-
## Unreleased
17+
## [v3.0.1](https://github.com/marzer/tomlplusplus/releases/tag/v3.0.1) - 2022-01-13
18+
19+
This is a single-bugfix release to fix an ODR issue for people using header-only mode in multiple
20+
translation units. If you aren't seeing linker errors because of `toml::array::insert_at()`,
21+
this release holds nothing of value over v3.0.0.
1822

1923
#### Fixes:
2024
- fixed erroneous use of `TOML_API` causing ODR issue (#136) (@Azarael)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14)
22

33
project(
44
tomlplusplus
5-
VERSION 3.0.0
5+
VERSION 3.0.1
66
DESCRIPTION "Header-only TOML config file parser and serializer for C++17"
77
HOMEPAGE_URL "https://marzer.github.io/tomlplusplus/"
88
LANGUAGES CXX

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ You'll find some more code examples in the `examples` directory, and plenty more
9999
2. `#include <toml++/toml.h>`
100100
101101
### Conan
102-
Add `tomlplusplus/3.0.0` to your conanfile.
102+
Add `tomlplusplus/3.0.1` to your conanfile.
103103
104104
### DDS
105105
Add `tomlpp` to your `package.json5`, e.g.:
106106
```
107107
depends: [
108-
'tomlpp^3.0.0',
108+
'tomlpp^3.0.1',
109109
]
110110
```
111111
> ℹ&#xFE0F; _[What is DDS?](https://dds.pizza/)_
@@ -121,7 +121,7 @@ include(FetchContent)
121121
FetchContent_Declare(
122122
tomlplusplus
123123
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
124-
GIT_TAG v3.0.0
124+
GIT_TAG v3.0.1
125125
)
126126
FetchContent_MakeAvailable(tomlplusplus)
127127
```

docs/pages/main_page.dox

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,15 +457,15 @@
457457

458458

459459
\subsection mainpage-adding-lib-conan Conan
460-
Add `tomlplusplus/3.0.0` to your conanfile.
460+
Add `tomlplusplus/3.0.1` to your conanfile.
461461

462462

463463

464464
\subsection mainpage-adding-lib-dds DDS
465465
Add `tomlpp` to your `package.json5`, e.g.:
466466
\bash
467467
depends: [
468-
'tomlpp^3.0.0',
468+
'tomlpp^3.0.1',
469469
]
470470
\ebash
471471

@@ -497,7 +497,7 @@
497497
FetchContent_Declare(
498498
tomlplusplus
499499
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
500-
GIT_TAG v3.0.0
500+
GIT_TAG v3.0.1
501501
)
502502
FetchContent_MakeAvailable(tomlplusplus)
503503
\endcode

include/toml++/impl/at_path.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ TOML_NAMESPACE_START
1111
/// \brief Returns a view of the node matching a fully-qualified "TOML path".
1212
///
1313
/// \detail \cpp
14-
/// auto config = R"(
14+
/// auto config = toml::parse(R"(
1515
///
1616
/// [foo]
1717
/// bar = [ 0, 1, 2, [ 3 ], { kek = 4 } ]
1818
///
19-
/// )"_toml;
19+
/// )"sv);
2020
///
2121
/// std::cout << toml::at_path(config, "foo.bar[2]") << "\n";
2222
/// std::cout << toml::at_path(config, "foo.bar[3][0]") << "\n";

include/toml++/impl/key.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ TOML_NAMESPACE_START
3535
source_region source_;
3636

3737
public:
38-
/// A const iterator for iterating over the characters in the key.
39-
using const_iterator = const char*;
40-
41-
/// A const iterator for iterating over the characters in the key.
42-
using iterator = const_iterator;
43-
4438
/// \brief Default constructor.
4539
TOML_NODISCARD_CTOR
4640
key() noexcept = default;
@@ -296,6 +290,12 @@ TOML_NAMESPACE_START
296290
/// \name Iterators
297291
/// @{
298292

293+
/// A const iterator for iterating over the characters in the key.
294+
using const_iterator = const char*;
295+
296+
/// A const iterator for iterating over the characters in the key.
297+
using iterator = const_iterator;
298+
299299
/// \brief Returns an iterator to the first character in the key's backing string.
300300
TOML_PURE_INLINE_GETTER
301301
const_iterator begin() const noexcept

include/toml++/impl/node.h

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -962,14 +962,48 @@ TOML_NAMESPACE_START
962962

963963
/// \brief Returns a view of the subnode matching a fully-qualified "TOML path".
964964
///
965-
/// \see #toml::at_path(node&, std::string_view)
965+
/// \detail \cpp
966+
/// auto config = toml::parse(R"(
967+
///
968+
/// [foo]
969+
/// bar = [ 0, 1, 2, [ 3 ], { kek = 4 } ]
970+
///
971+
/// )"sv);
972+
///
973+
/// std::cout << config.at_path("foo.bar[2]") << "\n";
974+
/// std::cout << config.at_path("foo.bar[3][0]") << "\n";
975+
/// std::cout << config.at_path("foo.bar[4].kek") << "\n";
976+
/// \ecpp
977+
///
978+
/// \out
979+
/// 2
980+
/// 3
981+
/// 4
982+
/// \eout
983+
///
984+
///
985+
/// \note Keys in paths are interpreted literally, so whitespace (or lack thereof) matters:
986+
/// \cpp
987+
/// config.at_path( "foo.bar") // same as node_view{ config }["foo"]["bar"]
988+
/// config.at_path( "foo. bar") // same as node_view{ config }["foo"][" bar"]
989+
/// config.at_path( "foo..bar") // same as node_view{ config }["foo"][""]["bar"]
990+
/// config.at_path( ".foo.bar") // same as node_view{ config }[""]["foo"]["bar"]
991+
/// \ecpp
992+
/// <br>
993+
/// Additionally, TOML allows '.' (period) characters to appear in keys if they are quoted strings.
994+
/// This function makes no allowance for this, instead treating all period characters as sub-table delimiters.
995+
/// If you have periods in your table keys, first consider:
996+
/// 1. Not doing that
997+
/// 2. Using node_view::operator[] instead.
998+
///
999+
/// \param path The "TOML path" to traverse.
9661000
TOML_NODISCARD
9671001
TOML_API
9681002
node_view<node> at_path(std::string_view path) noexcept;
9691003

9701004
/// \brief Returns a const view of the subnode matching a fully-qualified "TOML path".
9711005
///
972-
/// \see #toml::at_path(node&, std::string_view)
1006+
/// \see #at_path(std::string_view)
9731007
TOML_NODISCARD
9741008
TOML_API
9751009
node_view<const node> at_path(std::string_view path) const noexcept;
@@ -980,7 +1014,7 @@ TOML_NAMESPACE_START
9801014
///
9811015
/// \availability This overload is only available when #TOML_ENABLE_WINDOWS_COMPAT is enabled.
9821016
///
983-
/// \see #toml::at_path(node&, std::string_view)
1017+
/// \see #at_path(std::string_view)
9841018
TOML_NODISCARD
9851019
TOML_API
9861020
node_view<node> at_path(std::wstring_view path);
@@ -989,7 +1023,7 @@ TOML_NAMESPACE_START
9891023
///
9901024
/// \availability This overload is only available when #TOML_ENABLE_WINDOWS_COMPAT is enabled.
9911025
///
992-
/// \see #toml::at_path(node&, std::string_view)
1026+
/// \see #at_path(std::string_view)
9931027
TOML_NODISCARD
9941028
TOML_API
9951029
node_view<const node> at_path(std::wstring_view path) const;

include/toml++/impl/node_view.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ TOML_NAMESPACE_START
708708

709709
/// \brief Returns a view of the subnode matching a fully-qualified "TOML path".
710710
///
711-
/// \see #toml::at_path(node&, std::string_view)
711+
/// \see #toml::node::at_path(std::string_view)
712712
TOML_NODISCARD
713713
node_view at_path(std::string_view path) const noexcept
714714
{
@@ -737,7 +737,7 @@ TOML_NAMESPACE_START
737737
///
738738
/// \availability This overload is only available when #TOML_ENABLE_WINDOWS_COMPAT is enabled.
739739
///
740-
/// \see #toml::at_path(node&, std::string_view)
740+
/// \see #toml::node::at_path(std::string_view)
741741
TOML_NODISCARD
742742
node_view at_path(std::wstring_view path) const
743743
{

include/toml++/impl/parse_result.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ TOML_NAMESPACE_START
358358

359359
/// \brief Returns a view of the subnode matching a fully-qualified "TOML path".
360360
///
361-
/// \see #toml::at_path(node&, std::string_view)
361+
/// \see #toml::node::at_path(std::string_view)
362362
TOML_NODISCARD
363363
node_view<node> at_path(std::string_view path) noexcept
364364
{
@@ -367,7 +367,7 @@ TOML_NAMESPACE_START
367367

368368
/// \brief Returns a const view of the subnode matching a fully-qualified "TOML path".
369369
///
370-
/// \see #toml::at_path(node&, std::string_view)
370+
/// \see #toml::node::at_path(std::string_view)
371371
TOML_NODISCARD
372372
node_view<const node> at_path(std::string_view path) const noexcept
373373
{
@@ -412,7 +412,7 @@ TOML_NAMESPACE_START
412412
///
413413
/// \availability This overload is only available when #TOML_ENABLE_WINDOWS_COMPAT is enabled.
414414
///
415-
/// \see #toml::at_path(node&, std::string_view)
415+
/// \see #toml::node::at_path(std::string_view)
416416
TOML_NODISCARD
417417
node_view<node> at_path(std::wstring_view path) noexcept
418418
{
@@ -423,7 +423,7 @@ TOML_NAMESPACE_START
423423
///
424424
/// \availability This overload is only available when #TOML_ENABLE_WINDOWS_COMPAT is enabled.
425425
///
426-
/// \see #toml::at_path(node&, std::string_view)
426+
/// \see #toml::node::at_path(std::string_view)
427427
TOML_NODISCARD
428428
node_view<const node> at_path(std::wstring_view path) const noexcept
429429
{

include/toml++/impl/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#define TOML_LIB_MAJOR 3
88
#define TOML_LIB_MINOR 0
9-
#define TOML_LIB_PATCH 0
9+
#define TOML_LIB_PATCH 1
1010

1111
#define TOML_LANG_MAJOR 1
1212
#define TOML_LANG_MINOR 0

0 commit comments

Comments
 (0)