Skip to content

Commit

Permalink
Merge branch 'paths'
Browse files Browse the repository at this point in the history
  • Loading branch information
marzer committed Jul 31, 2022
2 parents cda9ca6 + 4047eb2 commit e2edd69
Show file tree
Hide file tree
Showing 71 changed files with 9,188 additions and 5,552 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- TOML_ABSTRACT_BASE
- TOML_CALLCONV
- TOML_CLOSED_ENUM
- TOML_CLOSED_FLAGS_ENUM
- TOML_EMPTY_BASES
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: ci

on:
push:
branches:
- master
branches-ignore:
- 'gh-pages'
paths:
- '**.h'
- '**.hpp'
Expand All @@ -13,8 +13,8 @@ on:
- '**/meson.build'
- '**/workflows/**.yaml'
pull_request:
branches:
- master
branches-ignore:
- 'gh-pages'
paths:
- '**.h'
- '**.hpp'
Expand Down
34 changes: 19 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,42 @@ template:
## Unreleased

#### Fixes:
- Fixed `[dotted.table]` source columns sometimes being off by one (#152) (@vaartis)
- fixed `[dotted.table]` source columns sometimes being off by one (#152) (@vaartis)

#### Additions:
- Added value type deduction to `emplace()` methods
- added value type deduction to `emplace()` methods
- added `toml::path` utility type (#153, #156) (@jonestristand)
- added config option `TOML_CALLCONV`
- added missing relational operators for `source_position`


#### Changes:
- Relaxed cvref requirements of `is_homogeneous()`, `emplace()`, `emplace_back()`, `emplace_hint()`
- relaxed cvref requirements of `is_homogeneous()`, `emplace()`, `emplace_back()`, `emplace_hint()`

<br><br>

## [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)
- 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` &amp; `TOML_EXPORTED_FREE_FUNCTION`
- 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))
- added `toml::array::for_each()`
- added `toml::table::for_each()`
- added config options `TOML_EXPORTED_CLASS`, `TOML_EXPORTED_MEMBER_FUNCTION`, `TOML_EXPORTED_STATIC_FUNCTION` &amp; `TOML_EXPORTED_FREE_FUNCTION`
- 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
- deprecated old `TOML_API` option in favour new `TOML_EXPORTED_X` options
(it will continue to work as it did before if none of the new function export options are defined)

#### Build system:
- Meson: Added `compile_library` option (@Tachi107)
- Meson: Added `ubsan_tests` and `ubsan_examples` options
- Meson: Use system dependencies where available when building tests (@Tachi107)
- meson: added `compile_library` option (@Tachi107)
- meson: added `ubsan_tests` and `ubsan_examples` options
- meson: use system dependencies where available when building tests (@Tachi107)


<br><br>
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ won't need to mess with these at all, but if you do, set them before including t
| Option | Type | Description | Default |
|-----------------------------------|:--------------:|----------------------------------------------------------------------------------------------------------|------------------------|
| `TOML_ASSERT(expr)` | function macro | Sets the assert function used by the library. | `assert()` |
| `TOML_CALLCONV` | define | Calling convention to apply to exported free/static functions. | undefined |
| `TOML_CONFIG_HEADER` | string literal | Includes the given header file before the rest of the library. | undefined |
| `TOML_ENABLE_FORMATTERS` | boolean | Enables the formatters. Set to `0` if you don't need them to improve compile times and binary size. | `1` |
| `TOML_ENABLE_PARSER` | boolean | Enables the parser. Set to `0` if you don't need it to improve compile times and binary size. | `1` |
Expand Down Expand Up @@ -257,6 +258,7 @@ UTF-8 decoding is performed using a state machine based on Bjoern Hoehrmann's '[
- **[@bjadamson](https://github.com/bjadamson)** - Reported some bugs and helped design a new feature
- **[@bobfang1992](https://github.com/bobfang1992)** - Reported a bug and created a [wrapper in python](https://github.com/bobfang1992/pytomlpp)
- **[@GiulioRomualdi](https://github.com/GiulioRomualdi)** - Added cmake+meson support
- **[@jonestristand](https://github.com/jonestristand)** - Designed and implemented the `toml::path`s feature
- **[@levicki](https://github.com/levicki)** - Helped design some new features
- **[@moorereason](https://github.com/moorereason)** - Reported a whole bunch of bugs
- **[@mosra](https://github.com/mosra)** - Created the awesome [m.css] used to generate the API docs
Expand Down
6 changes: 5 additions & 1 deletion include/toml++/impl/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,10 @@ TOML_NAMESPACE_START
return const_cast<array&>(*this).template get_as<ElemType>(index);
}

/// \cond
using node::operator[]; // inherit operator[toml::path]
/// \endcond

/// \brief Gets a reference to the element at a specific index.
TOML_NODISCARD
node& operator[](size_t index) noexcept
Expand Down Expand Up @@ -1628,7 +1632,7 @@ TOML_NAMESPACE_START

TOML_NODISCARD
TOML_EXPORTED_STATIC_FUNCTION
static bool equal(const array&, const array&) noexcept;
static bool TOML_CALLCONV equal(const array&, const array&) noexcept;

template <typename T>
TOML_NODISCARD
Expand Down
2 changes: 1 addition & 1 deletion include/toml++/impl/array.inl
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ TOML_NAMESPACE_START
}

TOML_EXTERNAL_LINKAGE
bool array::equal(const array& lhs, const array& rhs) noexcept
bool TOML_CALLCONV array::equal(const array& lhs, const array& rhs) noexcept
{
if (&lhs == &rhs)
return true;
Expand Down
23 changes: 19 additions & 4 deletions include/toml++/impl/at_path.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@

#include "forward_declarations.h"

/// \cond
TOML_IMPL_NAMESPACE_START
{
template <typename T>
using parse_path_callback = bool(TOML_CALLCONV*)(void*, T);

TOML_NODISCARD
bool TOML_CALLCONV parse_path(std::string_view,
void*,
parse_path_callback<std::string_view>,
parse_path_callback<size_t>);
}
TOML_IMPL_NAMESPACE_END;
/// \endcond

TOML_NAMESPACE_START
{
/// \brief Returns a view of the node matching a fully-qualified "TOML path".
Expand Down Expand Up @@ -48,14 +63,14 @@ TOML_NAMESPACE_START
/// \param path The "TOML path" to traverse.
TOML_NODISCARD
TOML_EXPORTED_FREE_FUNCTION
node_view<node> at_path(node & root, std::string_view path) noexcept;
node_view<node> TOML_CALLCONV at_path(node & root, std::string_view path) noexcept;

/// \brief Returns a const view of the node matching a fully-qualified "TOML path".
///
/// \see #toml::at_path(node&, std::string_view)
TOML_NODISCARD
TOML_EXPORTED_FREE_FUNCTION
node_view<const node> at_path(const node& root, std::string_view path) noexcept;
node_view<const node> TOML_CALLCONV at_path(const node& root, std::string_view path) noexcept;

#if TOML_ENABLE_WINDOWS_COMPAT

Expand All @@ -66,7 +81,7 @@ TOML_NAMESPACE_START
/// \see #toml::at_path(node&, std::string_view)
TOML_NODISCARD
TOML_EXPORTED_FREE_FUNCTION
node_view<node> at_path(node & root, std::wstring_view path);
node_view<node> TOML_CALLCONV at_path(node & root, std::wstring_view path);

/// \brief Returns a const view of the node matching a fully-qualified "TOML path".
///
Expand All @@ -75,7 +90,7 @@ TOML_NAMESPACE_START
/// \see #toml::at_path(node&, std::string_view)
TOML_NODISCARD
TOML_EXPORTED_FREE_FUNCTION
node_view<const node> at_path(const node& root, std::wstring_view path);
node_view<const node> TOML_CALLCONV at_path(const node& root, std::wstring_view path);

#endif
}
Expand Down
Loading

0 comments on commit e2edd69

Please sign in to comment.