Skip to content

Commit

Permalink
release v3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
marzer committed Jan 13, 2022
1 parent 71b57a3 commit 8e669aa
Show file tree
Hide file tree
Showing 15 changed files with 83 additions and 37 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ template:
-->


## Unreleased
## [v3.0.1](https://github.com/marzer/tomlplusplus/releases/tag/v3.0.1) - 2022-01-13

This is a single-bugfix release to fix an ODR issue for people using header-only mode in multiple
translation units. If you aren't seeing linker errors because of `toml::array::insert_at()`,
this release holds nothing of value over v3.0.0.

#### Fixes:
- fixed erroneous use of `TOML_API` causing ODR issue (#136) (@Azarael)
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.0
VERSION 3.0.1
DESCRIPTION "Header-only TOML config file parser and serializer for C++17"
HOMEPAGE_URL "https://marzer.github.io/tomlplusplus/"
LANGUAGES CXX
Expand Down
6 changes: 3 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.0` to your conanfile.
Add `tomlplusplus/3.0.1` to your conanfile.
### DDS
Add `tomlpp` to your `package.json5`, e.g.:
```
depends: [
'tomlpp^3.0.0',
'tomlpp^3.0.1',
]
```
> ℹ&#xFE0F; _[What is DDS?](https://dds.pizza/)_
Expand All @@ -121,7 +121,7 @@ include(FetchContent)
FetchContent_Declare(
tomlplusplus
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
GIT_TAG v3.0.0
GIT_TAG v3.0.1
)
FetchContent_MakeAvailable(tomlplusplus)
```
Expand Down
6 changes: 3 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.0` to your conanfile.
Add `tomlplusplus/3.0.1` to your conanfile.



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

Expand Down Expand Up @@ -497,7 +497,7 @@
FetchContent_Declare(
tomlplusplus
GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
GIT_TAG v3.0.0
GIT_TAG v3.0.1
)
FetchContent_MakeAvailable(tomlplusplus)
\endcode
Expand Down
4 changes: 2 additions & 2 deletions include/toml++/impl/at_path.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ TOML_NAMESPACE_START
/// \brief Returns a view of the node matching a fully-qualified "TOML path".
///
/// \detail \cpp
/// auto config = R"(
/// auto config = toml::parse(R"(
///
/// [foo]
/// bar = [ 0, 1, 2, [ 3 ], { kek = 4 } ]
///
/// )"_toml;
/// )"sv);
///
/// std::cout << toml::at_path(config, "foo.bar[2]") << "\n";
/// std::cout << toml::at_path(config, "foo.bar[3][0]") << "\n";
Expand Down
12 changes: 6 additions & 6 deletions include/toml++/impl/key.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ TOML_NAMESPACE_START
source_region source_;

public:
/// A const iterator for iterating over the characters in the key.
using const_iterator = const char*;

/// A const iterator for iterating over the characters in the key.
using iterator = const_iterator;

/// \brief Default constructor.
TOML_NODISCARD_CTOR
key() noexcept = default;
Expand Down Expand Up @@ -296,6 +290,12 @@ TOML_NAMESPACE_START
/// \name Iterators
/// @{

/// A const iterator for iterating over the characters in the key.
using const_iterator = const char*;

/// A const iterator for iterating over the characters in the key.
using iterator = const_iterator;

/// \brief Returns an iterator to the first character in the key's backing string.
TOML_PURE_INLINE_GETTER
const_iterator begin() const noexcept
Expand Down
42 changes: 38 additions & 4 deletions include/toml++/impl/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -962,14 +962,48 @@ TOML_NAMESPACE_START

/// \brief Returns a view of the subnode matching a fully-qualified "TOML path".
///
/// \see #toml::at_path(node&, std::string_view)
/// \detail \cpp
/// auto config = toml::parse(R"(
///
/// [foo]
/// bar = [ 0, 1, 2, [ 3 ], { kek = 4 } ]
///
/// )"sv);
///
/// std::cout << config.at_path("foo.bar[2]") << "\n";
/// std::cout << config.at_path("foo.bar[3][0]") << "\n";
/// std::cout << config.at_path("foo.bar[4].kek") << "\n";
/// \ecpp
///
/// \out
/// 2
/// 3
/// 4
/// \eout
///
///
/// \note Keys in paths are interpreted literally, so whitespace (or lack thereof) matters:
/// \cpp
/// config.at_path( "foo.bar") // same as node_view{ config }["foo"]["bar"]
/// config.at_path( "foo. bar") // same as node_view{ config }["foo"][" bar"]
/// config.at_path( "foo..bar") // same as node_view{ config }["foo"][""]["bar"]
/// config.at_path( ".foo.bar") // same as node_view{ config }[""]["foo"]["bar"]
/// \ecpp
/// <br>
/// Additionally, TOML allows '.' (period) characters to appear in keys if they are quoted strings.
/// This function makes no allowance for this, instead treating all period characters as sub-table delimiters.
/// If you have periods in your table keys, first consider:
/// 1. Not doing that
/// 2. Using node_view::operator[] instead.
///
/// \param path The "TOML path" to traverse.
TOML_NODISCARD
TOML_API
node_view<node> at_path(std::string_view path) noexcept;

/// \brief Returns a const view of the subnode matching a fully-qualified "TOML path".
///
/// \see #toml::at_path(node&, std::string_view)
/// \see #at_path(std::string_view)
TOML_NODISCARD
TOML_API
node_view<const node> at_path(std::string_view path) const noexcept;
Expand All @@ -980,7 +1014,7 @@ TOML_NAMESPACE_START
///
/// \availability This overload is only available when #TOML_ENABLE_WINDOWS_COMPAT is enabled.
///
/// \see #toml::at_path(node&, std::string_view)
/// \see #at_path(std::string_view)
TOML_NODISCARD
TOML_API
node_view<node> at_path(std::wstring_view path);
Expand All @@ -989,7 +1023,7 @@ TOML_NAMESPACE_START
///
/// \availability This overload is only available when #TOML_ENABLE_WINDOWS_COMPAT is enabled.
///
/// \see #toml::at_path(node&, std::string_view)
/// \see #at_path(std::string_view)
TOML_NODISCARD
TOML_API
node_view<const node> at_path(std::wstring_view path) const;
Expand Down
4 changes: 2 additions & 2 deletions include/toml++/impl/node_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ TOML_NAMESPACE_START

/// \brief Returns a view of the subnode matching a fully-qualified "TOML path".
///
/// \see #toml::at_path(node&, std::string_view)
/// \see #toml::node::at_path(std::string_view)
TOML_NODISCARD
node_view at_path(std::string_view path) const noexcept
{
Expand Down Expand Up @@ -737,7 +737,7 @@ TOML_NAMESPACE_START
///
/// \availability This overload is only available when #TOML_ENABLE_WINDOWS_COMPAT is enabled.
///
/// \see #toml::at_path(node&, std::string_view)
/// \see #toml::node::at_path(std::string_view)
TOML_NODISCARD
node_view at_path(std::wstring_view path) const
{
Expand Down
8 changes: 4 additions & 4 deletions include/toml++/impl/parse_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ TOML_NAMESPACE_START

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

/// \brief Returns a const view of the subnode matching a fully-qualified "TOML path".
///
/// \see #toml::at_path(node&, std::string_view)
/// \see #toml::node::at_path(std::string_view)
TOML_NODISCARD
node_view<const node> at_path(std::string_view path) const noexcept
{
Expand Down Expand Up @@ -412,7 +412,7 @@ TOML_NAMESPACE_START
///
/// \availability This overload is only available when #TOML_ENABLE_WINDOWS_COMPAT is enabled.
///
/// \see #toml::at_path(node&, std::string_view)
/// \see #toml::node::at_path(std::string_view)
TOML_NODISCARD
node_view<node> at_path(std::wstring_view path) noexcept
{
Expand All @@ -423,7 +423,7 @@ TOML_NAMESPACE_START
///
/// \availability This overload is only available when #TOML_ENABLE_WINDOWS_COMPAT is enabled.
///
/// \see #toml::at_path(node&, std::string_view)
/// \see #toml::node::at_path(std::string_view)
TOML_NODISCARD
node_view<const node> at_path(std::wstring_view path) const noexcept
{
Expand Down
2 changes: 1 addition & 1 deletion include/toml++/impl/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#define TOML_LIB_MAJOR 3
#define TOML_LIB_MINOR 0
#define TOML_LIB_PATCH 0
#define TOML_LIB_PATCH 1

#define TOML_LANG_MAJOR 1
#define TOML_LANG_MINOR 0
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(
'tomlplusplus',
'cpp',
version: '3.0.0',
version: '3.0.1',
meson_version: '>=0.54.0',
license: 'MIT',
default_options: [ # https://mesonbuild.com/Builtin-options.html
Expand Down
8 changes: 5 additions & 3 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ foreach cpp20 : cpp20_modes
endforeach # strict
endforeach # cpp20

locales = [
test_locales = [
'C',
'en_US.utf8',
'ja_JP.utf8',
Expand All @@ -179,7 +179,7 @@ locales = [
]

foreach executable : test_executables
foreach locale : locales
foreach locale : test_locales
test(
executable[0] + ' (' + locale + ')', # name
executable[1], # executable object
Expand All @@ -194,5 +194,7 @@ endforeach
executable(
'odr_test',
[ 'odr_test_1.cpp', 'odr_test_2.cpp' ],
include_directories: include_dirs
include_directories: include_dirs,
cpp_args: additional_arguments,
override_options: overrides
)
3 changes: 3 additions & 0 deletions tests/odr_test_1.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#define TOML_ENABLE_UNRELEASED_FEATURES 1
#define TOML_HEADER_ONLY 1
#define TOML_UNDEF_MACROS 0
#include "../toml.hpp"

TOML_DISABLE_WARNINGS;

int main()
{
return 0;
Expand Down
3 changes: 3 additions & 0 deletions tests/tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
#if !(TOML_HEADER_ONLY ^ TOML_EXTERN_TEMPLATES) && !TOML_INTELLISENSE
#error TOML_EXTERN_TEMPLATES should hold the opposite value to TOML_HEADER_ONLY by default
#endif
#if TOML_LIB_SINGLE_HEADER ^ USE_SINGLE_HEADER
#error TOML_LIB_SINGLE_HEADER was not set correctly
#endif

#if TOML_ICC
#define UNICODE_LITERALS_OK 0
Expand Down
12 changes: 6 additions & 6 deletions toml.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//----------------------------------------------------------------------------------------------------------------------
//
// toml++ v3.0.0
// toml++ v3.0.1
// https://github.com/marzer/tomlplusplus
// SPDX-License-Identifier: MIT
//
Expand Down Expand Up @@ -810,7 +810,7 @@

#define TOML_LIB_MAJOR 3
#define TOML_LIB_MINOR 0
#define TOML_LIB_PATCH 0
#define TOML_LIB_PATCH 1

#define TOML_LANG_MAJOR 1
#define TOML_LANG_MINOR 0
Expand Down Expand Up @@ -5981,10 +5981,6 @@ TOML_NAMESPACE_START

public:

using const_iterator = const char*;

using iterator = const_iterator;

TOML_NODISCARD_CTOR
key() noexcept = default;

Expand Down Expand Up @@ -6184,6 +6180,10 @@ TOML_NAMESPACE_START
return lhs >= rhs.key_;
}

using const_iterator = const char*;

using iterator = const_iterator;

TOML_PURE_INLINE_GETTER
const_iterator begin() const noexcept
{
Expand Down

0 comments on commit 8e669aa

Please sign in to comment.