fixed narrowing conversion warnings when constructing int values from unsigned

also:
- added ability to construct values from wide strings and u8 strings
- added non-template version of array::is_homogeneous()
- added explicit instantiations for more template types when `!TOML_ALL_INLINE`
- cleaned up abi namespaces
- simplified build and test machinery on windows
- removed TOML_CHAR_8_STRINGS since it no longer makes sense
This commit is contained in:
Mark Gillard 2020-07-18 15:10:19 +03:00
parent cb791fe0ef
commit ca6f639fb9
99 changed files with 5985 additions and 5163 deletions

View File

@ -2,40 +2,6 @@ version: 2
jobs: jobs:
debug_clang9_dox:
docker:
- image: marzer/misc_cpp17_dev:latest
steps:
- checkout
- run:
name: Initializing locales
command: |
sudo apt-get update && sudo apt-get install -y locales
sudo locale-gen 'en_US.utf8' 'ja_JP.utf8' 'de_DE.utf8' 'it_IT.utf8' 'tr_TR.utf8' 'fi_FI.utf8' 'fr_FR.utf8' 'zh_CN.utf8'
- run:
name: Checking toml.hpp
command: |
cd python && python3 ci_single_header_check.py
- run:
name: Pulling submodules
command: |
git submodule update --init extern/Catch2
git submodule update --init extern/tloptional
- run:
name: Building and testing with clang 9
command: |
CXX=clang++-9 meson build --buildtype=debug -DGENERATE_CMAKE_CONFIG=disabled -DBUILD_EXAMPLES=disabled
cd build && ninja -v -j 4 && ninja test
- run:
name: Generating documentation
command: |
git submodule update --init extern/mcss
cd python && python3 generate_documentation.py
- persist_to_workspace:
root: docs
paths: html
debug_clang9: debug_clang9:
docker: docker:
- image: marzer/misc_cpp17_dev:latest - image: marzer/misc_cpp17_dev:latest
@ -61,7 +27,6 @@ jobs:
CXX=clang++-9 meson build --buildtype=debug -DGENERATE_CMAKE_CONFIG=disabled -DBUILD_EXAMPLES=disabled CXX=clang++-9 meson build --buildtype=debug -DGENERATE_CMAKE_CONFIG=disabled -DBUILD_EXAMPLES=disabled
cd build && ninja -v -j 4 && ninja test cd build && ninja -v -j 4 && ninja test
release_clang9: release_clang9:
docker: docker:
- image: marzer/misc_cpp17_dev:latest - image: marzer/misc_cpp17_dev:latest
@ -87,7 +52,6 @@ jobs:
CXX=clang++-9 meson build --buildtype=release -DGENERATE_CMAKE_CONFIG=disabled -DBUILD_EXAMPLES=disabled CXX=clang++-9 meson build --buildtype=release -DGENERATE_CMAKE_CONFIG=disabled -DBUILD_EXAMPLES=disabled
cd build && ninja -v -j 4 && ninja test cd build && ninja -v -j 4 && ninja test
debug_gcc9: debug_gcc9:
docker: docker:
- image: marzer/misc_cpp17_dev:latest - image: marzer/misc_cpp17_dev:latest
@ -109,7 +73,6 @@ jobs:
CXX=g++-9 meson build --buildtype=debug -DGENERATE_CMAKE_CONFIG=disabled -DBUILD_EXAMPLES=disabled CXX=g++-9 meson build --buildtype=debug -DGENERATE_CMAKE_CONFIG=disabled -DBUILD_EXAMPLES=disabled
cd build && ninja -v -j 4 && ninja test cd build && ninja -v -j 4 && ninja test
release_gcc9: release_gcc9:
docker: docker:
- image: marzer/misc_cpp17_dev:latest - image: marzer/misc_cpp17_dev:latest
@ -131,6 +94,22 @@ jobs:
CXX=g++-9 meson build --buildtype=release -DGENERATE_CMAKE_CONFIG=disabled -DBUILD_EXAMPLES=disabled CXX=g++-9 meson build --buildtype=release -DGENERATE_CMAKE_CONFIG=disabled -DBUILD_EXAMPLES=disabled
cd build && ninja -v -j 4 && ninja test cd build && ninja -v -j 4 && ninja test
generate_dox:
docker:
- image: marzer/misc_cpp17_dev:latest
steps:
- checkout
- run:
name: Pulling submodules
command: |
git submodule update --init extern/mcss
- run:
name: Generating documentation
command: |
cd python && python3 generate_documentation.py
- persist_to_workspace:
root: docs
paths: html
deploy_dox: deploy_dox:
docker: docker:
@ -156,25 +135,23 @@ jobs:
name: Deploy docs to gh-pages branch name: Deploy docs to gh-pages branch
command: gh-pages --dotfiles --message "[skip ci] Updates" --dist docs/html command: gh-pages --dotfiles --message "[skip ci] Updates" --dist docs/html
workflows: workflows:
version: 2 version: 2
build: build:
jobs: jobs:
- debug_clang9_dox: - debug_clang9
filters:
branches:
only: master
- debug_clang9:
filters:
branches:
ignore: master
- release_clang9 - release_clang9
- debug_gcc9 - debug_gcc9
- release_gcc9 - release_gcc9
- deploy_dox: - generate_dox:
requires: requires:
- debug_clang9_dox - debug_clang9
- release_clang9 - release_clang9
- debug_gcc9 - debug_gcc9
- release_gcc9 - release_gcc9
filters:
branches:
only: master
- deploy_dox:
requires:
- generate_dox

View File

@ -118,7 +118,6 @@ won't need to mess with these at all, but if you do, set them before including t
| `TOML_ALL_INLINE` | boolean | `1` | Disable this to explicitly control where toml++'s implementation is compiled (e.g. as part of a library). | | `TOML_ALL_INLINE` | boolean | `1` | Disable this to explicitly control where toml++'s implementation is compiled (e.g. as part of a library). |
| `TOML_API` | define | undefined | API annotation to add to public symbols (e.g. `__declspec(dllexport)` on Windows). | | `TOML_API` | define | undefined | API annotation to add to public symbols (e.g. `__declspec(dllexport)` on Windows). |
| `TOML_ASSERT(expr)` | function macro | `assert(expr)`<br>(or undefined) | Sets the assert function used by the library. | | `TOML_ASSERT(expr)` | function macro | `assert(expr)`<br>(or undefined) | Sets the assert function used by the library. |
| `TOML_CHAR_8_STRINGS` | boolean | `0` | Uses C++20 [char8_t]-based strings as the toml string data type. **_Experimental!_** |
| `TOML_CONFIG_HEADER` | string literal | undefined | Includes the given header file before the rest of the library. | | `TOML_CONFIG_HEADER` | string literal | undefined | Includes the given header file before the rest of the library. |
| `TOML_EXCEPTIONS` | boolean | per your compiler's settings | Sets whether the library uses exceptions. | | `TOML_EXCEPTIONS` | boolean | per your compiler's settings | Sets whether the library uses exceptions. |
| `TOML_IMPLEMENTATION` | define | undefined | Define this to enable compilation of the library's implementation. Meaningless if `TOML_ALL_INLINE` is `1`. | | `TOML_IMPLEMENTATION` | define | undefined | Define this to enable compilation of the library's implementation. Meaningless if `TOML_ALL_INLINE` is `1`. |
@ -187,6 +186,7 @@ UTF-8 decoding is performed using a state machine based on Bjoern Hoehrmann's '[
- **[@okureta](https://github.com/okureta)** - Reported a bug - **[@okureta](https://github.com/okureta)** - Reported a bug
- **[@prince-chrismc](https://github.com/prince-chrismc)** - Added toml++ to ConanCenter, and fixed some typos - **[@prince-chrismc](https://github.com/prince-chrismc)** - Added toml++ to ConanCenter, and fixed some typos
- **[@rbrugo](https://github.com/rbrugo)** - Helped design a new feature - **[@rbrugo](https://github.com/rbrugo)** - Helped design a new feature
- **[@Reedbeta](https://github.com/Reedbeta)** - Added additional Visual Studio debugger native visualizers
- **[@shdnx](https://github.com/shdnx)** - Fixed a bug on GCC 8.2.0 and some meson config issues - **[@shdnx](https://github.com/shdnx)** - Fixed a bug on GCC 8.2.0 and some meson config issues
- **[@traversaro](https://github.com/traversaro)** - Added vcpkg support and reported a bunch of bugs - **[@traversaro](https://github.com/traversaro)** - Added vcpkg support and reported a bunch of bugs
- **[@ximion](https://github.com/ximion)** - Added support for installation with meson - **[@ximion](https://github.com/ximion)** - Added support for installation with meson

View File

@ -327,9 +327,9 @@ PREDEFINED = DOXYGEN=1 \
TOML_PUSH_WARNINGS= \ TOML_PUSH_WARNINGS= \
TOML_DISABLE_SWITCH_WARNINGS= \ TOML_DISABLE_SWITCH_WARNINGS= \
TOML_DISABLE_INIT_WARNINGS= \ TOML_DISABLE_INIT_WARNINGS= \
TOML_DISABLE_VTABLE_WARNINGS= \ TOML_DISABLE_MISC_WARNINGS= \
TOML_DISABLE_PADDING_WARNINGS= \ TOML_DISABLE_PADDING_WARNINGS= \
TOML_DISABLE_FLOAT_WARNINGS= \ TOML_DISABLE_ARITHMETIC_WARNINGS= \
TOML_DISABLE_SHADOW_WARNINGS= \ TOML_DISABLE_SHADOW_WARNINGS= \
TOML_DISABLE_SUGGEST_WARNINGS= \ TOML_DISABLE_SUGGEST_WARNINGS= \
TOML_DISABLE_ALL_WARNINGS= \ TOML_DISABLE_ALL_WARNINGS= \

View File

@ -3,20 +3,16 @@
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text. //# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include <iostream>
#ifdef _WIN32 #ifdef _WIN32
#include <Windows.h>
#include <Windows.h>
inline void init_utf8_console() noexcept
{
SetConsoleOutputCP(65001); //CP_UTF8
}
#else
inline void init_utf8_console() noexcept
{
// no-op
}
#endif #endif
inline void init_utf8_console() noexcept
{
#ifdef _WIN32
SetConsoleOutputCP(65001); //CP_UTF8
#endif
std::cout << std::boolalpha;
}

View File

@ -39,6 +39,7 @@
#include "toml_default_formatter.hpp" #include "toml_default_formatter.hpp"
#include "toml_json_formatter.hpp" #include "toml_json_formatter.hpp"
#if TOML_PARSER #if TOML_PARSER
#include "toml_utf8_streams.hpp"
#include "toml_parser.hpp" #include "toml_parser.hpp"
#endif // TOML_PARSER #endif // TOML_PARSER
@ -56,9 +57,9 @@
#undef TOML_PUSH_WARNINGS #undef TOML_PUSH_WARNINGS
#undef TOML_DISABLE_SWITCH_WARNINGS #undef TOML_DISABLE_SWITCH_WARNINGS
#undef TOML_DISABLE_INIT_WARNINGS #undef TOML_DISABLE_INIT_WARNINGS
#undef TOML_DISABLE_VTABLE_WARNINGS #undef TOML_DISABLE_MISC_WARNINGS
#undef TOML_DISABLE_PADDING_WARNINGS #undef TOML_DISABLE_PADDING_WARNINGS
#undef TOML_DISABLE_FLOAT_WARNINGS #undef TOML_DISABLE_ARITHMETIC_WARNINGS
#undef TOML_DISABLE_SHADOW_WARNINGS #undef TOML_DISABLE_SHADOW_WARNINGS
#undef TOML_DISABLE_SUGGEST_WARNINGS #undef TOML_DISABLE_SUGGEST_WARNINGS
#undef TOML_DISABLE_ALL_WARNINGS #undef TOML_DISABLE_ALL_WARNINGS
@ -81,7 +82,6 @@
#undef TOML_LANG_HIGHER_THAN #undef TOML_LANG_HIGHER_THAN
#undef TOML_LANG_AT_LEAST #undef TOML_LANG_AT_LEAST
#undef TOML_LANG_UNRELEASED #undef TOML_LANG_UNRELEASED
#undef TOML_STRING_PREFIX
#undef TOML_UNDEF_MACROS #undef TOML_UNDEF_MACROS
#undef TOML_RELOPS_REORDERING #undef TOML_RELOPS_REORDERING
#undef TOML_ASYMMETRICAL_EQUALITY_OPS #undef TOML_ASYMMETRICAL_EQUALITY_OPS
@ -89,11 +89,13 @@
#undef TOML_IMPLEMENTATION #undef TOML_IMPLEMENTATION
#undef TOML_EXTERNAL_LINKAGE #undef TOML_EXTERNAL_LINKAGE
#undef TOML_INTERNAL_LINKAGE #undef TOML_INTERNAL_LINKAGE
#undef TOML_INTERNAL_NAMESPACE #undef TOML_ANONYMOUS_NAMESPACE
#undef TOML_ANONYMOUS_NAMESPACE_END
#undef TOML_COMPILER_EXCEPTIONS #undef TOML_COMPILER_EXCEPTIONS
#undef TOML_TRIVIAL_ABI #undef TOML_TRIVIAL_ABI
#undef TOML_ABI_NAMESPACES #undef TOML_ABI_NAMESPACES
#undef TOML_ABI_NAMESPACE_START #undef TOML_ABI_NAMESPACE_START
#undef TOML_ABI_NAMESPACE_VERSION
#undef TOML_ABI_NAMESPACE_BOOL #undef TOML_ABI_NAMESPACE_BOOL
#undef TOML_ABI_NAMESPACE_END #undef TOML_ABI_NAMESPACE_END
#undef TOML_PARSER_TYPENAME #undef TOML_PARSER_TYPENAME
@ -105,8 +107,9 @@
#undef TOML_HAS_CUSTOM_OPTIONAL_TYPE #undef TOML_HAS_CUSTOM_OPTIONAL_TYPE
#undef TOML_UNWRAPPED_NODE_TYPE_LIST #undef TOML_UNWRAPPED_NODE_TYPE_LIST
#undef TOML_NATIVE_VALUE_TYPE_LIST #undef TOML_NATIVE_VALUE_TYPE_LIST
#undef TOML_NATIVE_STRING_TYPE_NAME
#undef TOML_NODE_TYPE_LIST #undef TOML_NODE_TYPE_LIST
#undef TOML_IMPL_NAMESPACE_START
#undef TOML_IMPL_NAMESPACE_END
#endif #endif
//# {{ //# {{

View File

@ -7,10 +7,12 @@
#include "toml_value.h" #include "toml_value.h"
TOML_PUSH_WARNINGS TOML_PUSH_WARNINGS
TOML_DISABLE_VTABLE_WARNINGS TOML_DISABLE_MISC_WARNINGS
namespace toml::impl namespace toml
{ {
TOML_IMPL_NAMESPACE_START
template <bool IsConst> template <bool IsConst>
class TOML_TRIVIAL_ABI array_iterator final class TOML_TRIVIAL_ABI array_iterator final
{ {
@ -20,7 +22,7 @@ namespace toml::impl
using raw_mutable_iterator = std::vector<std::unique_ptr<node>>::iterator; using raw_mutable_iterator = std::vector<std::unique_ptr<node>>::iterator;
using raw_const_iterator = std::vector<std::unique_ptr<node>>::const_iterator; using raw_const_iterator = std::vector<std::unique_ptr<node>>::const_iterator;
using raw_iterator = std::conditional_t<IsConst, raw_const_iterator, raw_mutable_iterator>; using raw_iterator = std::conditional_t<IsConst, raw_const_iterator, raw_mutable_iterator>;
mutable raw_iterator raw_; mutable raw_iterator raw_;
array_iterator(raw_mutable_iterator raw) noexcept array_iterator(raw_mutable_iterator raw) noexcept
@ -160,12 +162,17 @@ namespace toml::impl
return *(raw_ + idx)->get(); return *(raw_ + idx)->get();
} }
TOML_PUSH_WARNINGS
TOML_DISABLE_ALL_WARNINGS
template <bool C = IsConst, typename = std::enable_if_t<!C>> template <bool C = IsConst, typename = std::enable_if_t<!C>>
[[nodiscard]] [[nodiscard]]
operator array_iterator<true>() const noexcept operator array_iterator<true>() const noexcept
{ {
return array_iterator<true>{ raw_ }; return array_iterator<true>{ raw_ };
} }
TOML_POP_WARNINGS
}; };
template <typename T> template <typename T>
@ -187,7 +194,8 @@ namespace toml::impl
{ {
static_assert( static_assert(
!is_wide_string<T> || TOML_WINDOWS_COMPAT, !is_wide_string<T> || TOML_WINDOWS_COMPAT,
"Instantiating values from wide-character strings is only supported on Windows with TOML_WINDOWS_COMPAT enabled." "Instantiating values from wide-character strings is only "
"supported on Windows with TOML_WINDOWS_COMPAT enabled."
); );
static_assert( static_assert(
is_native<type> || is_losslessly_convertible_to_native<type>, is_native<type> || is_losslessly_convertible_to_native<type>,
@ -214,10 +222,14 @@ namespace toml::impl
{ {
return make_node(std::move(val.value)); return make_node(std::move(val.value));
} }
TOML_IMPL_NAMESPACE_END
} }
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
[[nodiscard]] TOML_API bool operator == (const array& lhs, const array& rhs) noexcept; [[nodiscard]] TOML_API bool operator == (const array& lhs, const array& rhs) noexcept;
[[nodiscard]] TOML_API bool operator != (const array& lhs, const array& rhs) noexcept; [[nodiscard]] TOML_API bool operator != (const array& lhs, const array& rhs) noexcept;
template <typename Char> template <typename Char>
@ -363,6 +375,33 @@ namespace toml
[[nodiscard]] array* as_array() noexcept override; [[nodiscard]] array* as_array() noexcept override;
[[nodiscard]] const array* as_array() const noexcept override; [[nodiscard]] const array* as_array() const noexcept override;
/// \brief Checks if the array contains nodes of only one type.
///
/// \detail \cpp
/// auto arr = toml::array{ 1, 2, 3 };
/// std::cout << "homogenous: "sv << arr.is_homogeneous(toml::node_type::none) << std::endl;
/// std::cout << "all floats: "sv << arr.is_homogeneous(toml::node_type::floating_point) << std::endl;
/// std::cout << "all arrays: "sv << arr.is_homogeneous(toml::node_type::array) << std::endl;
/// std::cout << "all integers: "sv << arr.is_homogeneous(toml::node_type::integer) << std::endl;
///
/// \ecpp
///
/// \out
/// homogeneous: true
/// all doubles: false
/// all arrays: false
/// all integers: true
/// \eout
///
/// \param type A TOML node type. <br>
/// <strong><em>`toml::node_type::none`: </em></strong> "is every node the same type?"
/// <strong><em>Anything else:</em></strong> "is every node one of these?" <br>
///
/// \returns True if the array was homogeneous.
///
/// \remarks Always returns `false` for empty arrays.
[[nodiscard]] bool is_homogeneous(node_type type) const noexcept;
/// \brief Checks if the array contains nodes of only one type. /// \brief Checks if the array contains nodes of only one type.
/// ///
/// \detail \cpp /// \detail \cpp
@ -382,40 +421,32 @@ namespace toml
/// \eout /// \eout
/// ///
/// \tparam T A TOML node type. <br> /// \tparam T A TOML node type. <br>
/// <strong><em>Explicitly specified:</em></strong> "is every node a T?" <br>
/// <strong><em>Left as `void`:</em></strong> "is every node the same type?" /// <strong><em>Left as `void`:</em></strong> "is every node the same type?"
/// <strong><em>Explicitly specified:</em></strong> "is every node a T?" <br>
/// ///
/// \returns True if the array was homogeneous. /// \returns True if the array was homogeneous.
/// ///
/// \remarks Always returns `false` for empty arrays. /// \remarks Always returns `false` for empty arrays.
template <typename T = void> template <typename T = void>
[[nodiscard]] bool is_homogeneous() const noexcept [[nodiscard]]
bool is_homogeneous() const noexcept
{ {
if (values.empty()) using type = impl::unwrap_node<T>;
return false; static_assert(
std::is_void_v<type>
if constexpr (std::is_same_v<T, void>) || ((impl::is_native<type> || impl::is_one_of<type, table, array>) && !impl::is_cvref<type>),
{ "The template type argument of array::is_homogeneous() must be void or one of the following:"
const auto type = values[0]->type(); TOML_UNWRAPPED_NODE_TYPE_LIST
for (size_t i = 1; i < values.size(); i++) );
if (values[i]->type() != type)
return false; if constexpr (std::is_void_v<type>)
} return is_homogeneous(node_type::none);
else else
{ return is_homogeneous(impl::node_type_of<type>);
for (auto& v : values)
if (!v->is<T>())
return false;
}
return true;
} }
/// \brief Returns true if this array contains only tables. /// \brief Returns true if this array contains only tables.
[[nodiscard]] TOML_ALWAYS_INLINE [[nodiscard]] bool is_array_of_tables() const noexcept override;
bool is_array_of_tables() const noexcept override
{
return is_homogeneous<toml::table>();
}
/// \brief Gets a reference to the node at a specific index. /// \brief Gets a reference to the node at a specific index.
[[nodiscard]] node& operator[] (size_t index) noexcept; [[nodiscard]] node& operator[] (size_t index) noexcept;
@ -619,7 +650,7 @@ namespace toml
{ {
using type = impl::unwrap_node<U>; using type = impl::unwrap_node<U>;
static_assert( static_assert(
impl::is_native<type> || impl::is_one_of<type, table, array>, (impl::is_native<type> || impl::is_one_of<type, table, array>) && !impl::is_cvref<type>,
"Emplacement type parameter must be one of the following:" "Emplacement type parameter must be one of the following:"
TOML_UNWRAPPED_NODE_TYPE_LIST TOML_UNWRAPPED_NODE_TYPE_LIST
); );
@ -781,7 +812,7 @@ namespace toml
{ {
using type = impl::unwrap_node<U>; using type = impl::unwrap_node<U>;
static_assert( static_assert(
impl::is_native<type> || impl::is_one_of<type, table, array>, (impl::is_native<type> || impl::is_one_of<type, table, array>) && !impl::is_cvref<type>,
"Emplacement type parameter must be one of the following:" "Emplacement type parameter must be one of the following:"
TOML_UNWRAPPED_NODE_TYPE_LIST TOML_UNWRAPPED_NODE_TYPE_LIST
); );
@ -843,7 +874,8 @@ namespace toml
/// ///
/// \returns A pointer to the selected node if it existed and was of the specified type, or nullptr. /// \returns A pointer to the selected node if it existed and was of the specified type, or nullptr.
template <typename T> template <typename T>
[[nodiscard]] impl::wrap_node<T>* get_as(size_t index) noexcept [[nodiscard]]
impl::wrap_node<T>* get_as(size_t index) noexcept
{ {
if (auto val = get(index)) if (auto val = get(index))
return val->as<T>(); return val->as<T>();
@ -857,7 +889,8 @@ namespace toml
/// ///
/// \returns A pointer to the selected node if it existed and was of the specified type, or nullptr. /// \returns A pointer to the selected node if it existed and was of the specified type, or nullptr.
template <typename T> template <typename T>
[[nodiscard]] const impl::wrap_node<T>* get_as(size_t index) const noexcept [[nodiscard]]
const impl::wrap_node<T>* get_as(size_t index) const noexcept
{ {
if (auto val = get(index)) if (auto val = get(index))
return val->as<T>(); return val->as<T>();
@ -883,7 +916,8 @@ namespace toml
private: private:
template <typename T> template <typename T>
[[nodiscard]] static bool container_equality(const array& lhs, const T& rhs) noexcept [[nodiscard]]
static bool container_equality(const array& lhs, const T& rhs) noexcept
{ {
using element_type = std::remove_const_t<typename T::value_type>; using element_type = std::remove_const_t<typename T::value_type>;
static_assert( static_assert(
@ -915,7 +949,8 @@ namespace toml
/// \brief Initializer list equality operator. /// \brief Initializer list equality operator.
template <typename T> template <typename T>
[[nodiscard]] friend bool operator == (const array& lhs, const std::initializer_list<T>& rhs) noexcept [[nodiscard]]
friend bool operator == (const array& lhs, const std::initializer_list<T>& rhs) noexcept
{ {
return container_equality(lhs, rhs); return container_equality(lhs, rhs);
} }
@ -923,7 +958,8 @@ namespace toml
/// \brief Vector equality operator. /// \brief Vector equality operator.
template <typename T> template <typename T>
[[nodiscard]] friend bool operator == (const array& lhs, const std::vector<T>& rhs) noexcept [[nodiscard]]
friend bool operator == (const array& lhs, const std::vector<T>& rhs) noexcept
{ {
return container_equality(lhs, rhs); return container_equality(lhs, rhs);
} }
@ -952,7 +988,7 @@ namespace toml
array& flatten() &; array& flatten() &;
/// \brief Flattens this array, recursively hoisting the contents of child arrays up into itself (rvalue overload). /// \brief Flattens this array, recursively hoisting the contents of child arrays up into itself (rvalue overload).
array&& flatten()&& array&& flatten() &&
{ {
return static_cast<toml::array&&>(static_cast<toml::array&>(*this).flatten()); return static_cast<toml::array&&>(static_cast<toml::array&>(*this).flatten());
} }
@ -961,6 +997,8 @@ namespace toml
template <typename Char> template <typename Char>
friend std::basic_ostream<Char>& operator << (std::basic_ostream<Char>&, const array&); friend std::basic_ostream<Char>& operator << (std::basic_ostream<Char>&, const array&);
}; };
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS //TOML_DISABLE_VTABLE_WARNINGS TOML_POP_WARNINGS //TOML_DISABLE_MISC_WARNINGS

View File

@ -18,6 +18,8 @@ TOML_DISABLE_SUGGEST_WARNINGS
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
void array::preinsertion_resize(size_t idx, size_t count) noexcept void array::preinsertion_resize(size_t idx, size_t count) noexcept
{ {
@ -232,6 +234,30 @@ namespace toml
return *this; return *this;
} }
TOML_EXTERNAL_LINKAGE
bool array::is_homogeneous(node_type type) const noexcept
{
if (values.empty())
return false;
if (type == node_type::none)
type = values[0]->type();
for (const auto& val : values)
if (val->type() != type)
return false;
return true;
}
TOML_EXTERNAL_LINKAGE
bool array::is_array_of_tables() const noexcept
{
return is_homogeneous(node_type::table);
}
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS // TOML_DISABLE_SUGGEST_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_SUGGEST_WARNINGS

View File

@ -31,10 +31,6 @@ TOML_DISABLE_ALL_WARNINGS
TOML_POP_WARNINGS TOML_POP_WARNINGS
#if TOML_CHAR_8_STRINGS && !defined(__cpp_lib_char8_t)
#error toml++ requires implementation support to use char8_t strings, but yours does not provide it.
#endif
#ifdef __cpp_lib_launder #ifdef __cpp_lib_launder
#define TOML_LAUNDER(x) std::launder(x) #define TOML_LAUNDER(x) std::launder(x)
#else #else
@ -59,8 +55,27 @@ TOML_DISABLE_PADDING_WARNINGS
TOML_DISABLE_SHADOW_WARNINGS TOML_DISABLE_SHADOW_WARNINGS
/// \brief The root namespace for all toml++ functions and types. /// \brief The root namespace for all toml++ functions and types.
namespace toml { TOML_ABI_NAMESPACE_VERSION TOML_ABI_NAMESPACE_END }
#if TOML_WINDOWS_COMPAT
namespace toml namespace toml
{ {
TOML_IMPL_NAMESPACE_START
[[nodiscard]] TOML_API std::string narrow(std::wstring_view) noexcept;
[[nodiscard]] TOML_API std::wstring widen(std::string_view) noexcept;
#ifdef __cpp_lib_char8_t
[[nodiscard]] TOML_API std::wstring widen(std::u8string_view) noexcept;
#endif
TOML_IMPL_NAMESPACE_END
}
#endif // TOML_WINDOWS_COMPAT
namespace toml
{
TOML_ABI_NAMESPACE_VERSION
using namespace std::string_literals; using namespace std::string_literals;
using namespace std::string_view_literals; using namespace std::string_view_literals;
using size_t = std::size_t; using size_t = std::size_t;
@ -74,53 +89,11 @@ namespace toml
return static_cast<size_t>(n); return static_cast<size_t>(n);
} }
#if TOML_CHAR_8_STRINGS // legacy typedefs
using string_char = char8_t;
using string = std::u8string;
using string_view = std::u8string_view;
#else
/// \brief The base character type for keys and string values.
/// \remarks This will be an alias for char8_t if #TOML_CHAR_8_STRINGS is enabled.
using string_char = char; using string_char = char;
/// \brief The string type for keys and string values.
/// \remarks This will be an alias for std::u8string if #TOML_CHAR_8_STRINGS is enabled.
using string = std::string; using string = std::string;
/// \brief The string type for keys and string values.
/// \remarks This will be an alias for std::u8string_view if #TOML_CHAR_8_STRINGS is enabled.
using string_view = std::string_view; using string_view = std::string_view;
#endif
#if TOML_WINDOWS_COMPAT
namespace impl
{
[[nodiscard]] TOML_API std::string narrow_char(std::wstring_view) noexcept;
#ifdef __cpp_lib_char8_t
[[nodiscard]] TOML_API std::u8string narrow_char8(std::wstring_view) noexcept;
#endif
template <typename Char = string_char>
[[nodiscard]] auto narrow(std::wstring_view str) noexcept
{
#ifdef __cpp_lib_char8_t
if constexpr (std::is_same_v<Char, char8_t>)
return narrow_char8(str);
else
#endif
return narrow_char(str);
}
[[nodiscard]] TOML_API std::wstring widen(std::string_view) noexcept;
#ifdef __cpp_lib_char8_t
[[nodiscard]] TOML_API std::wstring widen(std::u8string_view) noexcept;
#endif
}
#endif
#if !TOML_DOXYGEN #if !TOML_DOXYGEN
// foward declarations are hidden from doxygen // foward declarations are hidden from doxygen
@ -150,7 +123,7 @@ namespace toml
none, ///< Not-a-node. none, ///< Not-a-node.
table, ///< The node is a toml::table. table, ///< The node is a toml::table.
array, ///< The node is a toml::array. array, ///< The node is a toml::array.
string, ///< The node is a toml::value<toml::string>. string, ///< The node is a toml::value<std::string>.
integer, ///< The node is a toml::value<int64_t>. integer, ///< The node is a toml::value<int64_t>.
floating_point, ///< The node is a toml::value<double>. floating_point, ///< The node is a toml::value<double>.
boolean, ///< The node is a toml::value<bool>. boolean, ///< The node is a toml::value<bool>.
@ -175,23 +148,19 @@ namespace toml
#endif #endif
#if TOML_LARGE_FILES
using source_index = uint32_t;
#else
/// \brief The integer type used to tally line numbers and columns.
/// \remarks This will be an alias for uint32_t if #TOML_LARGE_FILES is enabled.
using source_index = uint16_t;
#endif
/// \brief A pointer to a shared string resource containing a source path. /// \brief A pointer to a shared string resource containing a source path.
using source_path_ptr = std::shared_ptr<const std::string>; using source_path_ptr = std::shared_ptr<const std::string>;
TOML_ABI_NAMESPACE_BOOL(TOML_LARGE_FILES, lf, sf) TOML_ABI_NAMESPACE_BOOL(TOML_LARGE_FILES, lf, sf)
#if TOML_LARGE_FILES
using source_index = uint32_t;
#else
/// \brief The integer type used to tally line numbers and columns.
/// \remarks This will be an alias for uint32_t if #TOML_LARGE_FILES is enabled.
using source_index = uint16_t;
#endif
/// \brief A source document line-and-column pair. /// \brief A source document line-and-column pair.
/// ///
/// \detail \cpp /// \detail \cpp
@ -325,12 +294,17 @@ namespace toml
}; };
TOML_ABI_NAMESPACE_END // TOML_LARGE_FILES TOML_ABI_NAMESPACE_END // TOML_LARGE_FILES
}
namespace toml::impl TOML_ABI_NAMESPACE_END // version
} // toml
namespace toml
{ {
TOML_IMPL_NAMESPACE_START
template <typename T> template <typename T>
using string_map = std::map<string, T, std::less<>>; //heterogeneous lookup using string_map = std::map<std::string, T, std::less<>>; // heterogeneous lookup
template <typename T> template <typename T>
using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>; using remove_cvref_t = std::remove_cv_t<std::remove_reference_t<T>>;
@ -343,6 +317,9 @@ namespace toml::impl
template <typename T, typename... U> template <typename T, typename... U>
inline constexpr bool is_one_of = is_one_of_<T, U...>::value; inline constexpr bool is_one_of = is_one_of_<T, U...>::value;
template <typename T>
inline constexpr bool is_cvref = std::is_reference_v<T> || std::is_const_v<T> || std::is_volatile_v<T>;
template <typename T> template <typename T>
[[nodiscard]] [[nodiscard]]
TOML_ATTR(const) TOML_ATTR(const)
@ -389,11 +366,11 @@ namespace toml::impl
#if TOML_ABI_NAMESPACES #if TOML_ABI_NAMESPACES
#if TOML_EXCEPTIONS #if TOML_EXCEPTIONS
TOML_ABI_NAMESPACE_START(impl_ex) TOML_ABI_NAMESPACE_START(ex)
#define TOML_PARSER_TYPENAME ::toml::impl::abi_impl_ex::parser #define TOML_PARSER_TYPENAME ::toml::impl::ex::parser
#else #else
TOML_ABI_NAMESPACE_START(impl_noex) TOML_ABI_NAMESPACE_START(noex)
#define TOML_PARSER_TYPENAME ::toml::impl::abi_impl_noex::parser #define TOML_PARSER_TYPENAME ::toml::impl::noex::parser
#endif #endif
#else #else
#define TOML_PARSER_TYPENAME ::toml::impl::parser #define TOML_PARSER_TYPENAME ::toml::impl::parser
@ -461,7 +438,6 @@ namespace toml::impl
template <typename T> template <typename T>
struct integer_value_traits<T, true> : unsigned_integer_value_traits<T> {}; struct integer_value_traits<T, true> : unsigned_integer_value_traits<T> {};
template <> struct value_traits<char> : integer_value_traits<char> {};
template <> struct value_traits<signed char> : integer_value_traits<signed char> {}; template <> struct value_traits<signed char> : integer_value_traits<signed char> {};
template <> struct value_traits<unsigned char> : integer_value_traits<unsigned char> {}; template <> struct value_traits<unsigned char> : integer_value_traits<unsigned char> {};
template <> struct value_traits<signed short> : integer_value_traits<signed short> {}; template <> struct value_traits<signed short> : integer_value_traits<signed short> {};
@ -479,7 +455,7 @@ namespace toml::impl
using native_type = int64_t; using native_type = int64_t;
static constexpr bool is_native = false; static constexpr bool is_native = false;
static constexpr bool is_losslessly_convertible_to_native = false; static constexpr bool is_losslessly_convertible_to_native = false;
static constexpr bool is_signed = static_cast<T>(-1) < T{}; // for impls not properly specializing <type_traits> static constexpr bool is_signed = static_cast<T>(-1) < T{}; // for impls not specializing std::is_signed<T>
static constexpr bool can_represent_native = is_signed; static constexpr bool can_represent_native = is_signed;
static constexpr bool can_partially_represent_native = true; static constexpr bool can_partially_represent_native = true;
static constexpr auto node_type = ::toml::node_type::integer; static constexpr auto node_type = ::toml::node_type::integer;
@ -487,7 +463,9 @@ namespace toml::impl
template <> template <>
struct value_traits<__int128_t> : big_integer_value_traits<__int128_t> struct value_traits<__int128_t> : big_integer_value_traits<__int128_t>
{ {
static constexpr auto max = static_cast<__int128_t>(( __uint128_t{ 1u } << ((__SIZEOF_INT128__ * CHAR_BIT) - 1)) - 1); static constexpr auto max = static_cast<__int128_t>(
( __uint128_t{ 1u } << ((__SIZEOF_INT128__ * CHAR_BIT) - 1)) - 1
);
static constexpr auto min = -max - __int128_t{ 1 }; static constexpr auto min = -max - __int128_t{ 1 };
}; };
template <> template <>
@ -551,11 +529,11 @@ namespace toml::impl
static_assert(value_traits<double>::can_partially_represent_native); static_assert(value_traits<double>::can_partially_represent_native);
// string value traits // string value traits
template <typename T> template <typename T>
struct string_value_traits struct string_value_traits
{ {
using native_type = ::toml::string; using native_type = std::string;
static constexpr bool is_native = std::is_same_v<T, native_type>; static constexpr bool is_native = std::is_same_v<T, native_type>;
static constexpr bool is_losslessly_convertible_to_native = true; static constexpr bool is_losslessly_convertible_to_native = true;
static constexpr bool can_represent_native static constexpr bool can_represent_native
@ -582,7 +560,7 @@ namespace toml::impl
template <typename T> template <typename T>
struct wstring_value_traits struct wstring_value_traits
{ {
using native_type = ::toml::string; using native_type = std::string;
static constexpr bool is_native = false; static constexpr bool is_native = false;
static constexpr bool is_losslessly_convertible_to_native = true; //narrow static constexpr bool is_losslessly_convertible_to_native = true; //narrow
static constexpr bool can_represent_native = std::is_same_v<T, std::wstring>; //widen static constexpr bool can_represent_native = std::is_same_v<T, std::wstring>; //widen
@ -613,7 +591,7 @@ namespace toml::impl
template <> struct value_traits<date> : native_value_traits<date, node_type::date> {}; template <> struct value_traits<date> : native_value_traits<date, node_type::date> {};
template <> struct value_traits<time> : native_value_traits<time, node_type::time> {}; template <> struct value_traits<time> : native_value_traits<time, node_type::time> {};
template <> struct value_traits<date_time> : native_value_traits<date_time, node_type::date_time> {}; template <> struct value_traits<date_time> : native_value_traits<date_time, node_type::date_time> {};
template <typename T> template <typename T>
inline constexpr bool is_wide_string = is_one_of< inline constexpr bool is_wide_string = is_one_of<
std::decay_t<T>, std::decay_t<T>,
@ -639,7 +617,7 @@ namespace toml::impl
inline constexpr bool is_natively_one_of = is_one_of<native_type_of<T>, U...>; inline constexpr bool is_natively_one_of = is_one_of<native_type_of<T>, U...>;
template <typename T> struct node_wrapper { using type = T; }; template <typename T> struct node_wrapper { using type = T; };
template <> struct node_wrapper<string> { using type = value<string>; }; template <> struct node_wrapper<std::string> { using type = value<std::string>; };
template <> struct node_wrapper<int64_t> { using type = value<int64_t>; }; template <> struct node_wrapper<int64_t> { using type = value<int64_t>; };
template <> struct node_wrapper<double> { using type = value<double>; }; template <> struct node_wrapper<double> { using type = value<double>; };
template <> struct node_wrapper<bool> { using type = value<bool>; }; template <> struct node_wrapper<bool> { using type = value<bool>; };
@ -652,11 +630,12 @@ namespace toml::impl
template <typename T> struct node_unwrapper<value<T>> { using type = T; }; template <typename T> struct node_unwrapper<value<T>> { using type = T; };
template <typename T> using unwrap_node = typename node_unwrapper<T>::type; template <typename T> using unwrap_node = typename node_unwrapper<T>::type;
template <typename T> struct node_type_getter { static constexpr auto value = value_traits<T>::node_type; }; template <typename T> struct node_type_getter { static constexpr auto value = value_traits<T>::node_type; };
template <> struct node_type_getter<table> { static constexpr auto value = node_type::table; }; template <> struct node_type_getter<table>{ static constexpr auto value = node_type::table; };
template <> struct node_type_getter<array> { static constexpr auto value = node_type::array; }; template <> struct node_type_getter<array>{ static constexpr auto value = node_type::array; };
template <typename T> inline constexpr node_type node_type_of = node_type_getter<unwrap_node<remove_cvref_t<T>>>::value; template <typename T>
inline constexpr node_type node_type_of = node_type_getter<unwrap_node<remove_cvref_t<T>>>::value;
inline constexpr std::string_view low_character_escape_table[] = inline constexpr std::string_view low_character_escape_table[] =
{ {
"\\u0000"sv, "\\u0000"sv,
@ -729,19 +708,23 @@ namespace toml::impl
template <typename T> template <typename T>
inline constexpr bool dependent_false = false; inline constexpr bool dependent_false = false;
}
TOML_IMPL_NAMESPACE_END
} // impl
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
/// \brief Metafunction for determining if a type is a toml::table. /// \brief Metafunction for determining if a type is a toml::table.
template <typename T> template <typename T>
inline constexpr bool is_table = std::is_same_v<impl::remove_cvref_t<T>, table>; inline constexpr bool is_table = std::is_same_v<impl::remove_cvref_t<T>, table>;
/// \brief Metafunction for determining if a type is a toml::array. /// \brief Metafunction for determining if a type is a toml::array.
template <typename T> template <typename T>
inline constexpr bool is_array = std::is_same_v<impl::remove_cvref_t<T>, array>; inline constexpr bool is_array = std::is_same_v<impl::remove_cvref_t<T>, array>;
/// \brief Metafunction for determining if a type is a toml::string or toml::value<toml::string>. /// \brief Metafunction for determining if a type is a std::string or toml::value<std::string>.
template <typename T> template <typename T>
inline constexpr bool is_string = std::is_same_v<impl::wrap_node<impl::remove_cvref_t<T>>, value<string>>; inline constexpr bool is_string = std::is_same_v<impl::wrap_node<impl::remove_cvref_t<T>>, value<std::string>>;
/// \brief Metafunction for determining if a type is an int64_t or toml::value<int64_t>. /// \brief Metafunction for determining if a type is an int64_t or toml::value<int64_t>.
template <typename T> template <typename T>
inline constexpr bool is_integer = std::is_same_v<impl::wrap_node<impl::remove_cvref_t<T>>, value<int64_t>>; inline constexpr bool is_integer = std::is_same_v<impl::wrap_node<impl::remove_cvref_t<T>>, value<int64_t>>;
@ -780,8 +763,7 @@ namespace toml
/// Element [3] is: boolean /// Element [3] is: boolean
/// \eout /// \eout
template <typename Char> template <typename Char>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, node_type rhs)
std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, node_type rhs)
{ {
using underlying_t = std::underlying_type_t<node_type>; using underlying_t = std::underlying_type_t<node_type>;
const auto str = impl::node_type_friendly_names[static_cast<underlying_t>(rhs)]; const auto str = impl::node_type_friendly_names[static_cast<underlying_t>(rhs)];
@ -822,6 +804,8 @@ namespace toml
T&& value; T&& value;
}; };
template <typename T> inserter(T&&) -> inserter<T>; template <typename T> inserter(T&&) -> inserter<T>;
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS // TOML_DISABLE_PADDING_WARNINGS, TOML_DISABLE_SHADOW_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_PADDING_WARNINGS, TOML_DISABLE_SHADOW_WARNINGS

View File

@ -11,6 +11,8 @@ TOML_DISABLE_PADDING_WARNINGS
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
/// \brief A local date. /// \brief A local date.
struct TOML_TRIVIAL_ABI date struct TOML_TRIVIAL_ABI date
{ {
@ -89,8 +91,7 @@ namespace toml
/// 1987-03-16 /// 1987-03-16
/// \eout /// \eout
template <typename Char> template <typename Char>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const date& rhs)
std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const date& rhs)
{ {
impl::print_to_stream(rhs, lhs); impl::print_to_stream(rhs, lhs);
return lhs; return lhs;
@ -131,7 +132,8 @@ namespace toml
private: private:
[[nodiscard]] TOML_ALWAYS_INLINE [[nodiscard]]
TOML_ALWAYS_INLINE
static constexpr uint64_t pack(time t) noexcept static constexpr uint64_t pack(time t) noexcept
{ {
return static_cast<uint64_t>(t.hour) << 48 return static_cast<uint64_t>(t.hour) << 48
@ -182,8 +184,7 @@ namespace toml
/// 10:20:34.5 /// 10:20:34.5
/// \eout /// \eout
template <typename Char> template <typename Char>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const time& rhs)
std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const time& rhs)
{ {
impl::print_to_stream(rhs, lhs); impl::print_to_stream(rhs, lhs);
return lhs; return lhs;
@ -289,8 +290,7 @@ namespace toml
/// -02:30 /// -02:30
/// \eout /// \eout
template <typename Char> template <typename Char>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const time_offset& rhs)
std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const time_offset& rhs)
{ {
impl::print_to_stream(rhs, lhs); impl::print_to_stream(rhs, lhs);
return lhs; return lhs;
@ -418,8 +418,7 @@ namespace toml
/// 1987-03-16T10:20:34Z /// 1987-03-16T10:20:34Z
/// \eout /// \eout
template <typename Char> template <typename Char>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const date_time& rhs)
std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const date_time& rhs)
{ {
impl::print_to_stream(rhs, lhs); impl::print_to_stream(rhs, lhs);
return lhs; return lhs;
@ -428,6 +427,8 @@ namespace toml
#if !TOML_ALL_INLINE #if !TOML_ALL_INLINE
extern template TOML_API std::ostream& operator << (std::ostream&, const date_time&); extern template TOML_API std::ostream& operator << (std::ostream&, const date_time&);
#endif #endif
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS // TOML_DISABLE_PADDING_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_PADDING_WARNINGS

View File

@ -13,20 +13,21 @@ TOML_PUSH_WARNINGS
TOML_DISABLE_SWITCH_WARNINGS TOML_DISABLE_SWITCH_WARNINGS
TOML_DISABLE_PADDING_WARNINGS TOML_DISABLE_PADDING_WARNINGS
namespace toml::impl namespace toml
{ {
[[nodiscard]] TOML_API TOML_IMPL_NAMESPACE_START
toml::string default_formatter_make_key_segment(const toml::string& str) noexcept;
[[nodiscard]] TOML_API [[nodiscard]] TOML_API std::string default_formatter_make_key_segment(const std::string&) noexcept;
size_t default_formatter_inline_columns(const node& node) 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;
[[nodiscard]] TOML_API TOML_IMPL_NAMESPACE_END
bool default_formatter_forces_multiline(const node& node, size_t starting_column_bias = 0) noexcept;
} }
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
template <typename T, typename U> template <typename T, typename U>
std::basic_ostream<T>& operator << (std::basic_ostream<T>&, default_formatter<U>&); std::basic_ostream<T>& operator << (std::basic_ostream<T>&, default_formatter<U>&);
template <typename T, typename U> template <typename T, typename U>
@ -66,9 +67,9 @@ namespace toml
{ {
private: private:
using base = impl::formatter<Char>; using base = impl::formatter<Char>;
std::vector<toml::string> key_path; std::vector<std::string> key_path;
void print_key_segment(const toml::string& str) void print_key_segment(const std::string& str)
{ {
if (str.empty()) if (str.empty())
impl::print_to_stream("''"sv, base::stream()); impl::print_to_stream("''"sv, base::stream());
@ -353,8 +354,7 @@ namespace toml
/// \brief Prints the bound TOML object out to the stream as formatted TOML. /// \brief Prints the bound TOML object out to the stream as formatted TOML.
template <typename T, typename U> template <typename T, typename U>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<T>& operator << (std::basic_ostream<T>& lhs, default_formatter<U>& rhs)
std::basic_ostream<T>& operator << (std::basic_ostream<T>& lhs, default_formatter<U>& rhs)
{ {
rhs.attach(lhs); rhs.attach(lhs);
rhs.key_path.clear(); rhs.key_path.clear();
@ -365,29 +365,25 @@ namespace toml
/// \brief Prints the bound TOML object out to the stream as formatted TOML (rvalue overload). /// \brief Prints the bound TOML object out to the stream as formatted TOML (rvalue overload).
template <typename T, typename U> template <typename T, typename U>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<T>& operator << (std::basic_ostream<T>& lhs, default_formatter<U>&& rhs)
std::basic_ostream<T>& operator << (std::basic_ostream<T>& lhs, default_formatter<U>&& rhs)
{ {
return lhs << rhs; //as lvalue return lhs << rhs; //as lvalue
} }
template <typename Char> template <typename Char>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const table& rhs)
std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const table& rhs)
{ {
return lhs << default_formatter<Char>{ rhs }; return lhs << default_formatter<Char>{ rhs };
} }
template <typename Char> template <typename Char>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const array& rhs)
std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const array& rhs)
{ {
return lhs << default_formatter<Char>{ rhs }; return lhs << default_formatter<Char>{ rhs };
} }
template <typename Char, typename T> template <typename Char, typename T>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const value<T>& rhs)
std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const value<T>& rhs)
{ {
return lhs << default_formatter<Char>{ rhs }; return lhs << default_formatter<Char>{ rhs };
} }
@ -397,7 +393,7 @@ namespace toml
extern template TOML_API std::ostream& operator << (std::ostream&, default_formatter<char>&&); extern template TOML_API std::ostream& operator << (std::ostream&, default_formatter<char>&&);
extern template TOML_API std::ostream& operator << (std::ostream&, const table&); extern template TOML_API std::ostream& operator << (std::ostream&, const table&);
extern template TOML_API std::ostream& operator << (std::ostream&, const array&); extern template TOML_API std::ostream& operator << (std::ostream&, const array&);
extern template TOML_API std::ostream& operator << (std::ostream&, const value<toml::string>&); extern template TOML_API std::ostream& operator << (std::ostream&, const value<std::string>&);
extern template TOML_API std::ostream& operator << (std::ostream&, const value<int64_t>&); extern template TOML_API std::ostream& operator << (std::ostream&, const value<int64_t>&);
extern template TOML_API std::ostream& operator << (std::ostream&, const value<double>&); extern template TOML_API std::ostream& operator << (std::ostream&, const value<double>&);
extern template TOML_API std::ostream& operator << (std::ostream&, const value<bool>&); extern template TOML_API std::ostream& operator << (std::ostream&, const value<bool>&);
@ -405,6 +401,8 @@ namespace toml
extern template TOML_API std::ostream& operator << (std::ostream&, const value<toml::time>&); extern template TOML_API std::ostream& operator << (std::ostream&, const value<toml::time>&);
extern template TOML_API std::ostream& operator << (std::ostream&, const value<toml::date_time>&); extern template TOML_API std::ostream& operator << (std::ostream&, const value<toml::date_time>&);
#endif #endif
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_PADDING_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_PADDING_WARNINGS

View File

@ -19,21 +19,20 @@ TOML_POP_WARNINGS
TOML_PUSH_WARNINGS TOML_PUSH_WARNINGS
TOML_DISABLE_SWITCH_WARNINGS TOML_DISABLE_SWITCH_WARNINGS
TOML_DISABLE_FLOAT_WARNINGS TOML_DISABLE_ARITHMETIC_WARNINGS
namespace toml::impl namespace toml
{ {
inline constexpr size_t default_formatter_line_wrap = 120_sz; TOML_IMPL_NAMESPACE_START
TOML_PUSH_WARNINGS inline constexpr size_t default_formatter_line_wrap = 120_sz;
TOML_DISABLE_ALL_WARNINGS
TOML_API TOML_API
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
string default_formatter_make_key_segment(const string& str) noexcept std::string default_formatter_make_key_segment(const std::string& str) noexcept
{ {
if (str.empty()) if (str.empty())
return TOML_STRING_PREFIX("''"s); return "''"s;
else else
{ {
bool requiresQuotes = false; bool requiresQuotes = false;
@ -51,24 +50,24 @@ namespace toml::impl
if (requiresQuotes) if (requiresQuotes)
{ {
string s; std::string s;
s.reserve(str.length() + 2_sz); s.reserve(str.length() + 2_sz);
s += TOML_STRING_PREFIX('"'); s += '"';
for (auto c : str) for (auto c : str)
{ {
if TOML_UNLIKELY(c >= TOML_STRING_PREFIX('\x00') && c <= TOML_STRING_PREFIX('\x1F')) if TOML_UNLIKELY(c >= '\x00' && c <= '\x1F')
{ {
const auto& sv = low_character_escape_table[c]; const auto& sv = low_character_escape_table[c];
s.append(reinterpret_cast<const string_char*>(sv.data()), sv.length()); s.append(reinterpret_cast<const char*>(sv.data()), sv.length());
} }
else if TOML_UNLIKELY(c == TOML_STRING_PREFIX('\x7F')) else if TOML_UNLIKELY(c == '\x7F')
s.append(TOML_STRING_PREFIX("\\u007F"sv)); s.append("\\u007F"sv);
else if TOML_UNLIKELY(c == TOML_STRING_PREFIX('"')) else if TOML_UNLIKELY(c == '"')
s.append(TOML_STRING_PREFIX("\\\""sv)); s.append("\\\""sv);
else else
s += c; s += c;
} }
s += TOML_STRING_PREFIX('"'); s += '"';
return s; return s;
} }
else else
@ -76,8 +75,6 @@ namespace toml::impl
} }
} }
TOML_POP_WARNINGS
TOML_API TOML_API
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
size_t default_formatter_inline_columns(const node& node) noexcept size_t default_formatter_inline_columns(const node& node) noexcept
@ -116,7 +113,7 @@ namespace toml::impl
case node_type::string: case node_type::string:
{ {
auto& n = *reinterpret_cast<const value<string>*>(&node); auto& n = *reinterpret_cast<const value<std::string>*>(&node);
return n.get().length() + 2_sz; // + "" return n.get().length() + 2_sz; // + ""
} }
@ -168,13 +165,16 @@ namespace toml::impl
{ {
return (default_formatter_inline_columns(node) + starting_column_bias) > default_formatter_line_wrap; return (default_formatter_inline_columns(node) + starting_column_bias) > default_formatter_line_wrap;
} }
TOML_IMPL_NAMESPACE_END
} }
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
template <typename Char> template <typename Char>
TOML_EXTERNAL_LINKAGE inline void default_formatter<Char>::print_inline(const toml::table& tbl)
void default_formatter<Char>::print_inline(const toml::table& tbl)
{ {
if (tbl.empty()) if (tbl.empty())
impl::print_to_stream("{}"sv, base::stream()); impl::print_to_stream("{}"sv, base::stream());
@ -207,9 +207,9 @@ namespace toml
} }
base::clear_naked_newline(); base::clear_naked_newline();
} }
}
TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_FLOAT_WARNINGS TOML_ABI_NAMESPACE_END // version
}
// implementations of windows wide string nonsense // implementations of windows wide string nonsense
#if TOML_WINDOWS_COMPAT #if TOML_WINDOWS_COMPAT
@ -219,11 +219,13 @@ TOML_DISABLE_ALL_WARNINGS
#include <Windows.h> // fuckkkk :( #include <Windows.h> // fuckkkk :(
TOML_POP_WARNINGS TOML_POP_WARNINGS
namespace toml::impl namespace toml
{ {
TOML_IMPL_NAMESPACE_START
TOML_API TOML_API
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
std::string narrow_char(std::wstring_view str) noexcept std::string narrow(std::wstring_view str) noexcept
{ {
if (str.empty()) if (str.empty())
return {}; return {};
@ -240,31 +242,6 @@ namespace toml::impl
return s; return s;
} }
#ifdef __cpp_lib_char8_t
TOML_API
TOML_EXTERNAL_LINKAGE
std::u8string narrow_char8(std::wstring_view str) noexcept
{
if (str.empty())
return {};
std::u8string s;
const auto len = WideCharToMultiByte(
65001, 0, str.data(), static_cast<int>(str.length()), nullptr, 0, nullptr, nullptr
);
if (len)
{
s.resize(static_cast<size_t>(len));
WideCharToMultiByte(
65001, 0, str.data(), static_cast<int>(str.length()), reinterpret_cast<char*>(s.data()), len, nullptr, nullptr
);
}
return s;
}
#endif // __cpp_lib_char8_t
TOML_API TOML_API
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
std::wstring widen(std::string_view str) noexcept std::wstring widen(std::string_view str) noexcept
@ -295,6 +272,10 @@ namespace toml::impl
} }
#endif // __cpp_lib_char8_t #endif // __cpp_lib_char8_t
TOML_IMPL_NAMESPACE_END
} }
#endif // TOML_WINDOWS_COMPAT #endif // TOML_WINDOWS_COMPAT
TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_ARITHMETIC_WARNINGS

View File

@ -12,6 +12,8 @@ TOML_DISABLE_PADDING_WARNINGS
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
/// \brief Format flags for modifying how TOML data is printed to streams. /// \brief Format flags for modifying how TOML data is printed to streams.
enum class format_flags : uint8_t enum class format_flags : uint8_t
{ {
@ -45,10 +47,14 @@ namespace toml
{ {
return static_cast<format_flags>( impl::unbox_enum(lhs) | impl::unbox_enum(rhs) ); return static_cast<format_flags>( impl::unbox_enum(lhs) | impl::unbox_enum(rhs) );
} }
TOML_ABI_NAMESPACE_END // version
} }
namespace toml::impl namespace toml
{ {
TOML_IMPL_NAMESPACE_START
template <typename Char = char> template <typename Char = char>
class TOML_API formatter class TOML_API formatter
{ {
@ -65,7 +71,7 @@ namespace toml::impl
[[nodiscard]] std::basic_ostream<Char>& stream() const noexcept { return *stream_; } [[nodiscard]] std::basic_ostream<Char>& stream() const noexcept { return *stream_; }
static constexpr size_t indent_columns = 4; static constexpr size_t indent_columns = 4;
static constexpr toml::string_view indent_string = TOML_STRING_PREFIX(" "sv); static constexpr std::string_view indent_string = " "sv;
[[nodiscard]] int8_t indent() const noexcept { return indent_; } [[nodiscard]] int8_t indent() const noexcept { return indent_; }
void indent(int8_t level) noexcept { indent_ = level; } void indent(int8_t level) noexcept { indent_ = level; }
void increase_indent() noexcept { indent_++; } void increase_indent() noexcept { indent_++; }
@ -124,7 +130,7 @@ namespace toml::impl
} }
} }
void print_quoted_string(toml::string_view str, bool allow_multi_line = true) void print_quoted_string(std::string_view str, bool allow_multi_line = true)
{ {
auto literals = literal_strings_allowed(); auto literals = literal_strings_allowed();
if (str.empty()) if (str.empty())
@ -185,7 +191,7 @@ namespace toml::impl
template <typename T> template <typename T>
void print(const value<T>& val) void print(const value<T>& val)
{ {
if constexpr (std::is_same_v<T, string>) if constexpr (std::is_same_v<T, std::string>)
{ {
print_quoted_string(val.get()); print_quoted_string(val.get());
} }
@ -220,7 +226,7 @@ namespace toml::impl
TOML_ASSUME(type > node_type::array); TOML_ASSUME(type > node_type::array);
switch (type) switch (type)
{ {
case node_type::string: print(*reinterpret_cast<const value<string>*>(&val_node)); break; case node_type::string: print(*reinterpret_cast<const value<std::string>*>(&val_node)); break;
case node_type::integer: print(*reinterpret_cast<const value<int64_t>*>(&val_node)); break; case node_type::integer: print(*reinterpret_cast<const value<int64_t>*>(&val_node)); break;
case node_type::floating_point: print(*reinterpret_cast<const value<double>*>(&val_node)); break; case node_type::floating_point: print(*reinterpret_cast<const value<double>*>(&val_node)); break;
case node_type::boolean: print(*reinterpret_cast<const value<bool>*>(&val_node)); break; case node_type::boolean: print(*reinterpret_cast<const value<bool>*>(&val_node)); break;
@ -240,6 +246,8 @@ namespace toml::impl
#if !TOML_ALL_INLINE #if !TOML_ALL_INLINE
extern template class TOML_API formatter<char>; extern template class TOML_API formatter<char>;
#endif #endif
TOML_IMPL_NAMESPACE_END
} }
TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_PADDING_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_PADDING_WARNINGS

View File

@ -23,12 +23,31 @@ TOML_POP_WARNINGS
#include "toml_node_view.h" #include "toml_node_view.h"
#include "toml_default_formatter.h" #include "toml_default_formatter.h"
#include "toml_json_formatter.h" #include "toml_json_formatter.h"
#if TOML_PARSER
#include "toml_parser.h"
#endif
// template instantiations // internal implementation namespace
namespace toml namespace toml
{ {
TOML_IMPL_NAMESPACE_START
// formatters
template class TOML_API formatter<char>;
// print to stream machinery
template TOML_API void print_floating_point_to_stream(double, std::ostream&, bool);
TOML_IMPL_NAMESPACE_END
}
// public namespace
namespace toml
{
TOML_ABI_NAMESPACE_VERSION
// value<> // value<>
template class TOML_API value<string>; template class TOML_API value<std::string>;
template class TOML_API value<int64_t>; template class TOML_API value<int64_t>;
template class TOML_API value<double>; template class TOML_API value<double>;
template class TOML_API value<bool>; template class TOML_API value<bool>;
@ -41,10 +60,6 @@ namespace toml
template class TOML_API node_view<const node>; template class TOML_API node_view<const node>;
// formatters // formatters
namespace impl
{
template class TOML_API formatter<char>;
}
template class TOML_API default_formatter<char>; template class TOML_API default_formatter<char>;
template class TOML_API json_formatter<char>; template class TOML_API json_formatter<char>;
@ -55,7 +70,7 @@ namespace toml
template TOML_API std::ostream& operator << (std::ostream&, const time&); template TOML_API std::ostream& operator << (std::ostream&, const time&);
template TOML_API std::ostream& operator << (std::ostream&, const time_offset&); template TOML_API std::ostream& operator << (std::ostream&, const time_offset&);
template TOML_API std::ostream& operator << (std::ostream&, const date_time&); template TOML_API std::ostream& operator << (std::ostream&, const date_time&);
template TOML_API std::ostream& operator << (std::ostream&, const value<toml::string>&); template TOML_API std::ostream& operator << (std::ostream&, const value<std::string>&);
template TOML_API std::ostream& operator << (std::ostream&, const value<int64_t>&); template TOML_API std::ostream& operator << (std::ostream&, const value<int64_t>&);
template TOML_API std::ostream& operator << (std::ostream&, const value<double>&); template TOML_API std::ostream& operator << (std::ostream&, const value<double>&);
template TOML_API std::ostream& operator << (std::ostream&, const value<bool>&); template TOML_API std::ostream& operator << (std::ostream&, const value<bool>&);
@ -72,37 +87,75 @@ namespace toml
template TOML_API std::ostream& operator << (std::ostream&, const node_view<const node>&); template TOML_API std::ostream& operator << (std::ostream&, const node_view<const node>&);
template TOML_API std::ostream& operator << (std::ostream&, node_type); template TOML_API std::ostream& operator << (std::ostream&, node_type);
// print_to_stream() machinery // node::value, node_view:::value etc
namespace impl #define TOML_INSTANTIATE(name, T) \
{ template TOML_API optional<T> node::name<T>() const noexcept; \
template TOML_API void print_floating_point_to_stream(double, std::ostream&, bool); template TOML_API optional<T> node_view<node>::name<T>() const noexcept; \
} template TOML_API optional<T> node_view<const node>::name<T>() const noexcept
} TOML_INSTANTIATE(value_exact, std::string_view);
TOML_INSTANTIATE(value_exact, std::string);
TOML_INSTANTIATE(value_exact, const char*);
// parser instantiations TOML_INSTANTIATE(value_exact, int64_t);
#if TOML_PARSER TOML_INSTANTIATE(value_exact, double);
TOML_INSTANTIATE(value_exact, date);
#include "toml_parser.h" TOML_INSTANTIATE(value_exact, time);
TOML_INSTANTIATE(value_exact, date_time);
namespace toml TOML_INSTANTIATE(value_exact, bool);
{ TOML_INSTANTIATE(value, std::string_view);
// parse error ostream TOML_INSTANTIATE(value, std::string);
template TOML_API std::ostream& operator << (std::ostream&, const parse_error&); TOML_INSTANTIATE(value, const char*);
TOML_INSTANTIATE(value, signed char);
// parse() and parse_file() TOML_INSTANTIATE(value, signed short);
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, parse_ex, parse_noex) TOML_INSTANTIATE(value, signed int);
TOML_INSTANTIATE(value, signed long);
template TOML_API parse_result parse(std::istream&, std::string_view) TOML_MAY_THROW; TOML_INSTANTIATE(value, signed long long);
template TOML_API parse_result parse(std::istream&, std::string&&) TOML_MAY_THROW; TOML_INSTANTIATE(value, unsigned char);
template TOML_API parse_result parse_file(std::string_view) TOML_MAY_THROW; TOML_INSTANTIATE(value, unsigned short);
TOML_INSTANTIATE(value, unsigned int);
TOML_INSTANTIATE(value, unsigned long);
TOML_INSTANTIATE(value, unsigned long long);
TOML_INSTANTIATE(value, double);
TOML_INSTANTIATE(value, float);
TOML_INSTANTIATE(value, date);
TOML_INSTANTIATE(value, time);
TOML_INSTANTIATE(value, date_time);
TOML_INSTANTIATE(value, bool);
#ifdef __cpp_lib_char8_t #ifdef __cpp_lib_char8_t
template TOML_API parse_result parse_file(std::u8string_view) TOML_MAY_THROW; TOML_INSTANTIATE(value_exact, std::u8string_view);
TOML_INSTANTIATE(value_exact, std::u8string);
TOML_INSTANTIATE(value_exact, const char8_t*);
TOML_INSTANTIATE(value, std::u8string_view);
TOML_INSTANTIATE(value, std::u8string);
TOML_INSTANTIATE(value, const char8_t*);
#endif #endif
#if TOML_WINDOWS_COMPAT #if TOML_WINDOWS_COMPAT
template TOML_API parse_result parse_file(std::wstring_view) TOML_MAY_THROW; TOML_INSTANTIATE(value_exact, std::wstring);
TOML_INSTANTIATE(value, std::wstring);
#endif #endif
#undef TOML_INSTANTIATE
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS // parser instantiations
#if TOML_PARSER
// parse error ostream
template TOML_API std::ostream& operator << (std::ostream&, const parse_error&);
// parse() and parse_file()
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, ex, noex)
template TOML_API parse_result parse(std::istream&, std::string_view) TOML_MAY_THROW;
template TOML_API parse_result parse(std::istream&, std::string&&) TOML_MAY_THROW;
template TOML_API parse_result parse_file(std::string_view) TOML_MAY_THROW;
#ifdef __cpp_lib_char8_t
template TOML_API parse_result parse_file(std::u8string_view) TOML_MAY_THROW;
#endif
#if TOML_WINDOWS_COMPAT
template TOML_API parse_result parse_file(std::wstring_view) TOML_MAY_THROW;
#endif
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
#endif // TOML_PARSER
TOML_ABI_NAMESPACE_END // version
} }
#endif // TOML_PARSER

View File

@ -12,6 +12,8 @@ TOML_DISABLE_PADDING_WARNINGS
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
template <typename T, typename U> template <typename T, typename U>
std::basic_ostream<T>& operator << (std::basic_ostream<T>&, json_formatter<U>&); std::basic_ostream<T>& operator << (std::basic_ostream<T>&, json_formatter<U>&);
template <typename T, typename U> template <typename T, typename U>
@ -132,8 +134,7 @@ namespace toml
/// \brief Prints the bound TOML object out to the stream as JSON. /// \brief Prints the bound TOML object out to the stream as JSON.
template <typename T, typename U> template <typename T, typename U>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<T>& operator << (std::basic_ostream<T>& lhs, json_formatter<U>& rhs)
std::basic_ostream<T>& operator << (std::basic_ostream<T>& lhs, json_formatter<U>& rhs)
{ {
rhs.attach(lhs); rhs.attach(lhs);
rhs.print(); rhs.print();
@ -143,8 +144,7 @@ namespace toml
/// \brief Prints the bound TOML object out to the stream as JSON (rvalue overload). /// \brief Prints the bound TOML object out to the stream as JSON (rvalue overload).
template <typename T, typename U> template <typename T, typename U>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<T>& operator << (std::basic_ostream<T>& lhs, json_formatter<U>&& rhs)
std::basic_ostream<T>& operator << (std::basic_ostream<T>& lhs, json_formatter<U>&& rhs)
{ {
return lhs << rhs; //as lvalue return lhs << rhs; //as lvalue
} }
@ -153,6 +153,8 @@ namespace toml
extern template TOML_API std::ostream& operator << (std::ostream&, json_formatter<char>&); extern template TOML_API std::ostream& operator << (std::ostream&, json_formatter<char>&);
extern template TOML_API std::ostream& operator << (std::ostream&, json_formatter<char>&&); extern template TOML_API std::ostream& operator << (std::ostream&, json_formatter<char>&&);
#endif #endif
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_PADDING_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_PADDING_WARNINGS

View File

@ -18,9 +18,10 @@ TOML_DISABLE_SWITCH_WARNINGS
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
template <typename Char> template <typename Char>
TOML_EXTERNAL_LINKAGE inline void json_formatter<Char>::print(const toml::table& tbl)
void json_formatter<Char>::print(const toml::table& tbl)
{ {
if (tbl.empty()) if (tbl.empty())
impl::print_to_stream("{}"sv, base::stream()); impl::print_to_stream("{}"sv, base::stream());
@ -58,6 +59,8 @@ namespace toml
} }
base::clear_naked_newline(); base::clear_naked_newline();
} }
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS

View File

@ -7,16 +7,10 @@
#include "toml_common.h" #include "toml_common.h"
TOML_PUSH_WARNINGS TOML_PUSH_WARNINGS
TOML_DISABLE_VTABLE_WARNINGS TOML_DISABLE_MISC_WARNINGS
#if TOML_CHAR_8_STRINGS
#define TOML_NATIVE_STRING_TYPE_NAME "std::u8string"
#else
#define TOML_NATIVE_STRING_TYPE_NAME "std::string"
#endif
#define TOML_NATIVE_VALUE_TYPE_LIST \ #define TOML_NATIVE_VALUE_TYPE_LIST \
"\n| - " TOML_NATIVE_STRING_TYPE_NAME \ "\n| - std::string" \
"\n| - int64_t" \ "\n| - int64_t" \
"\n| - double" \ "\n| - double" \
"\n| - bool" \ "\n| - bool" \
@ -28,7 +22,7 @@ TOML_DISABLE_VTABLE_WARNINGS
#define TOML_NODE_TYPE_LIST \ #define TOML_NODE_TYPE_LIST \
"\n| - toml::table" \ "\n| - toml::table" \
"\n| - toml::array" \ "\n| - toml::array" \
"\n| - toml::value<" TOML_NATIVE_STRING_TYPE_NAME ">" \ "\n| - toml::value<std::string>" \
"\n| - toml::value<int64_t>" \ "\n| - toml::value<int64_t>" \
"\n| - toml::value<double>" \ "\n| - toml::value<double>" \
"\n| - toml::value<bool>" \ "\n| - toml::value<bool>" \
@ -46,6 +40,8 @@ TOML_DISABLE_VTABLE_WARNINGS
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
/// \brief A TOML node. /// \brief A TOML node.
/// ///
/// \detail A parsed TOML document forms a tree made up of tables, arrays and values. /// \detail A parsed TOML document forms a tree made up of tables, arrays and values.
@ -136,14 +132,14 @@ namespace toml
{ {
using type = impl::unwrap_node<T>; using type = impl::unwrap_node<T>;
static_assert( static_assert(
impl::is_native<type> || impl::is_one_of<type, table, array>, (impl::is_native<type> || impl::is_one_of<type, table, array>) && !impl::is_cvref<type>,
"The template type argument of node::is() must be one of the following:" "The template type argument of node::is() must be one of the following:"
TOML_UNWRAPPED_NODE_TYPE_LIST TOML_UNWRAPPED_NODE_TYPE_LIST
); );
if constexpr (std::is_same_v<type, table>) return is_table(); if constexpr (std::is_same_v<type, table>) return is_table();
else if constexpr (std::is_same_v<type, array>) return is_array(); else if constexpr (std::is_same_v<type, array>) return is_array();
else if constexpr (std::is_same_v<type, string>) return is_string(); else if constexpr (std::is_same_v<type, std::string>) return is_string();
else if constexpr (std::is_same_v<type, int64_t>) return is_integer(); else if constexpr (std::is_same_v<type, int64_t>) return is_integer();
else if constexpr (std::is_same_v<type, double>) return is_floating_point(); else if constexpr (std::is_same_v<type, double>) return is_floating_point();
else if constexpr (std::is_same_v<type, bool>) return is_boolean(); else if constexpr (std::is_same_v<type, bool>) return is_boolean();
@ -157,7 +153,7 @@ namespace toml
/// \brief Returns a pointer to the node as a toml::array, if it is one. /// \brief Returns a pointer to the node as a toml::array, if it is one.
[[nodiscard]] virtual array* as_array() noexcept; [[nodiscard]] virtual array* as_array() noexcept;
/// \brief Returns a pointer to the node as a toml::value<string>, if it is one. /// \brief Returns a pointer to the node as a toml::value<string>, if it is one.
[[nodiscard]] virtual toml::value<string>* as_string() noexcept; [[nodiscard]] virtual toml::value<std::string>* as_string() noexcept;
/// \brief Returns a pointer to the node as a toml::value<int64_t>, if it is one. /// \brief Returns a pointer to the node as a toml::value<int64_t>, if it is one.
[[nodiscard]] virtual toml::value<int64_t>* as_integer() noexcept; [[nodiscard]] virtual toml::value<int64_t>* as_integer() noexcept;
/// \brief Returns a pointer to the node as a toml::value<double>, if it is one. /// \brief Returns a pointer to the node as a toml::value<double>, if it is one.
@ -173,7 +169,7 @@ namespace toml
[[nodiscard]] virtual const table* as_table() const noexcept; [[nodiscard]] virtual const table* as_table() const noexcept;
[[nodiscard]] virtual const array* as_array() const noexcept; [[nodiscard]] virtual const array* as_array() const noexcept;
[[nodiscard]] virtual const toml::value<string>* as_string() const noexcept; [[nodiscard]] virtual const toml::value<std::string>* as_string() const noexcept;
[[nodiscard]] virtual const toml::value<int64_t>* as_integer() const noexcept; [[nodiscard]] virtual const toml::value<int64_t>* as_integer() const noexcept;
[[nodiscard]] virtual const toml::value<double>* as_floating_point() const noexcept; [[nodiscard]] virtual const toml::value<double>* as_floating_point() const noexcept;
[[nodiscard]] virtual const toml::value<bool>* as_boolean() const noexcept; [[nodiscard]] virtual const toml::value<bool>* as_boolean() const noexcept;
@ -190,70 +186,170 @@ namespace toml
public: public:
/// \brief Gets the value contained by this node.
///
/// \detail This function has 'exact' retrieval semantics; the only return value types allowed are the
/// TOML native value types, or types that can losslessly represent a native value type (e.g.
/// std::wstring on Windows).
///
/// \tparam T One of the native TOML value types, or a type capable of losslessly representing one.
///
/// \returns The underlying value if the node was a value of the
/// matching type (or losslessly convertible to it), or an empty optional.
///
/// \see node::value()
template <typename T> template <typename T>
[[nodiscard]] [[nodiscard]]
optional<T> value_exact() const noexcept; optional<T> value_exact() const noexcept;
/// \brief Gets the raw value contained by this node. /// \brief Gets the value contained by this node.
/// ///
/// \detail The optional returned by this function will only contain a value if the node was an instance of /// \detail This function has 'permissive' retrieval semantics; some value types are allowed
/// toml::value with the same value type as the template argument. Additionally, some type are allowed to /// to convert to others (e.g. retrieving a boolean as an integer), and the specified return value
/// convert to each other, for instance asking for an integer when the value exists as a double, /// type can be any type where a reasonable conversion from a native TOML value exists
/// or requesting a string value as a string_view: \cpp /// (e.g. std::wstring on Windows). If the source value cannot be represented by
/// the destination type, an empty optional is returned.
///
/// \cpp
/// auto tbl = toml::parse(R"( /// auto tbl = toml::parse(R"(
/// int_val = 10 /// int = -10
/// float_val = 25.6 /// flt = 25.0
/// string_val = "kek" /// pi = 3.14159
/// bool = false
/// huge = 9223372036854775807
/// str = "foo"
/// )"sv); /// )"sv);
/// ///
/// if (auto val = tbl.get("int_val"sv)->value<int64_t>()) /// const auto print_value_with_typename =
/// std::cout << "'int_val' as int64_t: "sv << *val << std::endl; /// [&](std::string_view key, std::string_view type_name, auto* dummy)
/// /// {
/// if (auto val = tbl.get("int_val"sv)->value<double>()) /// std::cout << "'" << key << "' as " << type_name << ": ";
/// std::cout << "'int_val' as double: "sv << *val << std::endl; /// using type = std::remove_pointer_t<decltype(dummy)>;
/// /// if (std::optional<type> val = tbl.get(key)->value<type>())
/// if (auto val = tbl.get("float_val"sv)->value<int64_t>()) /// std::cout << *val << "\n";
/// std::cout << "'float_val' as int64_t: "sv << *val << std::endl; /// else
/// /// std::cout << "No conversion path or out-of-range\n";
/// if (auto val = tbl.get("float_val"sv)->value<double>()) /// };
/// std::cout << "'float_val' as double: "sv << *val << std::endl; ///
/// /// #define print_value(key, T) print_value_with_typename(key, #T, (T*)nullptr)
/// if (auto val = tbl.get("string_val"sv)->value<std::string>()) ///
/// std::cout << "'string_val' as std::string: "sv << *val << std::endl; /// print_value("int", bool);
/// /// print_value("int", int);
/// if (auto val = tbl.get("string_val"sv)->value<std::string_view>()) /// print_value("int", unsigned int);
/// std::cout << "'string_val' as std::string_view: "sv << *val << std::endl; /// print_value("int", long long);
/// /// print_value("int", float);
/// if (auto val = tbl.get("string_val"sv)->value<int64_t>()) /// print_value("int", double);
/// std::cout << "this line won't be printed because string_val wasn't an int."sv << std::endl; /// std::cout << "\n";
///
/// print_value("flt", bool);
/// print_value("flt", int);
/// print_value("flt", unsigned int);
/// print_value("flt", long long);
/// print_value("flt", float);
/// print_value("flt", double);
/// std::cout << "\n";
///
/// print_value("pi", bool);
/// print_value("pi", int);
/// print_value("pi", unsigned int);
/// print_value("pi", long long);
/// print_value("pi", float);
/// print_value("pi", double);
/// std::cout << "\n";
///
/// print_value("bool", bool);
/// print_value("bool", int);
/// print_value("bool", unsigned int);
/// print_value("bool", long long);
/// print_value("bool", float);
/// print_value("bool", double);
/// std::cout << "\n";
///
/// print_value("huge", bool);
/// print_value("huge", int);
/// print_value("huge", unsigned int);
/// print_value("huge", long long);
/// print_value("huge", float);
/// print_value("huge", double);
/// std::cout << "\n";
///
/// print_value("str", std::string);
/// print_value("str", std::string_view);
/// print_value("str", const char*);
/// std::cout << "\n";
/// \ecpp /// \ecpp
/// ///
/// \out /// \out
/// 'int_val' as int64_t: 10 /// 'int' as bool: true
/// 'int_val' as double: 10 /// 'int' as int: -10
/// 'float_val' as int64_t: 25 /// 'int' as unsigned int: No conversion path or out-of-range
/// 'float_val' as double: 25.6 /// 'int' as long long: -10
/// 'string_val' as std::string: kek /// 'int' as float: -10
/// 'string_val' as std::string_view: kek /// 'int' as double: -10
///
/// 'flt' as bool: No conversion path or out-of-range
/// 'flt' as int: 25
/// 'flt' as unsigned int: 25
/// 'flt' as long long: 25
/// 'flt' as float: 25
/// 'flt' as double: 25
///
/// 'pi' as bool: No conversion path or out-of-range
/// 'pi' as int: No conversion path or out-of-range
/// 'pi' as unsigned int: No conversion path or out-of-range
/// 'pi' as long long: No conversion path or out-of-range
/// 'pi' as float: 3.14159
/// 'pi' as double: 3.14159
///
/// 'bool' as bool: false
/// 'bool' as int: 0
/// 'bool' as unsigned int: 0
/// 'bool' as long long: 0
/// 'bool' as float: No conversion path or out-of-range
/// 'bool' as double: No conversion path or out-of-range
///
/// 'huge' as bool: true
/// 'huge' as int: No conversion path or out-of-range
/// 'huge' as unsigned int: No conversion path or out-of-range
/// 'huge' as long long: 9223372036854775807
/// 'huge' as float: No conversion path or out-of-range
/// 'huge' as double: No conversion path or out-of-range
///
/// 'str' as std::string: foo
/// 'str' as std::string_view: foo
/// 'str' as const char*: foo
/// \eout /// \eout
/// ///
/// \tparam T One of the TOML value types. Can also be a string_view. /// \tparam T One of the native TOML value types, or a type capable of converting to one.
/// ///
/// \returns The underlying value if the node was a value of the matching type (or convertible to it), or an empty optional. /// \returns The underlying value if the node was a value of the matching type (or convertible to it)
/// and within the range of the output type, or an empty optional.
///
/// \attention If you want strict value retrieval semantics that do not allow for any type conversions,
/// use node::value_exact() instead.
///
/// \see node::value_exact()
template <typename T> template <typename T>
[[nodiscard]] [[nodiscard]]
optional<T> value() const noexcept; optional<T> value() const noexcept;
/// \brief Gets the raw value contained by this node, or a default. /// \brief Gets the raw value contained by this node, or a default.
/// ///
/// \tparam T Default value type. Must be (or be promotable to) one of the TOML value types. /// \tparam T Default value type. Must be one of the native TOML value types,
/// or convertible to it.
/// \param default_value The default value to return if the node wasn't a value, wasn't the /// \param default_value The default value to return if the node wasn't a value, wasn't the
/// correct type, or no conversion was possible. /// correct type, or no conversion was possible.
/// ///
/// \returns The node's underlying value, or the default if the node wasn't a value, wasn't the /// \returns The underlying value if the node was a value of the matching type (or convertible to it)
/// correct type, or no conversion was possible. /// and within the range of the output type, or the provided default.
/// ///
/// \see node::value() /// \attention This function has the same permissive retrieval semantics as node::value(). If you want strict
/// value retrieval semantics that do not allow for any type conversions, use node::value_exact()
/// instead.
///
/// \see
/// - node::value()
/// - node::value_exact()
template <typename T> template <typename T>
[[nodiscard]] [[nodiscard]]
auto value_or(T&& default_value) const noexcept; auto value_or(T&& default_value) const noexcept;
@ -285,14 +381,14 @@ namespace toml
{ {
using type = impl::unwrap_node<T>; using type = impl::unwrap_node<T>;
static_assert( static_assert(
impl::is_native<type> || impl::is_one_of<type, table, array>, (impl::is_native<type> || impl::is_one_of<type, table, array>) && !impl::is_cvref<type>,
"The template type argument of node::as() must be one of the following:" "The template type argument of node::as() must be one of the following:"
TOML_UNWRAPPED_NODE_TYPE_LIST TOML_UNWRAPPED_NODE_TYPE_LIST
); );
if constexpr (std::is_same_v<type, table>) return as_table(); if constexpr (std::is_same_v<type, table>) return as_table();
else if constexpr (std::is_same_v<type, array>) return as_array(); else if constexpr (std::is_same_v<type, array>) return as_array();
else if constexpr (std::is_same_v<type, string>) return as_string(); else if constexpr (std::is_same_v<type, std::string>) return as_string();
else if constexpr (std::is_same_v<type, int64_t>) return as_integer(); else if constexpr (std::is_same_v<type, int64_t>) return as_integer();
else if constexpr (std::is_same_v<type, double>) return as_floating_point(); else if constexpr (std::is_same_v<type, double>) return as_floating_point();
else if constexpr (std::is_same_v<type, bool>) return as_boolean(); else if constexpr (std::is_same_v<type, bool>) return as_boolean();
@ -308,14 +404,14 @@ namespace toml
{ {
using type = impl::unwrap_node<T>; using type = impl::unwrap_node<T>;
static_assert( static_assert(
impl::is_native<type> || impl::is_one_of<type, table, array>, (impl::is_native<type> || impl::is_one_of<type, table, array>) && !impl::is_cvref<type>,
"The template type argument of node::as() must be one of the following:" "The template type argument of node::as() must be one of the following:"
TOML_UNWRAPPED_NODE_TYPE_LIST TOML_UNWRAPPED_NODE_TYPE_LIST
); );
if constexpr (std::is_same_v<type, table>) return as_table(); if constexpr (std::is_same_v<type, table>) return as_table();
else if constexpr (std::is_same_v<type, array>) return as_array(); else if constexpr (std::is_same_v<type, array>) return as_array();
else if constexpr (std::is_same_v<type, string>) return as_string(); else if constexpr (std::is_same_v<type, std::string>) return as_string();
else if constexpr (std::is_same_v<type, int64_t>) return as_integer(); else if constexpr (std::is_same_v<type, int64_t>) return as_integer();
else if constexpr (std::is_same_v<type, double>) return as_floating_point(); else if constexpr (std::is_same_v<type, double>) return as_floating_point();
else if constexpr (std::is_same_v<type, bool>) return as_boolean(); else if constexpr (std::is_same_v<type, bool>) return as_boolean();
@ -336,7 +432,7 @@ namespace toml
static constexpr bool can_visit_any = static constexpr bool can_visit_any =
can_visit<Func, N, table> can_visit<Func, N, table>
|| can_visit<Func, N, array> || can_visit<Func, N, array>
|| can_visit<Func, N, string> || can_visit<Func, N, std::string>
|| can_visit<Func, N, int64_t> || can_visit<Func, N, int64_t>
|| can_visit<Func, N, double> || can_visit<Func, N, double>
|| can_visit<Func, N, bool> || can_visit<Func, N, bool>
@ -348,7 +444,7 @@ namespace toml
static constexpr bool can_visit_all = static constexpr bool can_visit_all =
can_visit<Func, N, table> can_visit<Func, N, table>
&& can_visit<Func, N, array> && can_visit<Func, N, array>
&& can_visit<Func, N, string> && can_visit<Func, N, std::string>
&& can_visit<Func, N, int64_t> && can_visit<Func, N, int64_t>
&& can_visit<Func, N, double> && can_visit<Func, N, double>
&& can_visit<Func, N, bool> && can_visit<Func, N, bool>
@ -365,7 +461,7 @@ namespace toml
static constexpr bool visit_is_nothrow = static constexpr bool visit_is_nothrow =
visit_is_nothrow_one<Func, N, table> visit_is_nothrow_one<Func, N, table>
&& visit_is_nothrow_one<Func, N, array> && visit_is_nothrow_one<Func, N, array>
&& visit_is_nothrow_one<Func, N, string> && visit_is_nothrow_one<Func, N, std::string>
&& visit_is_nothrow_one<Func, N, int64_t> && visit_is_nothrow_one<Func, N, int64_t>
&& visit_is_nothrow_one<Func, N, double> && visit_is_nothrow_one<Func, N, double>
&& visit_is_nothrow_one<Func, N, bool> && visit_is_nothrow_one<Func, N, bool>
@ -413,8 +509,8 @@ namespace toml
break; break;
case node_type::string: case node_type::string:
if constexpr (can_visit<Func&&, N&&, string>) if constexpr (can_visit<Func&&, N&&, std::string>)
return std::forward<Func>(visitor)(std::forward<N>(n).template ref_cast<string>()); return std::forward<Func>(visitor)(std::forward<N>(n).template ref_cast<std::string>());
break; break;
case node_type::integer: case node_type::integer:
@ -458,7 +554,7 @@ namespace toml
using return_type = using return_type =
nonvoid<typename visit_return_type<Func&&, N&&, table>::type, nonvoid<typename visit_return_type<Func&&, N&&, table>::type,
nonvoid<typename visit_return_type<Func&&, N&&, array>::type, nonvoid<typename visit_return_type<Func&&, N&&, array>::type,
nonvoid<typename visit_return_type<Func&&, N&&, string>::type, nonvoid<typename visit_return_type<Func&&, N&&, std::string>::type,
nonvoid<typename visit_return_type<Func&&, N&&, int64_t>::type, nonvoid<typename visit_return_type<Func&&, N&&, int64_t>::type,
nonvoid<typename visit_return_type<Func&&, N&&, double>::type, nonvoid<typename visit_return_type<Func&&, N&&, double>::type,
nonvoid<typename visit_return_type<Func&&, N&&, bool>::type, nonvoid<typename visit_return_type<Func&&, N&&, bool>::type,
@ -485,7 +581,7 @@ namespace toml
{ {
using type = impl::unwrap_node<T>; using type = impl::unwrap_node<T>;
static_assert( static_assert(
impl::is_native<type> || impl::is_one_of<type, table, array>, (impl::is_native<type> || impl::is_one_of<type, table, array>) && !impl::is_cvref<type>,
"The template type argument of node::ref() must be one of the following:" "The template type argument of node::ref() must be one of the following:"
TOML_UNWRAPPED_NODE_TYPE_LIST TOML_UNWRAPPED_NODE_TYPE_LIST
); );
@ -511,7 +607,7 @@ namespace toml
/// node.visit([](auto&& n) /// node.visit([](auto&& n)
/// { /// {
/// if constexpr (toml::is_string<decltype(n)>) /// if constexpr (toml::is_string<decltype(n)>)
/// do_something_with_a_string(*n)); //n is a toml::value<toml::string> /// do_something_with_a_string(*n)); //n is a toml::value<std::string>
/// else if constexpr (toml::is_integer<decltype(n)>) /// else if constexpr (toml::is_integer<decltype(n)>)
/// do_something_with_an_int(*n); //n is a toml::value<int64_t> /// do_something_with_an_int(*n); //n is a toml::value<int64_t>
/// else /// else
@ -530,21 +626,24 @@ namespace toml
/// ///
/// \see https://en.wikipedia.org/wiki/Visitor_pattern /// \see https://en.wikipedia.org/wiki/Visitor_pattern
template <typename Func> template <typename Func>
decltype(auto) visit(Func&& visitor) & noexcept(visit_is_nothrow<Func&&, node&>) decltype(auto) visit(Func&& visitor) &
noexcept(visit_is_nothrow<Func&&, node&>)
{ {
return do_visit(*this, std::forward<Func>(visitor)); return do_visit(*this, std::forward<Func>(visitor));
} }
/// \brief Invokes a visitor on the node based on the node's concrete type (rvalue overload). /// \brief Invokes a visitor on the node based on the node's concrete type (rvalue overload).
template <typename Func> template <typename Func>
decltype(auto) visit(Func&& visitor) && noexcept(visit_is_nothrow<Func&&, node&&>) decltype(auto) visit(Func&& visitor) &&
noexcept(visit_is_nothrow<Func&&, node&&>)
{ {
return do_visit(std::move(*this), std::forward<Func>(visitor)); return do_visit(std::move(*this), std::forward<Func>(visitor));
} }
/// \brief Invokes a visitor on the node based on the node's concrete type (const lvalue overload). /// \brief Invokes a visitor on the node based on the node's concrete type (const lvalue overload).
template <typename Func> template <typename Func>
decltype(auto) visit(Func&& visitor) const& noexcept(visit_is_nothrow<Func&&, const node&>) decltype(auto) visit(Func&& visitor) const&
noexcept(visit_is_nothrow<Func&&, const node&>)
{ {
return do_visit(*this, std::forward<Func>(visitor)); return do_visit(*this, std::forward<Func>(visitor));
} }
@ -591,6 +690,8 @@ namespace toml
return do_ref<T>(*this); return do_ref<T>(*this);
} }
}; };
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS //TOML_DISABLE_VTABLE_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_MISC_WARNINGS

View File

@ -18,6 +18,8 @@ TOML_DISABLE_SUGGEST_WARNINGS
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
node::node(node && other) noexcept node::node(node && other) noexcept
: source_{ std::move(other.source_) } : source_{ std::move(other.source_) }
@ -49,7 +51,7 @@ namespace toml
TOML_MEMBER_ATTR(const) table* node::as_table() noexcept { return nullptr; } TOML_MEMBER_ATTR(const) table* node::as_table() noexcept { return nullptr; }
TOML_MEMBER_ATTR(const) array* node::as_array() noexcept { return nullptr; } TOML_MEMBER_ATTR(const) array* node::as_array() noexcept { return nullptr; }
TOML_MEMBER_ATTR(const) value<string>* node::as_string() noexcept { return nullptr; } TOML_MEMBER_ATTR(const) value<std::string>* node::as_string() noexcept { return nullptr; }
TOML_MEMBER_ATTR(const) value<int64_t>* node::as_integer() noexcept { return nullptr; } TOML_MEMBER_ATTR(const) value<int64_t>* node::as_integer() noexcept { return nullptr; }
TOML_MEMBER_ATTR(const) value<double>* node::as_floating_point() noexcept { return nullptr; } TOML_MEMBER_ATTR(const) value<double>* node::as_floating_point() noexcept { return nullptr; }
TOML_MEMBER_ATTR(const) value<bool>* node::as_boolean() noexcept { return nullptr; } TOML_MEMBER_ATTR(const) value<bool>* node::as_boolean() noexcept { return nullptr; }
@ -59,7 +61,7 @@ namespace toml
TOML_MEMBER_ATTR(const) const table* node::as_table() const noexcept { return nullptr; } TOML_MEMBER_ATTR(const) const table* node::as_table() const noexcept { return nullptr; }
TOML_MEMBER_ATTR(const) const array* node::as_array() const noexcept { return nullptr; } TOML_MEMBER_ATTR(const) const array* node::as_array() const noexcept { return nullptr; }
TOML_MEMBER_ATTR(const) const value<string>* node::as_string() const noexcept { return nullptr; } TOML_MEMBER_ATTR(const) const value<std::string>* node::as_string() const noexcept { return nullptr; }
TOML_MEMBER_ATTR(const) const value<int64_t>* node::as_integer() const noexcept { return nullptr; } TOML_MEMBER_ATTR(const) const value<int64_t>* node::as_integer() const noexcept { return nullptr; }
TOML_MEMBER_ATTR(const) const value<double>* node::as_floating_point() const noexcept { return nullptr; } TOML_MEMBER_ATTR(const) const value<double>* node::as_floating_point() const noexcept { return nullptr; }
TOML_MEMBER_ATTR(const) const value<bool>* node::as_boolean() const noexcept { return nullptr; } TOML_MEMBER_ATTR(const) const value<bool>* node::as_boolean() const noexcept { return nullptr; }
@ -70,6 +72,8 @@ namespace toml
TOML_MEMBER_ATTR(const) const source_region& node::source() const noexcept { return source_; } TOML_MEMBER_ATTR(const) const source_region& node::source() const noexcept { return source_; }
#undef TOML_MEMBER_ATTR #undef TOML_MEMBER_ATTR
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS // TOML_DISABLE_SUGGEST_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_SUGGEST_WARNINGS

View File

@ -8,10 +8,12 @@
#include "toml_array.h" #include "toml_array.h"
#include "toml_value.h" #include "toml_value.h"
TOML_PUSH_WARNINGS
TOML_DISABLE_ARITHMETIC_WARNINGS
namespace toml namespace toml
{ {
TOML_PUSH_WARNINGS TOML_ABI_NAMESPACE_VERSION
TOML_DISABLE_FLOAT_WARNINGS
template <typename Char, typename T> template <typename Char, typename T>
inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>&, const node_view<T>&); inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>&, const node_view<T>&);
@ -59,15 +61,15 @@ namespace toml
/// has product[2]: false /// has product[2]: false
/// product[2]: /// product[2]:
/// \eout /// \eout
template <typename T> template <typename ViewedType>
class TOML_API TOML_TRIVIAL_ABI node_view class TOML_API TOML_TRIVIAL_ABI node_view
{ {
public: public:
using viewed_type = T; using viewed_type = ViewedType;
private: private:
friend class toml::table; friend class toml::table;
template <typename U> friend class toml::node_view; template <typename T> friend class toml::node_view;
mutable viewed_type* node_ = nullptr; mutable viewed_type* node_ = nullptr;
@ -124,30 +126,30 @@ namespace toml
/// \brief Checks if this view references a node of a specific type. /// \brief Checks if this view references a node of a specific type.
/// ///
/// \tparam U A TOML node or value type. /// \tparam T A TOML node or value type.
/// ///
/// \returns Returns true if the viewed node is an instance of the specified type. /// \returns Returns true if the viewed node is an instance of the specified type.
/// ///
/// \see toml::node::is() /// \see toml::node::is()
template <typename U> template <typename T>
[[nodiscard]] [[nodiscard]]
bool is() const noexcept bool is() const noexcept
{ {
return node_ ? node_->template is<U>() : false; return node_ ? node_->template is<T>() : false;
} }
/// \brief Gets a pointer to the viewed node as a more specific node type. /// \brief Gets a pointer to the viewed node as a more specific node type.
/// ///
/// \tparam U The node type or TOML value type to cast to. /// \tparam T The node type or TOML value type to cast to.
/// ///
/// \returns A pointer to the node as the given type, or nullptr if it was a different type. /// \returns A pointer to the node as the given type, or nullptr if it was a different type.
/// ///
/// \see toml::node::as() /// \see toml::node::as()
template <typename U> template <typename T>
[[nodiscard]] [[nodiscard]]
auto as() const noexcept auto as() const noexcept
{ {
using type = impl::unwrap_node<U>; using type = impl::unwrap_node<T>;
static_assert( static_assert(
impl::is_native<type> || impl::is_one_of<type, table, array>, impl::is_native<type> || impl::is_one_of<type, table, array>,
"Template type parameter must be one of the following:" "Template type parameter must be one of the following:"
@ -162,7 +164,7 @@ namespace toml
/// \brief Returns a pointer to the viewed node as a toml::array, if it is one. /// \brief Returns a pointer to the viewed node as a toml::array, if it is one.
[[nodiscard]] auto as_array() const noexcept { return as<array>(); } [[nodiscard]] auto as_array() const noexcept { return as<array>(); }
/// \brief Returns a pointer to the viewed node as a toml::value<string>, if it is one. /// \brief Returns a pointer to the viewed node as a toml::value<string>, if it is one.
[[nodiscard]] auto as_string() const noexcept { return as<string>(); } [[nodiscard]] auto as_string() const noexcept { return as<std::string>(); }
/// \brief Returns a pointer to the viewed node as a toml::value<int64_t>, if it is one. /// \brief Returns a pointer to the viewed node as a toml::value<int64_t>, if it is one.
[[nodiscard]] auto as_integer() const noexcept { return as<int64_t>(); } [[nodiscard]] auto as_integer() const noexcept { return as<int64_t>(); }
/// \brief Returns a pointer to the viewed node as a toml::value<double>, if it is one. /// \brief Returns a pointer to the viewed node as a toml::value<double>, if it is one.
@ -176,31 +178,55 @@ namespace toml
/// \brief Returns a pointer to the viewed node as a toml::value<date_time>, if it is one. /// \brief Returns a pointer to the viewed node as a toml::value<date_time>, if it is one.
[[nodiscard]] auto as_date_time() const noexcept { return as<date_time>(); } [[nodiscard]] auto as_date_time() const noexcept { return as<date_time>(); }
template <typename U> /// \brief Gets the value contained by the referenced node.
///
/// \detail This function has 'exact' retrieval semantics; the only return value types allowed are the
/// TOML native value types, or types that can losslessly represent a native value type (e.g.
/// std::wstring on Windows).
///
/// \tparam T One of the native TOML value types, or a type capable of losslessly representing one.
///
/// \returns The underlying value if the node was a value of the
/// matching type (or losslessly convertible to it), or an empty optional.
///
/// \see node_view::value()
template <typename T>
[[nodiscard]] [[nodiscard]]
optional<U> value_exact() const noexcept optional<T> value_exact() const noexcept
{ {
if (node_) if (node_)
return node_->template value_exact<U>(); return node_->template value_exact<T>();
return {}; return {};
} }
TOML_PUSH_WARNINGS TOML_PUSH_WARNINGS
TOML_DISABLE_INIT_WARNINGS TOML_DISABLE_INIT_WARNINGS
/// \brief Gets the raw value contained by the referenced node. /// \brief Gets the value contained by the referenced node.
/// ///
/// \tparam U One of the TOML value types. Can also be a string_view. /// \detail This function has 'permissive' retrieval semantics; some value types are allowed
/// to convert to others (e.g. retrieving a boolean as an integer), and the specified return value
/// type can be any type where a reasonable conversion from a native TOML value exists
/// (e.g. std::wstring on Windows). If the source value cannot be represented by
/// the destination type, an empty optional is returned. See node::value() for examples.
///
/// \tparam T One of the native TOML value types, or a type capable of convertible to one.
/// ///
/// \returns The underlying value if the node was a value of the matching type (or convertible to it), or an empty optional. /// \returns The underlying value if the node was a value of the matching type (or convertible to it)
/// and within the range of the output type, or an empty optional.
/// ///
/// \see node::value() /// \attention If you want strict value retrieval semantics that do not allow for any type conversions,
template <typename U> /// use node_view::value_exact() instead.
///
/// \see
/// - node_view::value()
/// - node_view::value_exact()
template <typename T>
[[nodiscard]] [[nodiscard]]
optional<U> value() const noexcept optional<T> value() const noexcept
{ {
if (node_) if (node_)
return node_->template value<U>(); return node_->template value<T>();
return {}; return {};
} }
@ -208,53 +234,61 @@ namespace toml
/// \brief Gets the raw value contained by the referenced node, or a default. /// \brief Gets the raw value contained by the referenced node, or a default.
/// ///
/// \tparam U Default value type. Must be (or be promotable to) one of the TOML value types. /// \tparam T Default value type. Must be one of the native TOML value types,
/// \param default_value The default value to return if the view did not reference a node, /// or convertible to it.
/// or if the node wasn't a value, wasn't the correct type, or no conversion was possible. /// \param default_value The default value to return if the node wasn't a value, wasn't the
/// correct type, or no conversion was possible.
/// ///
/// \returns The node's underlying value, or the default if the node wasn't a value, wasn't the /// \returns The underlying value if the node was a value of the matching type (or convertible to it)
/// correct type, or no conversion was possible. /// and within the range of the output type, or the provided default.
/// ///
/// \see node::value_or() /// \attention This function has the same permissive retrieval semantics as node::value(). If you want strict
template <typename U> /// value retrieval semantics that do not allow for any type conversions, use node_view::value_exact()
/// instead.
///
/// \see
/// - node_view::value()
/// - node_view::value_exact()
template <typename T>
[[nodiscard]] [[nodiscard]]
auto value_or(U&& default_value) const noexcept auto value_or(T&& default_value) const noexcept
{ {
using namespace ::toml::impl; using namespace ::toml::impl;
static_assert( static_assert(
!is_wide_string<U> || TOML_WINDOWS_COMPAT, !is_wide_string<T> || TOML_WINDOWS_COMPAT,
"Retrieving values as wide-character strings is only supported on Windows with TOML_WINDOWS_COMPAT enabled." "Retrieving values as wide-character strings is only "
"supported on Windows with TOML_WINDOWS_COMPAT enabled."
); );
if constexpr (is_wide_string<U>) if constexpr (is_wide_string<T>)
{ {
#if TOML_WINDOWS_COMPAT #if TOML_WINDOWS_COMPAT
if (node_) if (node_)
return node_->value_or(std::forward<U>(default_value)); return node_->value_or(std::forward<T>(default_value));
return std::wstring{ std::forward<U>(default_value) }; return std::wstring{ std::forward<T>(default_value) };
#else #else
static_assert(impl::dependent_false<U>, "Evaluated unreachable branch!"); static_assert(impl::dependent_false<T>, "Evaluated unreachable branch!");
#endif #endif
} }
else else
{ {
using value_type = std::conditional_t< using value_type = std::conditional_t<
std::is_pointer_v<std::decay_t<U>>, std::is_pointer_v<std::decay_t<T>>,
std::add_pointer_t<std::add_const_t<std::remove_pointer_t<std::decay_t<U>>>>, std::add_pointer_t<std::add_const_t<std::remove_pointer_t<std::decay_t<T>>>>,
std::decay_t<U> std::decay_t<T>
>; >;
if (node_) if (node_)
return node_->value_or(std::forward<U>(default_value)); return node_->value_or(std::forward<T>(default_value));
if constexpr (std::is_pointer_v<value_type>) if constexpr (std::is_pointer_v<value_type>)
return value_type{ default_value }; return value_type{ default_value };
else else
return std::forward<U>(default_value); return std::forward<T>(default_value);
} }
} }
@ -291,13 +325,14 @@ namespace toml
/// ///
/// \ecpp /// \ecpp
/// ///
/// \tparam U One of the TOML value types. /// \tparam T One of the TOML value types.
/// ///
/// \returns A reference to the underlying data. /// \returns A reference to the underlying data.
template <typename U> template <typename T>
[[nodiscard]] decltype(auto) ref() const noexcept [[nodiscard]]
decltype(auto) ref() const noexcept
{ {
using type = impl::unwrap_node<U>; using type = impl::unwrap_node<T>;
static_assert( static_assert(
impl::is_native<type> || impl::is_one_of<type, table, array>, impl::is_native<type> || impl::is_one_of<type, table, array>,
"Template type parameter must be one of the following:" "Template type parameter must be one of the following:"
@ -311,7 +346,8 @@ namespace toml
} }
/// \brief Returns true if the viewed node is a table with the same contents as RHS. /// \brief Returns true if the viewed node is a table with the same contents as RHS.
[[nodiscard]] friend bool operator == (const node_view& lhs, const table& rhs) noexcept [[nodiscard]]
friend bool operator == (const node_view& lhs, const table& rhs) noexcept
{ {
if (lhs.node_ == &rhs) if (lhs.node_ == &rhs)
return true; return true;
@ -321,7 +357,8 @@ namespace toml
TOML_ASYMMETRICAL_EQUALITY_OPS(const node_view&, const table&, ) TOML_ASYMMETRICAL_EQUALITY_OPS(const node_view&, const table&, )
/// \brief Returns true if the viewed node is an array with the same contents as RHS. /// \brief Returns true if the viewed node is an array with the same contents as RHS.
[[nodiscard]] friend bool operator == (const node_view& lhs, const array& rhs) noexcept [[nodiscard]]
friend bool operator == (const node_view& lhs, const array& rhs) noexcept
{ {
if (lhs.node_ == &rhs) if (lhs.node_ == &rhs)
return true; return true;
@ -331,68 +368,73 @@ namespace toml
TOML_ASYMMETRICAL_EQUALITY_OPS(const node_view&, const array&, ) TOML_ASYMMETRICAL_EQUALITY_OPS(const node_view&, const array&, )
/// \brief Returns true if the viewed node is a value with the same value as RHS. /// \brief Returns true if the viewed node is a value with the same value as RHS.
template <typename U> template <typename T>
[[nodiscard]] friend bool operator == (const node_view& lhs, const toml::value<U>& rhs) noexcept [[nodiscard]]
friend bool operator == (const node_view& lhs, const toml::value<T>& rhs) noexcept
{ {
if (lhs.node_ == &rhs) if (lhs.node_ == &rhs)
return true; return true;
const auto val = lhs.as<U>(); const auto val = lhs.as<T>();
return val && *val == rhs; return val && *val == rhs;
} }
TOML_ASYMMETRICAL_EQUALITY_OPS(const node_view&, const toml::value<U>&, template <typename U>) TOML_ASYMMETRICAL_EQUALITY_OPS(const node_view&, const toml::value<T>&, template <typename T>)
/// \brief Returns true if the viewed node is a value with the same value as RHS. /// \brief Returns true if the viewed node is a value with the same value as RHS.
template <typename U, typename = std::enable_if_t< template <typename T, typename = std::enable_if_t<
impl::is_native<U> impl::is_native<T>
|| impl::is_losslessly_convertible_to_native<U> || impl::is_losslessly_convertible_to_native<T>
>> >>
[[nodiscard]] friend bool operator == (const node_view& lhs, const U& rhs) noexcept [[nodiscard]]
friend bool operator == (const node_view& lhs, const T& rhs) noexcept
{ {
static_assert( static_assert(
!impl::is_wide_string<U> || TOML_WINDOWS_COMPAT, !impl::is_wide_string<T> || TOML_WINDOWS_COMPAT,
"Comparison with wide-character strings is only supported on Windows with TOML_WINDOWS_COMPAT enabled." "Comparison with wide-character strings is only "
"supported on Windows with TOML_WINDOWS_COMPAT enabled."
); );
if constexpr (impl::is_wide_string<U>) if constexpr (impl::is_wide_string<T>)
{ {
#if TOML_WINDOWS_COMPAT #if TOML_WINDOWS_COMPAT
return lhs == impl::narrow(rhs); return lhs == impl::narrow(rhs);
#else #else
static_assert(impl::dependent_false<U>, "Evaluated unreachable branch!"); static_assert(impl::dependent_false<T>, "Evaluated unreachable branch!");
#endif #endif
} }
else else
{ {
const auto val = lhs.as<impl::native_type_of<U>>(); const auto val = lhs.as<impl::native_type_of<T>>();
return val && *val == rhs; return val && *val == rhs;
} }
} }
TOML_ASYMMETRICAL_EQUALITY_OPS( TOML_ASYMMETRICAL_EQUALITY_OPS(
const node_view&, const node_view&,
const U&, const T&,
template <typename U, typename = std::enable_if_t< template <typename T, typename = std::enable_if_t<
impl::is_native<U> impl::is_native<T>
|| impl::is_losslessly_convertible_to_native<U> || impl::is_losslessly_convertible_to_native<T>
>> >>
) )
/// \brief Returns true if the viewed node is an array with the same contents as the RHS initializer list. /// \brief Returns true if the viewed node is an array with the same contents as the RHS initializer list.
template <typename U> template <typename T>
[[nodiscard]] friend bool operator == (const node_view& lhs, const std::initializer_list<U>& rhs) noexcept [[nodiscard]]
friend bool operator == (const node_view& lhs, const std::initializer_list<T>& rhs) noexcept
{ {
const auto arr = lhs.as<array>(); const auto arr = lhs.as<array>();
return arr && *arr == rhs; return arr && *arr == rhs;
} }
TOML_ASYMMETRICAL_EQUALITY_OPS(const node_view&, const std::initializer_list<U>&, template <typename U>) TOML_ASYMMETRICAL_EQUALITY_OPS(const node_view&, const std::initializer_list<T>&, template <typename T>)
/// \brief Returns true if the viewed node is an array with the same contents as the RHS vector. /// \brief Returns true if the viewed node is an array with the same contents as the RHS vector.
template <typename U> template <typename T>
[[nodiscard]] friend bool operator == (const node_view& lhs, const std::vector<U>& rhs) noexcept [[nodiscard]]
friend bool operator == (const node_view& lhs, const std::vector<T>& rhs) noexcept
{ {
const auto arr = lhs.as<array>(); const auto arr = lhs.as<array>();
return arr && *arr == rhs; return arr && *arr == rhs;
} }
TOML_ASYMMETRICAL_EQUALITY_OPS(const node_view&, const std::vector<U>&, template <typename U>) TOML_ASYMMETRICAL_EQUALITY_OPS(const node_view&, const std::vector<T>&, template <typename T>)
/// \brief Returns a view of the selected subnode. /// \brief Returns a view of the selected subnode.
/// ///
@ -400,7 +442,8 @@ namespace toml
/// ///
/// \returns A view of the selected node if this node represented a table and it contained a /// \returns A view of the selected node if this node represented a table and it contained a
/// value at the given key, or an empty view. /// value at the given key, or an empty view.
[[nodiscard]] node_view operator[] (string_view key) const noexcept [[nodiscard]]
node_view operator[] (std::string_view key) const noexcept
{ {
if (auto tbl = this->as_table()) if (auto tbl = this->as_table())
return { tbl->get(key) }; return { tbl->get(key) };
@ -417,7 +460,8 @@ namespace toml
/// value at the given key, or an empty view. /// value at the given key, or an empty view.
/// ///
/// \attention This overload is only available when #TOML_WINDOWS_COMPAT is enabled. /// \attention This overload is only available when #TOML_WINDOWS_COMPAT is enabled.
[[nodiscard]] node_view operator[] (std::wstring_view key) const noexcept [[nodiscard]]
node_view operator[] (std::wstring_view key) const noexcept
{ {
if (auto tbl = this->as_table()) if (auto tbl = this->as_table())
return { tbl->get(key) }; return { tbl->get(key) };
@ -432,21 +476,21 @@ namespace toml
/// ///
/// \returns A view of the selected node if this node represented an array and it contained a /// \returns A view of the selected node if this node represented an array and it contained a
/// value at the given index, or an empty view. /// value at the given index, or an empty view.
[[nodiscard]] node_view operator[] (size_t index) const noexcept [[nodiscard]]
node_view operator[] (size_t index) const noexcept
{ {
if (auto arr = this->as_array()) if (auto arr = this->as_array())
return { arr->get(index) }; return { arr->get(index) };
return { nullptr }; return { nullptr };
} }
template <typename Char, typename U> template <typename Char, typename T>
friend std::basic_ostream<Char>& operator << (std::basic_ostream<Char>&, const node_view<U>&); friend std::basic_ostream<Char>& operator << (std::basic_ostream<Char>&, const node_view<T>&);
}; };
/// \brief Prints the viewed node out to a stream. /// \brief Prints the viewed node out to a stream.
template <typename Char, typename T> template <typename Char, typename T>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& os, const node_view<T>& nv)
std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& os, const node_view<T>& nv)
{ {
if (nv.node_) if (nv.node_)
{ {
@ -459,12 +503,61 @@ namespace toml
} }
#if !TOML_ALL_INLINE #if !TOML_ALL_INLINE
extern template class TOML_API node_view<node>;
extern template class TOML_API node_view<const node>;
extern template TOML_API std::ostream& operator << (std::ostream&, const node_view<node>&);
extern template TOML_API std::ostream& operator << (std::ostream&, const node_view<const node>&);
#endif
TOML_POP_WARNINGS // TOML_DISABLE_FLOAT_WARNINGS extern template class TOML_API node_view<node>;
extern template class TOML_API node_view<const node>;
extern template TOML_API std::ostream& operator << (std::ostream&, const node_view<node>&);
extern template TOML_API std::ostream& operator << (std::ostream&, const node_view<const node>&);
#define TOML_EXTERN(name, T) \
extern template TOML_API optional<T> node_view<node>::name<T>() const noexcept; \
extern template TOML_API optional<T> node_view<const node>::name<T>() const noexcept
TOML_EXTERN(value_exact, std::string_view);
TOML_EXTERN(value_exact, std::string);
TOML_EXTERN(value_exact, const char*);
TOML_EXTERN(value_exact, int64_t);
TOML_EXTERN(value_exact, double);
TOML_EXTERN(value_exact, date);
TOML_EXTERN(value_exact, time);
TOML_EXTERN(value_exact, date_time);
TOML_EXTERN(value_exact, bool);
TOML_EXTERN(value, std::string_view);
TOML_EXTERN(value, std::string);
TOML_EXTERN(value, const char*);
TOML_EXTERN(value, signed char);
TOML_EXTERN(value, signed short);
TOML_EXTERN(value, signed int);
TOML_EXTERN(value, signed long);
TOML_EXTERN(value, signed long long);
TOML_EXTERN(value, unsigned char);
TOML_EXTERN(value, unsigned short);
TOML_EXTERN(value, unsigned int);
TOML_EXTERN(value, unsigned long);
TOML_EXTERN(value, unsigned long long);
TOML_EXTERN(value, double);
TOML_EXTERN(value, float);
TOML_EXTERN(value, date);
TOML_EXTERN(value, time);
TOML_EXTERN(value, date_time);
TOML_EXTERN(value, bool);
#ifdef __cpp_lib_char8_t
TOML_EXTERN(value_exact, std::u8string_view);
TOML_EXTERN(value_exact, std::u8string);
TOML_EXTERN(value_exact, const char8_t*);
TOML_EXTERN(value, std::u8string_view);
TOML_EXTERN(value, std::u8string);
TOML_EXTERN(value, const char8_t*);
#endif
#if TOML_WINDOWS_COMPAT
TOML_EXTERN(value_exact, std::wstring);
TOML_EXTERN(value, std::wstring);
#endif
#undef TOML_EXTERN
#endif // !TOML_ALL_INLINE
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS // TOML_DISABLE_ARITHMETIC_WARNINGS

View File

@ -19,16 +19,16 @@ TOML_POP_WARNINGS
TOML_PUSH_WARNINGS TOML_PUSH_WARNINGS
TOML_DISABLE_INIT_WARNINGS TOML_DISABLE_INIT_WARNINGS
TOML_DISABLE_VTABLE_WARNINGS TOML_DISABLE_MISC_WARNINGS
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_BOOL(TOML_LARGE_FILES, lf, sf) TOML_ABI_NAMESPACE_VERSION
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, ex, noex)
#if TOML_DOXYGEN || !TOML_EXCEPTIONS #if TOML_DOXYGEN || !TOML_EXCEPTIONS
TOML_ABI_NAMESPACE_START(noex)
/// \brief An error generated when parsing fails. /// \brief An error generated when parsing fails.
/// ///
/// \remarks This class inherits from std::runtime_error when exceptions are enabled. /// \remarks This class inherits from std::runtime_error when exceptions are enabled.
@ -76,8 +76,6 @@ namespace toml
#else #else
TOML_ABI_NAMESPACE_START(ex)
class parse_error final class parse_error final
: public std::runtime_error : public std::runtime_error
{ {
@ -121,7 +119,6 @@ namespace toml
#endif #endif
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
TOML_ABI_NAMESPACE_END // TOML_LARGE_FILES
/// \brief Prints a parse_error to a stream. /// \brief Prints a parse_error to a stream.
/// ///
@ -148,8 +145,7 @@ namespace toml
/// ///
/// \returns The input stream. /// \returns The input stream.
template <typename Char> template <typename Char>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const parse_error& rhs)
std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const parse_error& rhs)
{ {
lhs << rhs.description(); lhs << rhs.description();
lhs << "\n\t(error occurred at "sv; lhs << "\n\t(error occurred at "sv;
@ -161,6 +157,8 @@ namespace toml
#if !TOML_ALL_INLINE #if !TOML_ALL_INLINE
extern template TOML_API std::ostream& operator << (std::ostream&, const parse_error&); extern template TOML_API std::ostream& operator << (std::ostream&, const parse_error&);
#endif #endif
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS TOML_POP_WARNINGS

View File

@ -18,9 +18,11 @@ TOML_DISABLE_PADDING_WARNINGS
namespace toml namespace toml
{ {
#if TOML_DOXYGEN || !TOML_EXCEPTIONS TOML_ABI_NAMESPACE_VERSION
TOML_ABI_NAMESPACE_START(parse_noex) TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, ex, noex)
#if TOML_DOXYGEN || !TOML_EXCEPTIONS
/// \brief The result of a parsing operation. /// \brief The result of a parsing operation.
/// ///
@ -90,38 +92,44 @@ namespace toml
[[nodiscard]] explicit operator bool() const noexcept { return !is_err; } [[nodiscard]] explicit operator bool() const noexcept { return !is_err; }
/// \brief Returns the internal toml::table. /// \brief Returns the internal toml::table.
[[nodiscard]] table& get() & noexcept [[nodiscard]]
table& get() & noexcept
{ {
TOML_ASSERT(!is_err); TOML_ASSERT(!is_err);
return *TOML_LAUNDER(reinterpret_cast<table*>(&storage)); return *TOML_LAUNDER(reinterpret_cast<table*>(&storage));
} }
/// \brief Returns the internal toml::table (rvalue overload). /// \brief Returns the internal toml::table (rvalue overload).
[[nodiscard]] table&& get() && noexcept [[nodiscard]]
table&& get() && noexcept
{ {
TOML_ASSERT(!is_err); TOML_ASSERT(!is_err);
return std::move(*TOML_LAUNDER(reinterpret_cast<table*>(&storage))); return std::move(*TOML_LAUNDER(reinterpret_cast<table*>(&storage)));
} }
/// \brief Returns the internal toml::table (const lvalue overload). /// \brief Returns the internal toml::table (const lvalue overload).
[[nodiscard]] const table& get() const& noexcept [[nodiscard]]
const table& get() const& noexcept
{ {
TOML_ASSERT(!is_err); TOML_ASSERT(!is_err);
return *TOML_LAUNDER(reinterpret_cast<const table*>(&storage)); return *TOML_LAUNDER(reinterpret_cast<const table*>(&storage));
} }
/// \brief Returns the internal toml::parse_error. /// \brief Returns the internal toml::parse_error.
[[nodiscard]] parse_error& error() & noexcept [[nodiscard]]
parse_error& error() & noexcept
{ {
TOML_ASSERT(is_err); TOML_ASSERT(is_err);
return *TOML_LAUNDER(reinterpret_cast<parse_error*>(&storage)); return *TOML_LAUNDER(reinterpret_cast<parse_error*>(&storage));
} }
/// \brief Returns the internal toml::parse_error (rvalue overload). /// \brief Returns the internal toml::parse_error (rvalue overload).
[[nodiscard]] parse_error&& error() && noexcept [[nodiscard]]
parse_error&& error() && noexcept
{ {
TOML_ASSERT(is_err); TOML_ASSERT(is_err);
return std::move(*TOML_LAUNDER(reinterpret_cast<parse_error*>(&storage))); return std::move(*TOML_LAUNDER(reinterpret_cast<parse_error*>(&storage)));
} }
/// \brief Returns the internal toml::parse_error (const lvalue overload). /// \brief Returns the internal toml::parse_error (const lvalue overload).
[[nodiscard]] const parse_error& error() const& noexcept [[nodiscard]]
const parse_error& error() const& noexcept
{ {
TOML_ASSERT(is_err); TOML_ASSERT(is_err);
return *TOML_LAUNDER(reinterpret_cast<const parse_error*>(&storage)); return *TOML_LAUNDER(reinterpret_cast<const parse_error*>(&storage));
@ -202,7 +210,8 @@ namespace toml
/// or an empty node view. /// or an empty node view.
/// ///
/// \see toml::node_view /// \see toml::node_view
[[nodiscard]] node_view<node> operator[] (string_view key) noexcept [[nodiscard]]
node_view<node> operator[] (string_view key) noexcept
{ {
return is_err ? node_view<node>{} : get()[key]; return is_err ? node_view<node>{} : get()[key];
} }
@ -215,7 +224,8 @@ namespace toml
/// or an empty node view. /// or an empty node view.
/// ///
/// \see toml::node_view /// \see toml::node_view
[[nodiscard]] node_view<const node> operator[] (string_view key) const noexcept [[nodiscard]]
node_view<const node> operator[] (string_view key) const noexcept
{ {
return is_err ? node_view<const node>{} : get()[key]; return is_err ? node_view<const node>{} : get()[key];
} }
@ -232,7 +242,8 @@ namespace toml
/// \see toml::node_view /// \see toml::node_view
/// ///
/// \attention This overload is only available when #TOML_WINDOWS_COMPAT is enabled. /// \attention This overload is only available when #TOML_WINDOWS_COMPAT is enabled.
[[nodiscard]] node_view<node> operator[] (std::wstring_view key) noexcept [[nodiscard]]
node_view<node> operator[] (std::wstring_view key) noexcept
{ {
return is_err ? node_view<node>{} : get()[key]; return is_err ? node_view<node>{} : get()[key];
} }
@ -247,7 +258,8 @@ namespace toml
/// \see toml::node_view /// \see toml::node_view
/// ///
/// \attention This overload is only available when #TOML_WINDOWS_COMPAT is enabled. /// \attention This overload is only available when #TOML_WINDOWS_COMPAT is enabled.
[[nodiscard]] node_view<const node> operator[] (std::wstring_view key) const noexcept [[nodiscard]]
node_view<const node> operator[] (std::wstring_view key) const noexcept
{ {
return is_err ? node_view<const node>{} : get()[key]; return is_err ? node_view<const node>{} : get()[key];
} }
@ -256,64 +268,75 @@ namespace toml
/// \brief Returns an iterator to the first key-value pair in the wrapped table. /// \brief Returns an iterator to the first key-value pair in the wrapped table.
/// \remarks Returns a default-constructed 'nothing' iterator if the parsing failed. /// \remarks Returns a default-constructed 'nothing' iterator if the parsing failed.
[[nodiscard]] table_iterator begin() noexcept [[nodiscard]]
table_iterator begin() noexcept
{ {
return is_err ? table_iterator{} : get().begin(); return is_err ? table_iterator{} : get().begin();
} }
/// \brief Returns an iterator to the first key-value pair in the wrapped table. /// \brief Returns an iterator to the first key-value pair in the wrapped table.
/// \remarks Returns a default-constructed 'nothing' iterator if the parsing failed. /// \remarks Returns a default-constructed 'nothing' iterator if the parsing failed.
[[nodiscard]] const_table_iterator begin() const noexcept [[nodiscard]]
const_table_iterator begin() const noexcept
{ {
return is_err ? const_table_iterator{} : get().begin(); return is_err ? const_table_iterator{} : get().begin();
} }
/// \brief Returns an iterator to the first key-value pair in the wrapped table. /// \brief Returns an iterator to the first key-value pair in the wrapped table.
/// \remarks Returns a default-constructed 'nothing' iterator if the parsing failed. /// \remarks Returns a default-constructed 'nothing' iterator if the parsing failed.
[[nodiscard]] const_table_iterator cbegin() const noexcept [[nodiscard]]
const_table_iterator cbegin() const noexcept
{ {
return is_err ? const_table_iterator{} : get().cbegin(); return is_err ? const_table_iterator{} : get().cbegin();
} }
/// \brief Returns an iterator to one-past-the-last key-value pair in the wrapped table. /// \brief Returns an iterator to one-past-the-last key-value pair in the wrapped table.
/// \remarks Returns a default-constructed 'nothing' iterator if the parsing failed. /// \remarks Returns a default-constructed 'nothing' iterator if the parsing failed.
[[nodiscard]] table_iterator end() noexcept [[nodiscard]]
table_iterator end() noexcept
{ {
return is_err ? table_iterator{} : get().end(); return is_err ? table_iterator{} : get().end();
} }
/// \brief Returns an iterator to one-past-the-last key-value pair in the wrapped table. /// \brief Returns an iterator to one-past-the-last key-value pair in the wrapped table.
/// \remarks Returns a default-constructed 'nothing' iterator if the parsing failed. /// \remarks Returns a default-constructed 'nothing' iterator if the parsing failed.
[[nodiscard]] const_table_iterator end() const noexcept [[nodiscard]]
const_table_iterator end() const noexcept
{ {
return is_err ? const_table_iterator{} : get().end(); return is_err ? const_table_iterator{} : get().end();
} }
/// \brief Returns an iterator to one-past-the-last key-value pair in the wrapped table. /// \brief Returns an iterator to one-past-the-last key-value pair in the wrapped table.
/// \remarks Returns a default-constructed 'nothing' iterator if the parsing failed. /// \remarks Returns a default-constructed 'nothing' iterator if the parsing failed.
[[nodiscard]] const_table_iterator cend() const noexcept [[nodiscard]]
const_table_iterator cend() const noexcept
{ {
return is_err ? const_table_iterator{} : get().cend(); return is_err ? const_table_iterator{} : get().cend();
} }
}; };
TOML_ABI_NAMESPACE_END
#else #else
using parse_result = table; using parse_result = table;
#endif #endif
}
namespace toml::impl
{
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, impl_ex, impl_noex)
[[nodiscard]] TOML_API
parse_result do_parse(utf8_reader_interface&&) TOML_MAY_THROW;
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
TOML_ABI_NAMESPACE_END // version
}
namespace toml
{
TOML_IMPL_NAMESPACE_START
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, ex, noex)
[[nodiscard]] TOML_API parse_result do_parse(utf8_reader_interface&&) TOML_MAY_THROW;
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
TOML_IMPL_NAMESPACE_END
} }
#if TOML_EXCEPTIONS #if TOML_EXCEPTIONS
@ -330,7 +353,9 @@ namespace toml::impl
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, parse_ex, parse_noex) TOML_ABI_NAMESPACE_VERSION
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, ex, noex)
/// \brief Parses a TOML document from a string view. /// \brief Parses a TOML document from a string view.
/// ///
@ -516,8 +541,7 @@ namespace toml
/// <strong><em>Without exceptions:</em></strong> A toml::parse_result detailing the parsing outcome. /// <strong><em>Without exceptions:</em></strong> A toml::parse_result detailing the parsing outcome.
template <typename Char> template <typename Char>
[[nodiscard]] [[nodiscard]]
TOML_EXTERNAL_LINKAGE inline parse_result parse(std::basic_istream<Char>& doc, std::string_view source_path = {}) TOML_MAY_THROW
parse_result parse(std::basic_istream<Char>& doc, std::string_view source_path = {}) TOML_MAY_THROW
{ {
static_assert( static_assert(
sizeof(Char) == 1, sizeof(Char) == 1,
@ -552,8 +576,7 @@ namespace toml
/// <strong><em>Without exceptions:</em></strong> A toml::parse_result detailing the parsing outcome. /// <strong><em>Without exceptions:</em></strong> A toml::parse_result detailing the parsing outcome.
template <typename Char> template <typename Char>
[[nodiscard]] [[nodiscard]]
TOML_EXTERNAL_LINKAGE inline parse_result parse(std::basic_istream<Char>& doc, std::string&& source_path) TOML_MAY_THROW
parse_result parse(std::basic_istream<Char>& doc, std::string&& source_path) TOML_MAY_THROW
{ {
static_assert( static_assert(
sizeof(Char) == 1, sizeof(Char) == 1,
@ -592,15 +615,13 @@ namespace toml
/// \attention This overload is only available when #TOML_WINDOWS_COMPAT is enabled. /// \attention This overload is only available when #TOML_WINDOWS_COMPAT is enabled.
template <typename Char> template <typename Char>
[[nodiscard]] [[nodiscard]]
TOML_EXTERNAL_LINKAGE inline parse_result parse(std::basic_istream<Char>& doc, std::wstring_view source_path) TOML_MAY_THROW
parse_result parse(std::basic_istream<Char>& doc, std::wstring_view source_path) TOML_MAY_THROW
{ {
return parse(doc, impl::narrow<char>(source_path)); return parse(doc, impl::narrow(source_path));
} }
#endif // TOML_WINDOWS_COMPAT #endif // TOML_WINDOWS_COMPAT
// Q: "why are the parse_file functions templated??" // Q: "why are the parse_file functions templated??"
// A: I don't want to force users to drag in <fstream> if they're not going to do // A: I don't want to force users to drag in <fstream> if they're not going to do
// any parsing directly from files. Keeping them templated delays their instantiation // any parsing directly from files. Keeping them templated delays their instantiation
@ -628,8 +649,7 @@ namespace toml
/// \attention You must `#include <fstream>` to use this function (toml++ does not transitively include it for you). /// \attention You must `#include <fstream>` to use this function (toml++ does not transitively include it for you).
template <typename Char, typename StreamChar = char> template <typename Char, typename StreamChar = char>
[[nodiscard]] [[nodiscard]]
TOML_EXTERNAL_LINKAGE inline parse_result parse_file(std::basic_string_view<Char> file_path) TOML_MAY_THROW
parse_result parse_file(std::basic_string_view<Char> file_path) TOML_MAY_THROW
{ {
static_assert( static_assert(
!std::is_same_v<Char, wchar_t> || TOML_WINDOWS_COMPAT, !std::is_same_v<Char, wchar_t> || TOML_WINDOWS_COMPAT,
@ -654,7 +674,7 @@ namespace toml
std::string file_path_str; std::string file_path_str;
#if TOML_WINDOWS_COMPAT #if TOML_WINDOWS_COMPAT
if constexpr (std::is_same_v<Char, wchar_t>) if constexpr (std::is_same_v<Char, wchar_t>)
file_path_str = impl::narrow<char>(file_path); file_path_str = impl::narrow(file_path);
else else
#endif #endif
file_path_str = std::string_view{ reinterpret_cast<const char*>(file_path.data()), file_path.length() }; file_path_str = std::string_view{ reinterpret_cast<const char*>(file_path.data()), file_path.length() };
@ -715,8 +735,6 @@ namespace toml
return parse_file(std::basic_string_view<Char>{ file_path }); return parse_file(std::basic_string_view<Char>{ file_path });
} }
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
/// \brief Convenience literal operators for working with toml++. /// \brief Convenience literal operators for working with toml++.
/// ///
/// \detail This namespace exists so you can safely hoist the UDL operators into another scope /// \detail This namespace exists so you can safely hoist the UDL operators into another scope
@ -737,8 +755,6 @@ namespace toml
/// ///
inline namespace literals inline namespace literals
{ {
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, lit_ex, lit_noex)
/// \brief Parses TOML data from a string literal. /// \brief Parses TOML data from a string literal.
/// ///
/// \detail \cpp /// \detail \cpp
@ -791,9 +807,11 @@ namespace toml
#endif // __cpp_lib_char8_t #endif // __cpp_lib_char8_t
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
} }
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
TOML_ABI_NAMESPACE_END // version
} }
#undef TOML_THROW_PARSE_ERROR #undef TOML_THROW_PARSE_ERROR

View File

@ -39,7 +39,7 @@ TOML_DISABLE_PADDING_WARNINGS
#define TOML_RETURNS_BY_THROWING #define TOML_RETURNS_BY_THROWING
#endif #endif
namespace TOML_INTERNAL_NAMESPACE namespace TOML_ANONYMOUS_NAMESPACE
{ {
template <uint64_t> struct parse_integer_traits; template <uint64_t> struct parse_integer_traits;
template <> struct parse_integer_traits<2> final template <> struct parse_integer_traits<2> final
@ -116,7 +116,7 @@ namespace TOML_INTERNAL_NAMESPACE
else if TOML_UNLIKELY(cp.value == U'\x7F') else if TOML_UNLIKELY(cp.value == U'\x7F')
return "\\u007F"sv; return "\\u007F"sv;
else else
return cp.template as_view<char>(); return cp.as_view();
} }
template <typename T> template <typename T>
@ -196,7 +196,6 @@ namespace TOML_INTERNAL_NAMESPACE
} }
template <typename T> template <typename T>
TOML_ALWAYS_INLINE
void append(const T& arg) noexcept void append(const T& arg) noexcept
{ {
concatenate(write_pos, max_write_pos, arg); concatenate(write_pos, max_write_pos, arg);
@ -245,18 +244,22 @@ namespace TOML_INTERNAL_NAMESPACE
struct parsed_key final struct parsed_key final
{ {
std::vector<toml::string> segments; std::vector<std::string> segments;
}; };
struct parsed_key_value_pair final struct parsed_key_value_pair final
{ {
parsed_key key; parsed_key key;
std::unique_ptr<toml::node> value; toml::node* value;
}; };
TOML_ANONYMOUS_NAMESPACE_END
} }
namespace toml::impl namespace toml
{ {
TOML_IMPL_NAMESPACE_START
// Q: "what the fuck is this? MACROS????" // Q: "what the fuck is this? MACROS????"
// A: The parser needs to work in exceptionless mode (returning error objects directly) // A: The parser needs to work in exceptionless mode (returning error objects directly)
// and exception mode (reporting parse failures by throwing). Two totally different control flows. // and exception mode (reporting parse failures by throwing). Two totally different control flows.
@ -272,7 +275,7 @@ namespace toml::impl
#endif #endif
#define is_eof() !cp #define is_eof() !cp
#define assert_not_eof() assert_or_assume(cp) #define assert_not_eof() assert_or_assume(cp != nullptr)
#define return_if_eof(...) do { if (is_eof()) return __VA_ARGS__; } while(false) #define return_if_eof(...) do { if (is_eof()) return __VA_ARGS__; } while(false)
#if TOML_EXCEPTIONS #if TOML_EXCEPTIONS
#define is_error() false #define is_error() false
@ -302,7 +305,7 @@ namespace toml::impl
set_error_and_return_if_eof(__VA_ARGS__); \ set_error_and_return_if_eof(__VA_ARGS__); \
} while (false) } while (false)
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, impl_ex, impl_noex) TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, ex, noex)
class parser final class parser final
{ {
@ -352,7 +355,6 @@ namespace toml::impl
template <typename... T> template <typename... T>
TOML_RETURNS_BY_THROWING TOML_RETURNS_BY_THROWING
TOML_ALWAYS_INLINE
void set_error(const T&... reason) const TOML_MAY_THROW void set_error(const T&... reason) const TOML_MAY_THROW
{ {
set_error_at(current_position(1), reason...); set_error_at(current_position(1), reason...);
@ -386,7 +388,7 @@ namespace toml::impl
if (recording && !is_eof()) if (recording && !is_eof())
{ {
if (recording_whitespace || !(is_whitespace(*cp) || is_line_break(*cp))) if (recording_whitespace || !(is_whitespace(*cp) || is_line_break(*cp)))
recording_buffer.append(cp->as_view<char>()); recording_buffer.append(cp->as_view());
} }
} }
@ -398,7 +400,7 @@ namespace toml::impl
recording_whitespace = true; recording_whitespace = true;
recording_buffer.clear(); recording_buffer.clear();
if (include_current && !is_eof()) if (include_current && !is_eof())
recording_buffer.append(cp->as_view<char>()); recording_buffer.append(cp->as_view());
} }
void stop_recording(size_t pop_bytes = 0_sz) noexcept void stop_recording(size_t pop_bytes = 0_sz) noexcept
@ -564,7 +566,7 @@ namespace toml::impl
//template <bool MultiLine> //template <bool MultiLine>
[[nodiscard]] [[nodiscard]]
string parse_basic_string(bool multi_line) TOML_MAY_THROW std::string parse_basic_string(bool multi_line) TOML_MAY_THROW
{ {
return_if_error({}); return_if_error({});
assert_not_eof(); assert_not_eof();
@ -582,7 +584,7 @@ namespace toml::impl
set_error_and_return_if_eof({}); set_error_and_return_if_eof({});
} }
string str; std::string str;
bool escaped = false; bool escaped = false;
[[maybe_unused]] bool skipping_whitespace = false; [[maybe_unused]] bool skipping_whitespace = false;
do do
@ -612,13 +614,13 @@ namespace toml::impl
switch (const auto escaped_codepoint = *cp) switch (const auto escaped_codepoint = *cp)
{ {
// 'regular' escape codes // 'regular' escape codes
case U'b': str += TOML_STRING_PREFIX('\b'); break; case U'b': str += '\b'; break;
case U'f': str += TOML_STRING_PREFIX('\f'); break; case U'f': str += '\f'; break;
case U'n': str += TOML_STRING_PREFIX('\n'); break; case U'n': str += '\n'; break;
case U'r': str += TOML_STRING_PREFIX('\r'); break; case U'r': str += '\r'; break;
case U't': str += TOML_STRING_PREFIX('\t'); break; case U't': str += '\t'; break;
case U'"': str += TOML_STRING_PREFIX('"'); break; case U'"': str += '"'; break;
case U'\\': str += TOML_STRING_PREFIX('\\'); break; case U'\\': str += '\\'; break;
// unicode scalar sequences // unicode scalar sequences
case U'x': case U'x':
@ -657,24 +659,24 @@ namespace toml::impl
else if (sequence_value > 0x10FFFFu) else if (sequence_value > 0x10FFFFu)
set_error_and_return_default("values greater than U+10FFFF are invalid"sv); set_error_and_return_default("values greater than U+10FFFF are invalid"sv);
else if (sequence_value <= 0x7Fu) //ascii else if (sequence_value <= 0x7Fu) //ascii
str += static_cast<string_char>(sequence_value & 0x7Fu); str += static_cast<char>(sequence_value & 0x7Fu);
else if (sequence_value <= 0x7FFu) else if (sequence_value <= 0x7FFu)
{ {
str += static_cast<string_char>(0xC0u | ((sequence_value >> 6) & 0x1Fu)); str += static_cast<char>(0xC0u | ((sequence_value >> 6) & 0x1Fu));
str += static_cast<string_char>(0x80u | (sequence_value & 0x3Fu)); str += static_cast<char>(0x80u | (sequence_value & 0x3Fu));
} }
else if (sequence_value <= 0xFFFFu) else if (sequence_value <= 0xFFFFu)
{ {
str += static_cast<string_char>(0xE0u | ((sequence_value >> 12) & 0x0Fu)); str += static_cast<char>(0xE0u | ((sequence_value >> 12) & 0x0Fu));
str += static_cast<string_char>(0x80u | ((sequence_value >> 6) & 0x1Fu)); str += static_cast<char>(0x80u | ((sequence_value >> 6) & 0x1Fu));
str += static_cast<string_char>(0x80u | (sequence_value & 0x3Fu)); str += static_cast<char>(0x80u | (sequence_value & 0x3Fu));
} }
else else
{ {
str += static_cast<string_char>(0xF0u | ((sequence_value >> 18) & 0x07u)); str += static_cast<char>(0xF0u | ((sequence_value >> 18) & 0x07u));
str += static_cast<string_char>(0x80u | ((sequence_value >> 12) & 0x3Fu)); str += static_cast<char>(0x80u | ((sequence_value >> 12) & 0x3Fu));
str += static_cast<string_char>(0x80u | ((sequence_value >> 6) & 0x3Fu)); str += static_cast<char>(0x80u | ((sequence_value >> 6) & 0x3Fu));
str += static_cast<string_char>(0x80u | (sequence_value & 0x3Fu)); str += static_cast<char>(0x80u | (sequence_value & 0x3Fu));
} }
break; break;
} }
@ -712,13 +714,13 @@ namespace toml::impl
{ {
// """ " (one quote somewhere in a ML string) // """ " (one quote somewhere in a ML string)
case 1_sz: case 1_sz:
str += TOML_STRING_PREFIX('"'); str += '"';
skipping_whitespace = false; skipping_whitespace = false;
continue; continue;
// """ "" (two quotes somewhere in a ML string) // """ "" (two quotes somewhere in a ML string)
case 2_sz: case 2_sz:
str.append(TOML_STRING_PREFIX("\"\""sv)); str.append("\"\""sv);
skipping_whitespace = false; skipping_whitespace = false;
continue; continue;
@ -728,12 +730,12 @@ namespace toml::impl
// """ """" (one at the end of the string) // """ """" (one at the end of the string)
case 4_sz: case 4_sz:
str += TOML_STRING_PREFIX('"'); str += '"';
return str; return str;
// """ """"" (two quotes at the end of the string) // """ """"" (two quotes at the end of the string)
case 5_sz: case 5_sz:
str.append(TOML_STRING_PREFIX("\"\""sv)); str.append("\"\""sv);
advance_and_return_if_error({}); // skip the last '"' advance_and_return_if_error({}); // skip the last '"'
return str; return str;
@ -762,7 +764,7 @@ namespace toml::impl
consume_line_break(); consume_line_break();
return_if_error({}); return_if_error({});
if (!skipping_whitespace) if (!skipping_whitespace)
str += TOML_STRING_PREFIX('\n'); str += '\n';
continue; continue;
} }
@ -801,7 +803,7 @@ namespace toml::impl
} }
[[nodiscard]] [[nodiscard]]
string parse_literal_string(bool multi_line) TOML_MAY_THROW std::string parse_literal_string(bool multi_line) TOML_MAY_THROW
{ {
return_if_error({}); return_if_error({});
assert_not_eof(); assert_not_eof();
@ -819,7 +821,7 @@ namespace toml::impl
set_error_and_return_if_eof({}); set_error_and_return_if_eof({});
} }
string str; std::string str;
do do
{ {
assert_not_error(); assert_not_error();
@ -846,12 +848,12 @@ namespace toml::impl
{ {
// ''' ' (one quote somewhere in a ML string) // ''' ' (one quote somewhere in a ML string)
case 1_sz: case 1_sz:
str += TOML_STRING_PREFIX('\''); str += '\'';
continue; continue;
// ''' '' (two quotes somewhere in a ML string) // ''' '' (two quotes somewhere in a ML string)
case 2_sz: case 2_sz:
str.append(TOML_STRING_PREFIX("''"sv)); str.append("''"sv);
continue; continue;
// ''' ''' (the end of the string) // ''' ''' (the end of the string)
@ -860,12 +862,12 @@ namespace toml::impl
// ''' '''' (one at the end of the string) // ''' '''' (one at the end of the string)
case 4_sz: case 4_sz:
str += TOML_STRING_PREFIX('\''); str += '\'';
return str; return str;
// ''' ''''' (two quotes at the end of the string) // ''' ''''' (two quotes at the end of the string)
case 5_sz: case 5_sz:
str.append(TOML_STRING_PREFIX("''"sv)); str.append("''"sv);
advance_and_return_if_error({}); // skip the last ' advance_and_return_if_error({}); // skip the last '
return str; return str;
@ -883,7 +885,7 @@ namespace toml::impl
if (multi_line && is_line_break(*cp)) if (multi_line && is_line_break(*cp))
{ {
consume_line_break(); consume_line_break();
str += TOML_STRING_PREFIX('\n'); str += '\n';
continue; continue;
} }
@ -912,11 +914,12 @@ namespace toml::impl
struct parsed_string final struct parsed_string final
{ {
string value; std::string value;
bool was_multi_line; bool was_multi_line;
}; };
[[nodiscard]] [[nodiscard]]
TOML_NEVER_INLINE
parsed_string parse_string() TOML_MAY_THROW parsed_string parse_string() TOML_MAY_THROW
{ {
return_if_error({}); return_if_error({});
@ -972,13 +975,13 @@ namespace toml::impl
} }
[[nodiscard]] [[nodiscard]]
string parse_bare_key_segment() TOML_MAY_THROW std::string parse_bare_key_segment() TOML_MAY_THROW
{ {
return_if_error({}); return_if_error({});
assert_not_eof(); assert_not_eof();
assert_or_assume(is_bare_key_character(*cp)); assert_or_assume(is_bare_key_character(*cp));
string segment; std::string segment;
while (!is_eof()) while (!is_eof())
{ {
@ -1750,14 +1753,55 @@ namespace toml::impl
TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_INIT_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_INIT_WARNINGS
[[nodiscard]] [[nodiscard]] toml::array* parse_array() TOML_MAY_THROW;
std::unique_ptr<toml::array> parse_array() TOML_MAY_THROW; [[nodiscard]] toml::table* parse_inline_table() TOML_MAY_THROW;
[[nodiscard]] [[nodiscard]]
std::unique_ptr<toml::table> parse_inline_table() TOML_MAY_THROW; node* parse_value_known_prefixes() TOML_MAY_THROW
{
return_if_error({});
assert_not_eof();
assert_or_assume(!is_control_character(*cp));
assert_or_assume(*cp != U'_');
switch (cp->value)
{
// arrays
case U'[':
return parse_array();
// inline tables
case U'{':
return parse_inline_table();
// floats beginning with '.'
case U'.':
return new value{ parse_float() };
// strings
case U'"': [[fallthrough]];
case U'\'':
return new value{ std::move(parse_string().value) };
// bools
case U't': [[fallthrough]];
case U'f': [[fallthrough]];
case U'T': [[fallthrough]];
case U'F':
return new value{ parse_boolean() };
// inf/nan
case U'i': [[fallthrough]];
case U'I': [[fallthrough]];
case U'n': [[fallthrough]];
case U'N':
return new value{ parse_inf_or_nan() };
}
return nullptr;
}
[[nodiscard]] [[nodiscard]]
std::unique_ptr<node> parse_value() TOML_MAY_THROW node* parse_value() TOML_MAY_THROW
{ {
return_if_error({}); return_if_error({});
assert_not_eof(); assert_not_eof();
@ -1775,7 +1819,7 @@ namespace toml::impl
set_error_and_return_default("values may not begin with underscores"sv); set_error_and_return_default("values may not begin with underscores"sv);
const auto begin_pos = cp->position; const auto begin_pos = cp->position;
std::unique_ptr<node> val; node* val{};
do do
{ {
@ -1785,57 +1829,8 @@ namespace toml::impl
// detect the value type and parse accordingly, // detect the value type and parse accordingly,
// starting with value types that can be detected // starting with value types that can be detected
// unambiguously from just one character. // unambiguously from just one character.
switch (cp->value) val = parse_value_known_prefixes();
{
// arrays
case U'[':
{
val = parse_array();
if constexpr (!TOML_LANG_AT_LEAST(1, 0, 0)) // toml/issues/665 (heterogeneous arrays)
{
if (!val->ref_cast<array>().is_homogeneous())
set_error_at(
begin_pos,
"arrays cannot contain values of different types before TOML 1.0.0"sv
);
}
break;
}
// inline tables
case U'{':
val = parse_inline_table();
break;
// floats beginning with '.'
case U'.':
val = std::make_unique<value<double>>(parse_float());
break;
// strings
case U'"': [[fallthrough]];
case U'\'':
val = std::make_unique<value<string>>(std::move(parse_string().value));
break;
// bools
case U't': [[fallthrough]];
case U'f': [[fallthrough]];
case U'T': [[fallthrough]];
case U'F':
val = std::make_unique<value<bool>>(parse_boolean());
break;
// inf/nan
case U'i': [[fallthrough]];
case U'I': [[fallthrough]];
case U'n': [[fallthrough]];
case U'N':
val = std::make_unique<value<double>>(parse_inf_or_nan());
break;
}
return_if_error({}); return_if_error({});
if (val) if (val)
break; break;
@ -2014,7 +2009,7 @@ namespace toml::impl
{ {
if (has_any(begins_zero | begins_digit)) if (has_any(begins_zero | begins_digit))
{ {
val = std::make_unique<value<int64_t>>(static_cast<int64_t>(chars[0] - U'0')); val = new value{ static_cast<int64_t>(chars[0] - U'0') };
advance(); //skip the digit advance(); //skip the digit
break; break;
} }
@ -2036,24 +2031,24 @@ namespace toml::impl
// typed parse functions to take over and show better diagnostics if there's an issue // typed parse functions to take over and show better diagnostics if there's an issue
// (as opposed to the fallback "could not determine type" message) // (as opposed to the fallback "could not determine type" message)
if (has_any(has_p)) if (has_any(has_p))
val = std::make_unique<value<double>>(parse_hex_float()); val = new value{ parse_hex_float() };
else if (has_any(has_x)) else if (has_any(has_x))
val = std::make_unique<value<int64_t>>(parse_integer<16>()); val = new value{ parse_integer<16>() };
else if (has_any(has_o)) else if (has_any(has_o))
val = std::make_unique<value<int64_t>>(parse_integer<8>()); val = new value{ parse_integer<8>() };
else if (has_any(has_b)) else if (has_any(has_b))
val = std::make_unique<value<int64_t>>(parse_integer<2>()); val = new value{ parse_integer<2>() };
else if (has_any(has_e) || (has_any(begins_zero | begins_digit) && chars[1] == U'.')) else if (has_any(has_e) || (has_any(begins_zero | begins_digit) && chars[1] == U'.'))
val = std::make_unique<value<double>>(parse_float()); val = new value{ parse_float() };
else if (has_any(begins_sign)) else if (has_any(begins_sign))
{ {
// single-digit signed integers // single-digit signed integers
if (char_count == 2_sz && has_any(has_digits)) if (char_count == 2_sz && has_any(has_digits))
{ {
val = std::make_unique<value<int64_t>>( val = new value{
static_cast<int64_t>(chars[1] - U'0') static_cast<int64_t>(chars[1] - U'0')
* (chars[0] == U'-' ? -1LL : 1LL) * (chars[0] == U'-' ? -1LL : 1LL)
); };
advance(); //skip the sign advance(); //skip the sign
advance(); //skip the digit advance(); //skip the digit
break; break;
@ -2061,11 +2056,11 @@ namespace toml::impl
// simple signed floats (e.g. +1.0) // simple signed floats (e.g. +1.0)
if (is_decimal_digit(chars[1]) && chars[2] == U'.') if (is_decimal_digit(chars[1]) && chars[2] == U'.')
val = std::make_unique<value<double>>(parse_float()); val = new value{ parse_float() };
// signed infinity or nan // signed infinity or nan
else if (is_match(chars[1], U'i', U'n', U'I', U'N')) else if (is_match(chars[1], U'i', U'n', U'I', U'N'))
val = std::make_unique<value<double>>(parse_inf_or_nan()); val = new value{ parse_inf_or_nan() };
} }
return_if_error({}); return_if_error({});
@ -2081,13 +2076,13 @@ namespace toml::impl
//=================== binary integers //=================== binary integers
// 0b10 // 0b10
case bzero_msk | has_b: case bzero_msk | has_b:
val = std::make_unique<value<int64_t>>(parse_integer<2>()); val = new value{ parse_integer<2>() };
break; break;
//=================== octal integers //=================== octal integers
// 0o10 // 0o10
case bzero_msk | has_o: case bzero_msk | has_o:
val = std::make_unique<value<int64_t>>(parse_integer<8>()); val = new value{ parse_integer<8>() };
break; break;
//=================== decimal integers //=================== decimal integers
@ -2099,13 +2094,13 @@ namespace toml::impl
case bdigit_msk: [[fallthrough]]; case bdigit_msk: [[fallthrough]];
case begins_sign | has_digits | has_minus: [[fallthrough]]; case begins_sign | has_digits | has_minus: [[fallthrough]];
case begins_sign | has_digits | has_plus: case begins_sign | has_digits | has_plus:
val = std::make_unique<value<int64_t>>(parse_integer<10>()); val = new value{ parse_integer<10>() };
break; break;
//=================== hexadecimal integers //=================== hexadecimal integers
// 0x10 // 0x10
case bzero_msk | has_x: case bzero_msk | has_x:
val = std::make_unique<value<int64_t>>(parse_integer<16>()); val = new value{ parse_integer<16>() };
break; break;
//=================== decimal floats //=================== decimal floats
@ -2157,7 +2152,7 @@ namespace toml::impl
case begins_sign | has_digits | has_e | signs_msk: [[fallthrough]]; case begins_sign | has_digits | has_e | signs_msk: [[fallthrough]];
case begins_sign | has_digits | has_dot | has_minus: [[fallthrough]]; case begins_sign | has_digits | has_dot | has_minus: [[fallthrough]];
case begins_sign | has_digits | has_dot | has_e | has_minus: case begins_sign | has_digits | has_dot | has_e | has_minus:
val = std::make_unique<value<double>>(parse_float()); val = new value{ parse_float() };
break; break;
//=================== hexadecimal floats //=================== hexadecimal floats
@ -2191,7 +2186,7 @@ namespace toml::impl
case begins_sign | has_digits | has_x | has_dot | has_p | has_minus: [[fallthrough]]; case begins_sign | has_digits | has_x | has_dot | has_p | has_minus: [[fallthrough]];
case begins_sign | has_digits | has_x | has_dot | has_p | has_plus: [[fallthrough]]; case begins_sign | has_digits | has_x | has_dot | has_p | has_plus: [[fallthrough]];
case begins_sign | has_digits | has_x | has_dot | has_p | signs_msk: case begins_sign | has_digits | has_x | has_dot | has_p | signs_msk:
val = std::make_unique<value<double>>(parse_hex_float()); val = new value{ parse_hex_float() };
break; break;
//=================== times //=================== times
@ -2202,14 +2197,14 @@ namespace toml::impl
case bzero_msk | has_colon | has_dot: [[fallthrough]]; case bzero_msk | has_colon | has_dot: [[fallthrough]];
case bdigit_msk | has_colon: [[fallthrough]]; case bdigit_msk | has_colon: [[fallthrough]];
case bdigit_msk | has_colon | has_dot: case bdigit_msk | has_colon | has_dot:
val = std::make_unique<value<time>>(parse_time()); val = new value{ parse_time() };
break; break;
//=================== local dates //=================== local dates
// YYYY-MM-DD // YYYY-MM-DD
case bzero_msk | has_minus: [[fallthrough]]; case bzero_msk | has_minus: [[fallthrough]];
case bdigit_msk | has_minus: case bdigit_msk | has_minus:
val = std::make_unique<value<date>>(parse_date()); val = new value{ parse_date() };
break; break;
//=================== date-times //=================== date-times
@ -2249,7 +2244,7 @@ namespace toml::impl
case bzero_msk | has_minus | has_colon | has_dot | has_z | has_t: [[fallthrough]]; case bzero_msk | has_minus | has_colon | has_dot | has_z | has_t: [[fallthrough]];
case bdigit_msk | has_minus | has_colon | has_z | has_t: [[fallthrough]]; case bdigit_msk | has_minus | has_colon | has_z | has_t: [[fallthrough]];
case bdigit_msk | has_minus | has_colon | has_dot | has_z | has_t: case bdigit_msk | has_minus | has_colon | has_dot | has_z | has_t:
val = std::make_unique<value<date_time>>(parse_date_time()); val = new value{ parse_date_time() };
break; break;
} }
@ -2265,6 +2260,20 @@ namespace toml::impl
return_after_error({}); return_after_error({});
} }
#if !TOML_LANG_AT_LEAST(1, 0, 0) // toml/issues/665 (heterogeneous arrays)
{
if (auto arr = val->as_array(); arr && !arr->is_homogeneous())
{
delete arr;
set_error_at(
begin_pos,
"arrays cannot contain values of different types before TOML 1.0.0"sv
);
return_after_error({});
}
}
#endif
val->source_ = { begin_pos, current_position(1), reader.source_path() }; val->source_ = { begin_pos, current_position(1), reader.source_path() };
return val; return val;
} }
@ -2372,7 +2381,7 @@ namespace toml::impl
} }
[[nodiscard]] [[nodiscard]]
table* parse_table_header() TOML_MAY_THROW toml::table* parse_table_header() TOML_MAY_THROW
{ {
return_if_error({}); return_if_error({});
assert_not_eof(); assert_not_eof();
@ -2452,7 +2461,7 @@ namespace toml::impl
{ {
child = parent->values.emplace( child = parent->values.emplace(
key.segments[i], key.segments[i],
std::make_unique<table>() new toml::table{}
).first->second.get(); ).first->second.get();
implicit_tables.push_back(&child->ref_cast<table>()); implicit_tables.push_back(&child->ref_cast<table>());
child->source_ = { header_begin_pos, header_end_pos, reader.source_path() }; child->source_ = { header_begin_pos, header_end_pos, reader.source_path() };
@ -2495,12 +2504,14 @@ namespace toml::impl
// set the starting regions, and return the table element // set the starting regions, and return the table element
if (is_arr) if (is_arr)
{ {
auto tab_arr = &parent->values.emplace(key.segments.back(),std::make_unique<array>()) auto tab_arr = &parent->values.emplace(
.first->second->ref_cast<array>(); key.segments.back(),
new toml::array{}
).first->second->ref_cast<array>();
table_arrays.push_back(tab_arr); table_arrays.push_back(tab_arr);
tab_arr->source_ = { header_begin_pos, header_end_pos, reader.source_path() }; tab_arr->source_ = { header_begin_pos, header_end_pos, reader.source_path() };
tab_arr->values.push_back(std::make_unique<table>()); tab_arr->values.emplace_back(new toml::table{});
tab_arr->values.back()->source_ = { header_begin_pos, header_end_pos, reader.source_path() }; tab_arr->values.back()->source_ = { header_begin_pos, header_end_pos, reader.source_path() };
return &tab_arr->values.back()->ref_cast<table>(); return &tab_arr->values.back()->ref_cast<table>();
} }
@ -2508,7 +2519,9 @@ namespace toml::impl
//otherwise we're just making a table //otherwise we're just making a table
else else
{ {
auto tab = &parent->values.emplace(key.segments.back(),std::make_unique<table>()) auto tab = &parent->values.emplace(
key.segments.back(),
new toml::table{})
.first->second->ref_cast<table>(); .first->second->ref_cast<table>();
tab->source_ = { header_begin_pos, header_end_pos, reader.source_path() }; tab->source_ = { header_begin_pos, header_end_pos, reader.source_path() };
return tab; return tab;
@ -2524,7 +2537,7 @@ namespace toml::impl
if (is_arr && matching_node->is_array() && find(table_arrays, &matching_node->ref_cast<array>())) if (is_arr && matching_node->is_array() && find(table_arrays, &matching_node->ref_cast<array>()))
{ {
auto tab_arr = &matching_node->ref_cast<array>(); auto tab_arr = &matching_node->ref_cast<array>();
tab_arr->values.push_back(std::make_unique<table>()); tab_arr->values.emplace_back(new toml::table{});
tab_arr->values.back()->source_ = { header_begin_pos, header_end_pos, reader.source_path() }; tab_arr->values.back()->source_ = { header_begin_pos, header_end_pos, reader.source_path() };
return &tab_arr->values.back()->ref_cast<table>(); return &tab_arr->values.back()->ref_cast<table>();
} }
@ -2555,7 +2568,7 @@ namespace toml::impl
} }
} }
void parse_key_value_pair_and_insert(table* tab) TOML_MAY_THROW void parse_key_value_pair_and_insert(toml::table* tab) TOML_MAY_THROW
{ {
return_if_error(); return_if_error();
assert_not_eof(); assert_not_eof();
@ -2574,7 +2587,7 @@ namespace toml::impl
{ {
child = tab->values.emplace( child = tab->values.emplace(
std::move(kvp.key.segments[i]), std::move(kvp.key.segments[i]),
std::make_unique<table>() new toml::table{}
).first->second.get(); ).first->second.get();
dotted_key_tables.push_back(&child->ref_cast<table>()); dotted_key_tables.push_back(&child->ref_cast<table>());
dotted_key_tables.back()->inline_ = true; dotted_key_tables.back()->inline_ = true;
@ -2607,7 +2620,7 @@ namespace toml::impl
return_if_error(); return_if_error();
tab->values.emplace( tab->values.emplace(
std::move(kvp.key.segments.back()), std::move(kvp.key.segments.back()),
std::move(kvp.value) std::unique_ptr<node>{ kvp.value }
); );
} }
@ -2752,7 +2765,7 @@ namespace toml::impl
}; };
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
std::unique_ptr<toml::array> parser::parse_array() TOML_MAY_THROW toml::array* parser::parse_array() TOML_MAY_THROW
{ {
return_if_error({}); return_if_error({});
assert_not_eof(); assert_not_eof();
@ -2762,7 +2775,7 @@ namespace toml::impl
// skip opening '[' // skip opening '['
advance_and_return_if_error_or_eof({}); advance_and_return_if_error_or_eof({});
auto arr = std::make_unique<array>(); auto arr = new array{};
auto& vals = arr->values; auto& vals = arr->values;
enum parse_elem : int enum parse_elem : int
{ {
@ -2808,7 +2821,7 @@ namespace toml::impl
continue; continue;
} }
prev = val; prev = val;
vals.push_back(parse_value()); vals.emplace_back(parse_value());
} }
} }
@ -2817,7 +2830,7 @@ namespace toml::impl
} }
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
std::unique_ptr<toml::table> parser::parse_inline_table() TOML_MAY_THROW toml::table* parser::parse_inline_table() TOML_MAY_THROW
{ {
return_if_error({}); return_if_error({});
assert_not_eof(); assert_not_eof();
@ -2827,7 +2840,7 @@ namespace toml::impl
// skip opening '{' // skip opening '{'
advance_and_return_if_error_or_eof({}); advance_and_return_if_error_or_eof({});
auto tab = std::make_unique<table>(); auto tab = new table{};
tab->inline_ = true; tab->inline_ = true;
enum parse_elem : int enum parse_elem : int
{ {
@ -2888,7 +2901,7 @@ namespace toml::impl
else else
{ {
prev = kvp; prev = kvp;
parse_key_value_pair_and_insert(tab.get()); parse_key_value_pair_and_insert(tab);
} }
} }
@ -2928,12 +2941,15 @@ namespace toml::impl
#undef advance_and_return_if_error #undef advance_and_return_if_error
#undef advance_and_return_if_error_or_eof #undef advance_and_return_if_error_or_eof
#undef assert_or_assume #undef assert_or_assume
}
TOML_IMPL_NAMESPACE_END
}
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, parse_ex, parse_noex) TOML_ABI_NAMESPACE_VERSION
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, ex, noex)
TOML_API TOML_API
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
@ -2955,7 +2971,7 @@ namespace toml
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
parse_result parse(std::string_view doc, std::wstring_view source_path) TOML_MAY_THROW parse_result parse(std::string_view doc, std::wstring_view source_path) TOML_MAY_THROW
{ {
return impl::do_parse(impl::utf8_reader{ doc, impl::narrow<char>(source_path) }); return impl::do_parse(impl::utf8_reader{ doc, impl::narrow(source_path) });
} }
#endif // TOML_WINDOWS_COMPAT #endif // TOML_WINDOWS_COMPAT
@ -2982,19 +2998,15 @@ namespace toml
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
parse_result parse(std::u8string_view doc, std::wstring_view source_path) TOML_MAY_THROW parse_result parse(std::u8string_view doc, std::wstring_view source_path) TOML_MAY_THROW
{ {
return impl::do_parse(impl::utf8_reader{ doc, impl::narrow<char>(source_path) }); return impl::do_parse(impl::utf8_reader{ doc, impl::narrow(source_path) });
} }
#endif // TOML_WINDOWS_COMPAT #endif // TOML_WINDOWS_COMPAT
#endif // __cpp_lib_char8_t #endif // __cpp_lib_char8_t
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
inline namespace literals inline namespace literals
{ {
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, lit_ex, lit_noex)
TOML_API TOML_API
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
parse_result operator"" _toml(const char* str, size_t len) TOML_MAY_THROW parse_result operator"" _toml(const char* str, size_t len) TOML_MAY_THROW
@ -3012,9 +3024,11 @@ namespace toml
} }
#endif // __cpp_lib_char8_t #endif // __cpp_lib_char8_t
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
} }
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_PADDING_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_SWITCH_WARNINGS, TOML_DISABLE_PADDING_WARNINGS

View File

@ -28,10 +28,6 @@
#define TOML_API #define TOML_API
#endif #endif
#ifndef TOML_CHAR_8_STRINGS
#define TOML_CHAR_8_STRINGS 0
#endif
#ifndef TOML_UNRELEASED_FEATURES #ifndef TOML_UNRELEASED_FEATURES
#define TOML_UNRELEASED_FEATURES 0 #define TOML_UNRELEASED_FEATURES 0
#endif #endif
@ -62,6 +58,14 @@
#define TOML_HAS_CUSTOM_OPTIONAL_TYPE 0 #define TOML_HAS_CUSTOM_OPTIONAL_TYPE 0
#endif #endif
#ifdef TOML_CHAR_8_STRINGS
#if TOML_CHAR_8_STRINGS
#error TOML_CHAR_8_STRINGS was removed in toml++ 2.0.0; \
all value setters and getters can now work with char8_t strings implicitly so changing the underlying string type \
is no longer necessary.
#endif
#endif
////////// COMPILER & ENVIRONMENT ////////// COMPILER & ENVIRONMENT
#ifndef __cplusplus #ifndef __cplusplus
@ -76,21 +80,22 @@
#endif #endif
#ifdef __clang__ #ifdef __clang__
#define TOML_PUSH_WARNINGS _Pragma("clang diagnostic push") #define TOML_PUSH_WARNINGS _Pragma("clang diagnostic push")
#define TOML_DISABLE_SWITCH_WARNINGS _Pragma("clang diagnostic ignored \"-Wswitch\"") #define TOML_DISABLE_SWITCH_WARNINGS _Pragma("clang diagnostic ignored \"-Wswitch\"")
#define TOML_DISABLE_INIT_WARNINGS _Pragma("clang diagnostic ignored \"-Wmissing-field-initializers\"") #define TOML_DISABLE_INIT_WARNINGS _Pragma("clang diagnostic ignored \"-Wmissing-field-initializers\"")
#define TOML_DISABLE_VTABLE_WARNINGS _Pragma("clang diagnostic ignored \"-Weverything\"") \ #define TOML_DISABLE_PADDING_WARNINGS _Pragma("clang diagnostic ignored \"-Wpadded\"")
_Pragma("clang diagnostic ignored \"-Wweak-vtables\"") #define TOML_DISABLE_ARITHMETIC_WARNINGS _Pragma("clang diagnostic ignored \"-Wfloat-equal\"") \
#define TOML_DISABLE_PADDING_WARNINGS _Pragma("clang diagnostic ignored \"-Wpadded\"") _Pragma("clang diagnostic ignored \"-Wdouble-promotion\"") \
#define TOML_DISABLE_FLOAT_WARNINGS _Pragma("clang diagnostic ignored \"-Wfloat-equal\"") \ _Pragma("clang diagnostic ignored \"-Wchar-subscripts\"")
_Pragma("clang diagnostic ignored \"-Wdouble-promotion\"") #define TOML_DISABLE_SHADOW_WARNINGS _Pragma("clang diagnostic ignored \"-Wshadow\"")
#define TOML_DISABLE_SHADOW_WARNINGS _Pragma("clang diagnostic ignored \"-Wshadow\"") #define TOML_DISABLE_MISC_WARNINGS _Pragma("clang diagnostic ignored \"-Wweak-vtables\"") \
#define TOML_DISABLE_ALL_WARNINGS _Pragma("clang diagnostic ignored \"-Weverything\"") _Pragma("clang diagnostic ignored \"-Wweak-template-vtables\"")
#define TOML_POP_WARNINGS _Pragma("clang diagnostic pop") #define TOML_DISABLE_ALL_WARNINGS _Pragma("clang diagnostic ignored \"-Weverything\"")
#define TOML_POP_WARNINGS _Pragma("clang diagnostic pop")
#define TOML_ASSUME(cond) __builtin_assume(cond) #define TOML_ASSUME(cond) __builtin_assume(cond)
#define TOML_UNREACHABLE __builtin_unreachable() #define TOML_UNREACHABLE __builtin_unreachable()
#define TOML_ATTR(...) __attribute__((__VA_ARGS__)) #define TOML_ATTR(...) __attribute__((__VA_ARGS__))
#if defined(_MSC_VER) // msvc compat mode #if defined(_MSC_VER) // msvc compat mode
#ifdef __has_declspec_attribute #ifdef __has_declspec_attribute
#if __has_declspec_attribute(novtable) #if __has_declspec_attribute(novtable)
@ -159,29 +164,32 @@
#elif defined(__GNUC__) #elif defined(__GNUC__)
#define TOML_PUSH_WARNINGS _Pragma("GCC diagnostic push") #define TOML_PUSH_WARNINGS _Pragma("GCC diagnostic push")
#define TOML_DISABLE_SWITCH_WARNINGS _Pragma("GCC diagnostic ignored \"-Wswitch\"") \ #define TOML_DISABLE_SWITCH_WARNINGS _Pragma("GCC diagnostic ignored \"-Wswitch\"") \
_Pragma("GCC diagnostic ignored \"-Wswitch-enum\"") \ _Pragma("GCC diagnostic ignored \"-Wswitch-enum\"") \
_Pragma("GCC diagnostic ignored \"-Wswitch-default\"") _Pragma("GCC diagnostic ignored \"-Wswitch-default\"")
#define TOML_DISABLE_INIT_WARNINGS _Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"") \ #define TOML_DISABLE_INIT_WARNINGS _Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"") \
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") \ _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") \
_Pragma("GCC diagnostic ignored \"-Wuninitialized\"") _Pragma("GCC diagnostic ignored \"-Wuninitialized\"")
#define TOML_DISABLE_PADDING_WARNINGS _Pragma("GCC diagnostic ignored \"-Wpadded\"") #define TOML_DISABLE_PADDING_WARNINGS _Pragma("GCC diagnostic ignored \"-Wpadded\"")
#define TOML_DISABLE_FLOAT_WARNINGS _Pragma("GCC diagnostic ignored \"-Wfloat-equal\"") #define TOML_DISABLE_ARITHMETIC_WARNINGS _Pragma("GCC diagnostic ignored \"-Wfloat-equal\"") \
#define TOML_DISABLE_SHADOW_WARNINGS _Pragma("GCC diagnostic ignored \"-Wshadow\"") _Pragma("GCC diagnostic ignored \"-Wsign-conversion\"") \
#define TOML_DISABLE_SUGGEST_WARNINGS _Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") \ _Pragma("GCC diagnostic ignored \"-Wchar-subscripts\"")
_Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=pure\"") #define TOML_DISABLE_SHADOW_WARNINGS _Pragma("GCC diagnostic ignored \"-Wshadow\"")
#define TOML_DISABLE_ALL_WARNINGS _Pragma("GCC diagnostic ignored \"-Wall\"") \ #define TOML_DISABLE_SUGGEST_WARNINGS _Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") \
_Pragma("GCC diagnostic ignored \"-Wextra\"") \ _Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=pure\"")
_Pragma("GCC diagnostic ignored \"-Wchar-subscripts\"") \ #define TOML_DISABLE_MISC_WARNINGS _Pragma("GCC diagnostic ignored \"-Wcomment\"") \
_Pragma("GCC diagnostic ignored \"-Wtype-limits\"") \ _Pragma("GCC diagnostic ignored \"-Wtype-limits\"")
TOML_DISABLE_SUGGEST_WARNINGS \ #define TOML_DISABLE_ALL_WARNINGS _Pragma("GCC diagnostic ignored \"-Wall\"") \
TOML_DISABLE_SWITCH_WARNINGS \ _Pragma("GCC diagnostic ignored \"-Wextra\"") \
TOML_DISABLE_INIT_WARNINGS \ TOML_DISABLE_SWITCH_WARNINGS \
TOML_DISABLE_PADDING_WARNINGS \ TOML_DISABLE_INIT_WARNINGS \
TOML_DISABLE_FLOAT_WARNINGS \ TOML_DISABLE_PADDING_WARNINGS \
TOML_DISABLE_SHADOW_WARNINGS TOML_DISABLE_ARITHMETIC_WARNINGS \
#define TOML_POP_WARNINGS _Pragma("GCC diagnostic pop") TOML_DISABLE_SHADOW_WARNINGS \
TOML_DISABLE_SUGGEST_WARNINGS \
TOML_DISABLE_MISC_WARNINGS
#define TOML_POP_WARNINGS _Pragma("GCC diagnostic pop")
#define TOML_ATTR(...) __attribute__((__VA_ARGS__)) #define TOML_ATTR(...) __attribute__((__VA_ARGS__))
#ifndef TOML_ALWAYS_INLINE #ifndef TOML_ALWAYS_INLINE
@ -269,14 +277,14 @@
#ifndef TOML_DISABLE_INIT_WARNINGS #ifndef TOML_DISABLE_INIT_WARNINGS
#define TOML_DISABLE_INIT_WARNINGS #define TOML_DISABLE_INIT_WARNINGS
#endif #endif
#ifndef TOML_DISABLE_VTABLE_WARNINGS #ifndef TOML_DISABLE_MISC_WARNINGS
#define TOML_DISABLE_VTABLE_WARNINGS #define TOML_DISABLE_MISC_WARNINGS
#endif #endif
#ifndef TOML_DISABLE_PADDING_WARNINGS #ifndef TOML_DISABLE_PADDING_WARNINGS
#define TOML_DISABLE_PADDING_WARNINGS #define TOML_DISABLE_PADDING_WARNINGS
#endif #endif
#ifndef TOML_DISABLE_FLOAT_WARNINGS #ifndef TOML_DISABLE_ARITHMETIC_WARNINGS
#define TOML_DISABLE_FLOAT_WARNINGS #define TOML_DISABLE_ARITHMETIC_WARNINGS
#endif #endif
#ifndef TOML_DISABLE_SHADOW_WARNINGS #ifndef TOML_DISABLE_SHADOW_WARNINGS
#define TOML_DISABLE_SHADOW_WARNINGS #define TOML_DISABLE_SHADOW_WARNINGS
@ -365,16 +373,6 @@
__VA_ARGS__ [[nodiscard]] friend bool operator != (RHS rhs, LHS lhs) noexcept { return !(lhs == rhs); } __VA_ARGS__ [[nodiscard]] friend bool operator != (RHS rhs, LHS lhs) noexcept { return !(lhs == rhs); }
#endif #endif
#if TOML_ALL_INLINE
#define TOML_EXTERNAL_LINKAGE inline
#define TOML_INTERNAL_LINKAGE inline
#define TOML_INTERNAL_NAMESPACE toml::impl
#else
#define TOML_EXTERNAL_LINKAGE
#define TOML_INTERNAL_LINKAGE static
#define TOML_INTERNAL_NAMESPACE
#endif
#include "toml_version.h" #include "toml_version.h"
//# {{ //# {{
#define TOML_LIB_SINGLE_HEADER 0 #define TOML_LIB_SINGLE_HEADER 0
@ -406,18 +404,35 @@
#define TOML_EVAL_BOOL_1(T, F) T #define TOML_EVAL_BOOL_1(T, F) T
#define TOML_EVAL_BOOL_0(T, F) F #define TOML_EVAL_BOOL_0(T, F) F
#if TOML_DOXYGEN || defined(__INTELLISENSE__) #if TOML_DOXYGEN // || defined(__INTELLISENSE__)
#define TOML_ABI_NAMESPACES 0 #define TOML_ABI_NAMESPACES 0
#define TOML_ABI_NAMESPACE_BOOL(cond, T, F)
#define TOML_ABI_NAMESPACE_START(name) #define TOML_ABI_NAMESPACE_START(name)
#define TOML_ABI_NAMESPACE_VERSION
#define TOML_ABI_NAMESPACE_BOOL(cond, T, F)
#define TOML_ABI_NAMESPACE_END #define TOML_ABI_NAMESPACE_END
#else #else
#define TOML_ABI_NAMESPACES 1 #define TOML_ABI_NAMESPACES 1
#define TOML_ABI_NAMESPACE_START(name) inline namespace TOML_CONCAT(abi_, name) { #define TOML_ABI_NAMESPACE_START(name) inline namespace name {
#define TOML_ABI_NAMESPACE_VERSION TOML_ABI_NAMESPACE_START(TOML_CONCAT(v, TOML_LIB_MAJOR))
#define TOML_ABI_NAMESPACE_BOOL(cond, T, F) TOML_ABI_NAMESPACE_START(TOML_CONCAT(TOML_EVAL_BOOL_, cond)(T, F)) #define TOML_ABI_NAMESPACE_BOOL(cond, T, F) TOML_ABI_NAMESPACE_START(TOML_CONCAT(TOML_EVAL_BOOL_, cond)(T, F))
#define TOML_ABI_NAMESPACE_END } #define TOML_ABI_NAMESPACE_END }
#endif #endif
#define TOML_IMPL_NAMESPACE_START TOML_ABI_NAMESPACE_VERSION namespace impl {
#define TOML_IMPL_NAMESPACE_END } TOML_ABI_NAMESPACE_END
#if TOML_ALL_INLINE
#define TOML_EXTERNAL_LINKAGE inline
#define TOML_INTERNAL_LINKAGE inline
#define TOML_ANONYMOUS_NAMESPACE toml { TOML_ABI_NAMESPACE_VERSION namespace impl
#define TOML_ANONYMOUS_NAMESPACE_END } TOML_ABI_NAMESPACE_END
#else
#define TOML_EXTERNAL_LINKAGE
#define TOML_INTERNAL_LINKAGE static
#define TOML_ANONYMOUS_NAMESPACE
#define TOML_ANONYMOUS_NAMESPACE_END
#endif
TOML_PUSH_WARNINGS TOML_PUSH_WARNINGS
TOML_DISABLE_ALL_WARNINGS TOML_DISABLE_ALL_WARNINGS
#ifndef TOML_ASSERT #ifndef TOML_ASSERT
@ -430,12 +445,6 @@ TOML_DISABLE_ALL_WARNINGS
#endif #endif
TOML_POP_WARNINGS TOML_POP_WARNINGS
#if TOML_CHAR_8_STRINGS
#define TOML_STRING_PREFIX(S) TOML_CONCAT(u8, S)
#else
#define TOML_STRING_PREFIX(S) S
#endif
//# {{ //# {{
#if TOML_DOXYGEN #if TOML_DOXYGEN
@ -476,11 +485,6 @@ TOML_POP_WARNINGS
/// \detail Defaults to the standard C `assert()`. /// \detail Defaults to the standard C `assert()`.
/// \def TOML_CHAR_8_STRINGS
/// \brief Uses C++20 char8_t-based strings as the toml string data type.
/// \detail Defaults to `0`.
#define TOML_CONFIG_HEADER #define TOML_CONFIG_HEADER
/// \def TOML_CONFIG_HEADER /// \def TOML_CONFIG_HEADER
/// \brief An additional header to include before any other toml++ header files. /// \brief An additional header to include before any other toml++ header files.
@ -543,10 +547,9 @@ TOML_POP_WARNINGS
/// when building for Windows. /// when building for Windows.
/// \detail Defaults to `1` when building for Windows, `0` otherwise. Has no effect when building for anything other /// \detail Defaults to `1` when building for Windows, `0` otherwise. Has no effect when building for anything other
/// than Windows. /// than Windows.
/// \attention This <strong>does not</strong> change the underlying string type used to represent TOML keys and string values; /// \attention This <strong>does not</strong> change the underlying string type used to represent TOML keys and string
/// that will still be std::string or std::u8string according to whatever #TOML_CHAR_8_STRINGS is set to. /// values; that will still be std::string. This setting simply enables some narrow &lt;=&gt; wide string
/// This setting simply enables some narrow &lt;=&gt; wide string conversions when necessary at /// conversions when necessary at various interface boundaries.
/// various interface boundaries.
/// <br><br> /// <br><br>
/// If you're building for Windows and you have no need for Windows' "Pretends-to-be-unicode" wide strings, /// If you're building for Windows and you have no need for Windows' "Pretends-to-be-unicode" wide strings,
/// you can safely set this to `0`. /// you can safely set this to `0`.

View File

@ -19,8 +19,10 @@ TOML_DISABLE_ALL_WARNINGS
#endif #endif
TOML_POP_WARNINGS TOML_POP_WARNINGS
namespace toml::impl namespace toml
{ {
TOML_IMPL_NAMESPACE_START
// Q: "why does print_to_stream() exist? why not just use ostream::write(), ostream::put() etc?" // Q: "why does print_to_stream() exist? why not just use ostream::write(), ostream::put() etc?"
// A: - I'm supporting C++20's char8_t as well; wrapping streams allows switching string modes transparently. // A: - I'm supporting C++20's char8_t as well; wrapping streams allows switching string modes transparently.
// - I'm using <charconv> to format numerics. Faster and locale-independent. // - I'm using <charconv> to format numerics. Faster and locale-independent.
@ -142,8 +144,7 @@ namespace toml::impl
#undef TOML_P2S_OVERLOAD #undef TOML_P2S_OVERLOAD
template <typename T, typename Char> template <typename T, typename Char>
TOML_EXTERNAL_LINKAGE inline void print_floating_point_to_stream(T val, std::basic_ostream<Char>& stream, bool hexfloat = false)
void print_floating_point_to_stream(T val, std::basic_ostream<Char>& stream, bool hexfloat = false)
{ {
static_assert( static_assert(
sizeof(Char) == 1, sizeof(Char) == 1,
@ -330,7 +331,7 @@ namespace toml::impl
} }
TOML_PUSH_WARNINGS TOML_PUSH_WARNINGS
TOML_DISABLE_ALL_WARNINGS TOML_DISABLE_ARITHMETIC_WARNINGS
template <typename T, typename Char> template <typename T, typename Char>
void print_to_stream_with_escapes(T && str, std::basic_ostream<Char>& stream) void print_to_stream_with_escapes(T && str, std::basic_ostream<Char>& stream)
@ -338,25 +339,28 @@ namespace toml::impl
static_assert(sizeof(Char) == 1); static_assert(sizeof(Char) == 1);
for (auto c : str) for (auto c : str)
{ {
if TOML_UNLIKELY(c >= TOML_STRING_PREFIX('\x00') && c <= TOML_STRING_PREFIX('\x1F')) if TOML_UNLIKELY(c >= '\x00' && c <= '\x1F')
print_to_stream(low_character_escape_table[c], stream); print_to_stream(low_character_escape_table[c], stream);
else if TOML_UNLIKELY(c == TOML_STRING_PREFIX('\x7F')) else if TOML_UNLIKELY(c == '\x7F')
print_to_stream(TOML_STRING_PREFIX("\\u007F"sv), stream); print_to_stream("\\u007F"sv, stream);
else if TOML_UNLIKELY(c == TOML_STRING_PREFIX('"')) else if TOML_UNLIKELY(c == '"')
print_to_stream(TOML_STRING_PREFIX("\\\""sv), stream); print_to_stream("\\\""sv, stream);
else if TOML_UNLIKELY(c == TOML_STRING_PREFIX('\\')) else if TOML_UNLIKELY(c == '\\')
print_to_stream(TOML_STRING_PREFIX("\\\\"sv), stream); print_to_stream("\\\\"sv, stream);
else else
print_to_stream(c, stream); print_to_stream(c, stream);
} }
} }
TOML_POP_WARNINGS TOML_POP_WARNINGS
}
TOML_IMPL_NAMESPACE_END
}
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
/// \brief Prints a source_position to a stream. /// \brief Prints a source_position to a stream.
/// ///
/// \detail \cpp /// \detail \cpp
@ -378,8 +382,7 @@ namespace toml
/// ///
/// \returns The input stream. /// \returns The input stream.
template <typename Char> template <typename Char>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const source_position& rhs)
std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const source_position& rhs)
{ {
static_assert( static_assert(
sizeof(Char) == 1, sizeof(Char) == 1,
@ -413,8 +416,7 @@ namespace toml
/// ///
/// \returns The input stream. /// \returns The input stream.
template <typename Char> template <typename Char>
TOML_EXTERNAL_LINKAGE inline std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const source_region& rhs)
std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const source_region& rhs)
{ {
static_assert( static_assert(
sizeof(Char) == 1, sizeof(Char) == 1,
@ -434,4 +436,6 @@ namespace toml
extern template TOML_API std::ostream& operator << (std::ostream&, const source_position&); extern template TOML_API std::ostream& operator << (std::ostream&, const source_position&);
extern template TOML_API std::ostream& operator << (std::ostream&, const source_region&); extern template TOML_API std::ostream& operator << (std::ostream&, const source_region&);
#endif #endif
TOML_ABI_NAMESPACE_END // version
} }

View File

@ -7,17 +7,19 @@
#include "toml_array.h" #include "toml_array.h"
TOML_PUSH_WARNINGS TOML_PUSH_WARNINGS
TOML_DISABLE_VTABLE_WARNINGS TOML_DISABLE_MISC_WARNINGS
TOML_DISABLE_PADDING_WARNINGS TOML_DISABLE_PADDING_WARNINGS
namespace toml::impl namespace toml
{ {
TOML_IMPL_NAMESPACE_START
template <bool IsConst> template <bool IsConst>
struct table_proxy_pair final struct table_proxy_pair final
{ {
using value_type = std::conditional_t<IsConst, const node, node>; using value_type = std::conditional_t<IsConst, const node, node>;
const string& first; const std::string& first;
value_type& second; value_type& second;
}; };
@ -132,33 +134,38 @@ namespace toml::impl
return lhs.raw_ != rhs.raw_; return lhs.raw_ != rhs.raw_;
} }
TOML_PUSH_WARNINGS
TOML_DISABLE_ALL_WARNINGS
template <bool C = IsConst, typename = std::enable_if_t<!C>> template <bool C = IsConst, typename = std::enable_if_t<!C>>
[[nodiscard]] [[nodiscard]]
operator table_iterator<true>() const noexcept operator table_iterator<true>() const noexcept
{ {
return table_iterator<true>{ raw_ }; return table_iterator<true>{ raw_ };
} }
TOML_POP_WARNINGS
}; };
struct table_init_pair final struct table_init_pair final
{ {
string key; std::string key;
std::unique_ptr<node> value; std::unique_ptr<node> value;
template <typename V> template <typename V>
table_init_pair(string&& k, V&& v) noexcept table_init_pair(std::string&& k, V&& v) noexcept
: key{ std::move(k) }, : key{ std::move(k) },
value{ make_node(std::forward<V>(v)) } value{ make_node(std::forward<V>(v)) }
{} {}
template <typename V> template <typename V>
table_init_pair(string_view k, V&& v) noexcept table_init_pair(std::string_view k, V&& v) noexcept
: key{ k }, : key{ k },
value{ make_node(std::forward<V>(v)) } value{ make_node(std::forward<V>(v)) }
{} {}
template <typename V> template <typename V>
table_init_pair(const string_char* k, V&& v) noexcept table_init_pair(const char* k, V&& v) noexcept
: key{ k }, : key{ k },
value{ make_node(std::forward<V>(v)) } value{ make_node(std::forward<V>(v)) }
{} {}
@ -185,10 +192,14 @@ namespace toml::impl
#endif #endif
}; };
TOML_IMPL_NAMESPACE_END
} }
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
[[nodiscard]] TOML_API bool operator == (const table& lhs, const table& rhs) noexcept; [[nodiscard]] TOML_API bool operator == (const table& lhs, const table& rhs) noexcept;
[[nodiscard]] TOML_API bool operator != (const table& lhs, const table& rhs) noexcept; [[nodiscard]] TOML_API bool operator != (const table& lhs, const table& rhs) noexcept;
template <typename Char> template <typename Char>
@ -338,7 +349,7 @@ namespace toml
/// <strong>This is not an error.</strong> /// <strong>This is not an error.</strong>
/// ///
/// \see toml::node_view /// \see toml::node_view
[[nodiscard]] node_view<node> operator[] (string_view key) noexcept; [[nodiscard]] node_view<node> operator[] (std::string_view key) noexcept;
/// \brief Gets a node_view for the selected key-value pair (const overload). /// \brief Gets a node_view for the selected key-value pair (const overload).
/// ///
@ -351,7 +362,7 @@ namespace toml
/// <strong>This is not an error.</strong> /// <strong>This is not an error.</strong>
/// ///
/// \see toml::node_view /// \see toml::node_view
[[nodiscard]] node_view<const node> operator[] (string_view key) const noexcept; [[nodiscard]] node_view<const node> operator[] (std::string_view key) const noexcept;
#if TOML_WINDOWS_COMPAT #if TOML_WINDOWS_COMPAT
@ -434,7 +445,7 @@ namespace toml
/// { a = 1, b = 2, c = 3, d = 42 } /// { a = 1, b = 2, c = 3, d = 42 }
/// \eout /// \eout
/// ///
/// \tparam K toml::string (or a type convertible to it). /// \tparam K std::string (or a type convertible to it).
/// \tparam V One of the TOML value types (or a type promotable to one). /// \tparam V One of the TOML value types (or a type promotable to one).
/// \param key The key at which to insert the new value. /// \param key The key at which to insert the new value.
/// \param val The new value to insert. /// \param val The new value to insert.
@ -443,7 +454,7 @@ namespace toml
/// - An iterator to the insertion position (or the position of the value that prevented insertion) /// - An iterator to the insertion position (or the position of the value that prevented insertion)
/// - A boolean indicating if the insertion was successful. /// - A boolean indicating if the insertion was successful.
template <typename K, typename V, typename = std::enable_if_t< template <typename K, typename V, typename = std::enable_if_t<
std::is_convertible_v<K&&, string_view> std::is_convertible_v<K&&, std::string_view>
|| impl::is_wide_string<K> || impl::is_wide_string<K>
>> >>
std::pair<iterator, bool> insert(K&& key, V&& val) noexcept std::pair<iterator, bool> insert(K&& key, V&& val) noexcept
@ -483,7 +494,7 @@ namespace toml
/// }}; /// }};
/// std::cout << tbl << std::endl; /// std::cout << tbl << std::endl;
/// ///
/// auto kvps = std::array<std::pair<toml::string, int>>{{ /// auto kvps = std::array<std::pair<std::string, int>>{{
/// { "d", 42 }, /// { "d", 42 },
/// { "a", 43 } /// { "a", 43 }
/// }}; /// }};
@ -505,7 +516,7 @@ namespace toml
/// key-value pair covered by the iterator range, so any values with keys already found in the /// key-value pair covered by the iterator range, so any values with keys already found in the
/// table will not be replaced. /// table will not be replaced.
template <typename Iter, typename = std::enable_if_t< template <typename Iter, typename = std::enable_if_t<
!std::is_convertible_v<Iter, string_view> !std::is_convertible_v<Iter, std::string_view>
&& !impl::is_wide_string<Iter> && !impl::is_wide_string<Iter>
>> >>
void insert(Iter first, Iter last) noexcept void insert(Iter first, Iter last) noexcept
@ -548,7 +559,7 @@ namespace toml
/// { a = 42, b = 2, c = 3, d = 42 } /// { a = 42, b = 2, c = 3, d = 42 }
/// \eout /// \eout
/// ///
/// \tparam K toml::string (or a type convertible to it). /// \tparam K std::string (or a type convertible to it).
/// \tparam V One of the TOML value types (or a type promotable to one). /// \tparam V One of the TOML value types (or a type promotable to one).
/// \param key The key at which to insert or assign the value. /// \param key The key at which to insert or assign the value.
/// \param val The value to insert/assign. /// \param val The value to insert/assign.
@ -616,7 +627,7 @@ namespace toml
/// \eout /// \eout
/// ///
/// \tparam U One of the TOML node or value types. /// \tparam U One of the TOML node or value types.
/// \tparam K toml::string (or a type convertible to it). /// \tparam K std::string (or a type convertible to it).
/// \tparam V Value constructor argument types. /// \tparam V Value constructor argument types.
/// \param key The key at which to emplace the new value. /// \param key The key at which to emplace the new value.
/// \param args Arguments to forward to the value's constructor. /// \param args Arguments to forward to the value's constructor.
@ -647,7 +658,7 @@ namespace toml
using type = impl::unwrap_node<U>; using type = impl::unwrap_node<U>;
static_assert( static_assert(
impl::is_native<type> || impl::is_one_of<type, table, array>, (impl::is_native<type> || impl::is_one_of<type, table, array>) && !impl::is_cvref<type>,
"The emplacement type argument of table::emplace() must be one of the following:" "The emplacement type argument of table::emplace() must be one of the following:"
TOML_UNWRAPPED_NODE_TYPE_LIST TOML_UNWRAPPED_NODE_TYPE_LIST
); );
@ -769,7 +780,7 @@ namespace toml
/// \param key Key to erase. /// \param key Key to erase.
/// ///
/// \returns True if any values with matching keys were found and erased. /// \returns True if any values with matching keys were found and erased.
bool erase(string_view key) noexcept; bool erase(std::string_view key) noexcept;
#if TOML_WINDOWS_COMPAT #if TOML_WINDOWS_COMPAT
@ -787,7 +798,8 @@ namespace toml
private: private:
template <typename Map, typename Key> template <typename Map, typename Key>
[[nodiscard]] static auto do_get(Map& vals, const Key& key) noexcept [[nodiscard]]
static auto do_get(Map& vals, const Key& key) noexcept
-> std::conditional_t<std::is_const_v<Map>, const node*, node*> -> std::conditional_t<std::is_const_v<Map>, const node*, node*>
{ {
static_assert( static_assert(
@ -812,14 +824,16 @@ namespace toml
} }
template <typename T, typename Map, typename Key> template <typename T, typename Map, typename Key>
[[nodiscard]] static auto do_get_as(Map& vals, const Key& key) noexcept [[nodiscard]]
static auto do_get_as(Map& vals, const Key& key) noexcept
{ {
const auto node = do_get(vals, key); const auto node = do_get(vals, key);
return node ? node->template as<T>() : nullptr; return node ? node->template as<T>() : nullptr;
} }
template <typename Map, typename Key> template <typename Map, typename Key>
[[nodiscard]] TOML_ALWAYS_INLINE [[nodiscard]]
TOML_ALWAYS_INLINE
static bool do_contains(Map& vals, const Key& key) noexcept static bool do_contains(Map& vals, const Key& key) noexcept
{ {
return do_get(vals, key) != nullptr; return do_get(vals, key) != nullptr;
@ -852,31 +866,31 @@ namespace toml
/// \param key The node's key. /// \param key The node's key.
/// ///
/// \returns A pointer to the node at the specified key, or nullptr. /// \returns A pointer to the node at the specified key, or nullptr.
[[nodiscard]] node* get(string_view key) noexcept; [[nodiscard]] node* get(std::string_view key) noexcept;
/// \brief Gets the node at a specific key (const overload). /// \brief Gets the node at a specific key (const overload).
/// ///
/// \param key The node's key. /// \param key The node's key.
/// ///
/// \returns A pointer to the node at the specified key, or nullptr. /// \returns A pointer to the node at the specified key, or nullptr.
[[nodiscard]] const node* get(string_view key) const noexcept; [[nodiscard]] const node* get(std::string_view key) const noexcept;
/// \brief Gets an iterator to the node at a specific key. /// \brief Gets an iterator to the node at a specific key.
/// ///
/// \param key The node's key. /// \param key The node's key.
/// ///
/// \returns An iterator to the node at the specified key, or end(). /// \returns An iterator to the node at the specified key, or end().
[[nodiscard]] iterator find(string_view key) noexcept; [[nodiscard]] iterator find(std::string_view key) noexcept;
/// \brief Gets an iterator to the node at a specific key (const overload) /// \brief Gets an iterator to the node at a specific key (const overload)
/// ///
/// \param key The node's key. /// \param key The node's key.
/// ///
/// \returns A const iterator to the node at the specified key, or cend(). /// \returns A const iterator to the node at the specified key, or cend().
[[nodiscard]] const_iterator find(string_view key) const noexcept; [[nodiscard]] const_iterator find(std::string_view key) const noexcept;
/// \brief Returns true if the table contains a node at the given key. /// \brief Returns true if the table contains a node at the given key.
[[nodiscard]] bool contains(string_view key) const noexcept; [[nodiscard]] bool contains(std::string_view key) const noexcept;
#if TOML_WINDOWS_COMPAT #if TOML_WINDOWS_COMPAT
@ -944,7 +958,8 @@ namespace toml
/// ///
/// \returns A pointer to the node at the specified key if it was of the given type, or nullptr. /// \returns A pointer to the node at the specified key if it was of the given type, or nullptr.
template <typename T> template <typename T>
[[nodiscard]] impl::wrap_node<T>* get_as(string_view key) noexcept [[nodiscard]]
impl::wrap_node<T>* get_as(std::string_view key) noexcept
{ {
return do_get_as<T>(values, key); return do_get_as<T>(values, key);
} }
@ -956,7 +971,8 @@ namespace toml
/// ///
/// \returns A pointer to the node at the specified key if it was of the given type, or nullptr. /// \returns A pointer to the node at the specified key if it was of the given type, or nullptr.
template <typename T> template <typename T>
[[nodiscard]] const impl::wrap_node<T>* get_as(string_view key) const noexcept [[nodiscard]]
const impl::wrap_node<T>* get_as(std::string_view key) const noexcept
{ {
return do_get_as<T>(values, key); return do_get_as<T>(values, key);
} }
@ -972,7 +988,8 @@ namespace toml
/// ///
/// \attention This overload is only available when #TOML_WINDOWS_COMPAT is enabled. /// \attention This overload is only available when #TOML_WINDOWS_COMPAT is enabled.
template <typename T> template <typename T>
[[nodiscard]] impl::wrap_node<T>* get_as(std::wstring_view key) noexcept [[nodiscard]]
impl::wrap_node<T>* get_as(std::wstring_view key) noexcept
{ {
return get_as<T>(impl::narrow(key)); return get_as<T>(impl::narrow(key));
} }
@ -986,7 +1003,8 @@ namespace toml
/// ///
/// \attention This overload is only available when #TOML_WINDOWS_COMPAT is enabled. /// \attention This overload is only available when #TOML_WINDOWS_COMPAT is enabled.
template <typename T> template <typename T>
[[nodiscard]] const impl::wrap_node<T>* get_as(std::wstring_view key) const noexcept [[nodiscard]]
const impl::wrap_node<T>* get_as(std::wstring_view key) const noexcept
{ {
return get_as<T>(impl::narrow(key)); return get_as<T>(impl::narrow(key));
} }
@ -1013,6 +1031,8 @@ namespace toml
template <typename Char> template <typename Char>
friend std::basic_ostream<Char>& operator << (std::basic_ostream<Char>&, const table&); friend std::basic_ostream<Char>& operator << (std::basic_ostream<Char>&, const table&);
}; };
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS // TOML_DISABLE_VTABLE_WARNINGS, TOML_DISABLE_PADDING_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_MISC_WARNINGS, TOML_DISABLE_PADDING_WARNINGS

View File

@ -19,6 +19,8 @@ TOML_DISABLE_SUGGEST_WARNINGS
namespace toml namespace toml
{ {
TOML_ABI_NAMESPACE_VERSION
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
table::table(impl::table_init_pair* pairs, size_t count) noexcept table::table(impl::table_init_pair* pairs, size_t count) noexcept
{ {
@ -76,12 +78,12 @@ namespace toml
#undef TOML_MEMBER_ATTR #undef TOML_MEMBER_ATTR
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
node_view<node> table::operator[] (string_view key) noexcept node_view<node> table::operator[] (std::string_view key) noexcept
{ {
return { this->get(key) }; return { this->get(key) };
} }
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
node_view<const node> table::operator[] (string_view key) const noexcept node_view<const node> table::operator[] (std::string_view key) const noexcept
{ {
return { this->get(key) }; return { this->get(key) };
} }
@ -105,7 +107,7 @@ namespace toml
} }
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
bool table::erase(string_view key) noexcept bool table::erase(std::string_view key) noexcept
{ {
if (auto it = values.find(key); it != values.end()) if (auto it = values.find(key); it != values.end())
{ {
@ -116,31 +118,31 @@ namespace toml
} }
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
node* table::get(string_view key) noexcept node* table::get(std::string_view key) noexcept
{ {
return do_get(values, key); return do_get(values, key);
} }
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
const node* table::get(string_view key) const noexcept const node* table::get(std::string_view key) const noexcept
{ {
return do_get(values, key); return do_get(values, key);
} }
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
table::iterator table::find(string_view key) noexcept table::iterator table::find(std::string_view key) noexcept
{ {
return { values.find(key) }; return { values.find(key) };
} }
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
table::const_iterator table::find(string_view key) const noexcept table::const_iterator table::find(std::string_view key) const noexcept
{ {
return { values.find(key) }; return { values.find(key) };
} }
TOML_EXTERNAL_LINKAGE TOML_EXTERNAL_LINKAGE
bool table::contains(string_view key) const noexcept bool table::contains(std::string_view key) const noexcept
{ {
return do_contains(values, key); return do_contains(values, key);
} }
@ -232,6 +234,8 @@ namespace toml
{ {
return !(lhs == rhs); return !(lhs == rhs);
} }
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS // TOML_DISABLE_SUGGEST_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_SUGGEST_WARNINGS

View File

@ -7,8 +7,10 @@
#pragma once #pragma once
#include "toml_utf8_generated.h" #include "toml_utf8_generated.h"
namespace toml::impl namespace toml
{ {
TOML_IMPL_NAMESPACE_START
template <typename... T> template <typename... T>
[[nodiscard]] [[nodiscard]]
TOML_ATTR(const) TOML_ATTR(const)
@ -20,7 +22,6 @@ namespace toml::impl
[[nodiscard]] [[nodiscard]]
TOML_ATTR(const) TOML_ATTR(const)
TOML_ALWAYS_INLINE
constexpr bool is_ascii_whitespace(char32_t codepoint) noexcept constexpr bool is_ascii_whitespace(char32_t codepoint) noexcept
{ {
return codepoint == U'\t' || codepoint == U' '; return codepoint == U'\t' || codepoint == U' ';
@ -52,7 +53,6 @@ namespace toml::impl
template <bool IncludeCarriageReturn = true> template <bool IncludeCarriageReturn = true>
[[nodiscard]] [[nodiscard]]
TOML_ATTR(const) TOML_ATTR(const)
TOML_ALWAYS_INLINE
constexpr bool is_ascii_line_break(char32_t codepoint) noexcept constexpr bool is_ascii_line_break(char32_t codepoint) noexcept
{ {
constexpr auto low_range_end = IncludeCarriageReturn ? U'\r' : U'\f'; constexpr auto low_range_end = IncludeCarriageReturn ? U'\r' : U'\f';
@ -82,7 +82,6 @@ namespace toml::impl
[[nodiscard]] [[nodiscard]]
TOML_ATTR(const) TOML_ATTR(const)
TOML_ALWAYS_INLINE
constexpr bool is_string_delimiter(char32_t codepoint) noexcept constexpr bool is_string_delimiter(char32_t codepoint) noexcept
{ {
return codepoint == U'"' || codepoint == U'\''; return codepoint == U'"' || codepoint == U'\'';
@ -90,7 +89,6 @@ namespace toml::impl
[[nodiscard]] [[nodiscard]]
TOML_ATTR(const) TOML_ATTR(const)
TOML_ALWAYS_INLINE
constexpr bool is_ascii_letter(char32_t codepoint) noexcept constexpr bool is_ascii_letter(char32_t codepoint) noexcept
{ {
return (codepoint >= U'a' && codepoint <= U'z') return (codepoint >= U'a' && codepoint <= U'z')
@ -99,7 +97,6 @@ namespace toml::impl
[[nodiscard]] [[nodiscard]]
TOML_ATTR(const) TOML_ATTR(const)
TOML_ALWAYS_INLINE
constexpr bool is_binary_digit(char32_t codepoint) noexcept constexpr bool is_binary_digit(char32_t codepoint) noexcept
{ {
return codepoint == U'0' || codepoint == U'1'; return codepoint == U'0' || codepoint == U'1';
@ -107,7 +104,6 @@ namespace toml::impl
[[nodiscard]] [[nodiscard]]
TOML_ATTR(const) TOML_ATTR(const)
TOML_ALWAYS_INLINE
constexpr bool is_octal_digit(char32_t codepoint) noexcept constexpr bool is_octal_digit(char32_t codepoint) noexcept
{ {
return (codepoint >= U'0' && codepoint <= U'7'); return (codepoint >= U'0' && codepoint <= U'7');
@ -115,7 +111,6 @@ namespace toml::impl
[[nodiscard]] [[nodiscard]]
TOML_ATTR(const) TOML_ATTR(const)
TOML_ALWAYS_INLINE
constexpr bool is_decimal_digit(char32_t codepoint) noexcept constexpr bool is_decimal_digit(char32_t codepoint) noexcept
{ {
return (codepoint >= U'0' && codepoint <= U'9'); return (codepoint >= U'0' && codepoint <= U'9');
@ -124,7 +119,6 @@ namespace toml::impl
template <typename T> template <typename T>
[[nodiscard]] [[nodiscard]]
TOML_ATTR(const) TOML_ATTR(const)
TOML_ALWAYS_INLINE
constexpr std::uint_least32_t hex_to_dec(const T codepoint) noexcept constexpr std::uint_least32_t hex_to_dec(const T codepoint) noexcept
{ {
if constexpr (std::is_same_v<remove_cvref_t<T>, std::uint_least32_t>) if constexpr (std::is_same_v<remove_cvref_t<T>, std::uint_least32_t>)
@ -170,7 +164,6 @@ namespace toml::impl
[[nodiscard]] [[nodiscard]]
TOML_ATTR(const) TOML_ATTR(const)
TOML_ALWAYS_INLINE
constexpr bool is_control_character(char32_t codepoint) noexcept constexpr bool is_control_character(char32_t codepoint) noexcept
{ {
return codepoint <= U'\u001F' || codepoint == U'\u007F'; return codepoint <= U'\u001F' || codepoint == U'\u007F';
@ -178,7 +171,6 @@ namespace toml::impl
[[nodiscard]] [[nodiscard]]
TOML_ATTR(const) TOML_ATTR(const)
TOML_ALWAYS_INLINE
constexpr bool is_nontab_control_character(char32_t codepoint) noexcept constexpr bool is_nontab_control_character(char32_t codepoint) noexcept
{ {
return codepoint <= U'\u0008' return codepoint <= U'\u0008'
@ -188,7 +180,6 @@ namespace toml::impl
[[nodiscard]] [[nodiscard]]
TOML_ATTR(const) TOML_ATTR(const)
TOML_ALWAYS_INLINE
constexpr bool is_unicode_surrogate(char32_t codepoint) noexcept constexpr bool is_unicode_surrogate(char32_t codepoint) noexcept
{ {
return codepoint >= 0xD800u && codepoint <= 0xDFFF; return codepoint >= 0xD800u && codepoint <= 0xDFFF;
@ -217,19 +208,19 @@ namespace toml::impl
12,36,12,12,12,12,12,12,12,12,12,12 12,36,12,12,12,12,12,12,12,12,12,12
}; };
[[nodiscard]] TOML_ALWAYS_INLINE [[nodiscard]]
constexpr bool error() const noexcept constexpr bool error() const noexcept
{ {
return state == uint_least32_t{ 12u }; return state == uint_least32_t{ 12u };
} }
[[nodiscard]] TOML_ALWAYS_INLINE [[nodiscard]]
constexpr bool has_code_point() const noexcept constexpr bool has_code_point() const noexcept
{ {
return state == uint_least32_t{}; return state == uint_least32_t{};
} }
[[nodiscard]] TOML_ALWAYS_INLINE [[nodiscard]]
constexpr bool needs_more_input() const noexcept constexpr bool needs_more_input() const noexcept
{ {
return state > uint_least32_t{} && state != uint_least32_t{ 12u }; return state > uint_least32_t{} && state != uint_least32_t{ 12u };
@ -250,5 +241,6 @@ namespace toml::impl
state = state_table[state + uint_least32_t{ 256u } + type]; state = state_table[state + uint_least32_t{ 256u } + type];
} }
}; };
}
TOML_IMPL_NAMESPACE_END
}

View File

@ -8,8 +8,10 @@
#pragma once #pragma once
#include "toml_preprocessor.h" #include "toml_preprocessor.h"
namespace toml::impl namespace toml
{ {
TOML_IMPL_NAMESPACE_START
//# Returns true if a codepoint matches any of: //# Returns true if a codepoint matches any of:
//# 0 - 9, A - F, a - f //# 0 - 9, A - F, a - f
[[nodiscard]] [[nodiscard]]
@ -753,4 +755,6 @@ namespace toml::impl
} }
#endif // TOML_LANG_UNRELEASED #endif // TOML_LANG_UNRELEASED
TOML_IMPL_NAMESPACE_END
} // toml::impl } // toml::impl

View File

@ -15,16 +15,19 @@
TOML_PUSH_WARNINGS TOML_PUSH_WARNINGS
TOML_DISABLE_PADDING_WARNINGS TOML_DISABLE_PADDING_WARNINGS
TOML_DISABLE_MISC_WARNINGS
namespace toml::impl namespace toml
{ {
TOML_IMPL_NAMESPACE_START
template <typename T> template <typename T>
class utf8_byte_stream; class utf8_byte_stream;
inline constexpr auto utf8_byte_order_mark = "\xEF\xBB\xBF"sv; inline constexpr auto utf8_byte_order_mark = "\xEF\xBB\xBF"sv;
template <typename Char> template <typename Char>
class utf8_byte_stream<std::basic_string_view<Char>> final class TOML_API utf8_byte_stream<std::basic_string_view<Char>> final
{ {
static_assert(sizeof(Char) == 1_sz); static_assert(sizeof(Char) == 1_sz);
@ -54,19 +57,22 @@ namespace toml::impl
position += 3_sz; position += 3_sz;
} }
[[nodiscard]] TOML_ALWAYS_INLINE [[nodiscard]]
TOML_ALWAYS_INLINE
constexpr bool eof() const noexcept constexpr bool eof() const noexcept
{ {
return position >= source.length(); return position >= source.length();
} }
[[nodiscard]] TOML_ALWAYS_INLINE [[nodiscard]]
TOML_ALWAYS_INLINE
constexpr bool peek_eof() const noexcept constexpr bool peek_eof() const noexcept
{ {
return eof(); return eof();
} }
[[nodiscard]] TOML_ALWAYS_INLINE [[nodiscard]]
TOML_ALWAYS_INLINE
constexpr bool error() const noexcept constexpr bool error() const noexcept
{ {
return false; return false;
@ -82,7 +88,7 @@ namespace toml::impl
}; };
template <typename Char> template <typename Char>
class utf8_byte_stream<std::basic_istream<Char>> final class TOML_API utf8_byte_stream<std::basic_istream<Char>> final
{ {
static_assert(sizeof(Char) == 1_sz); static_assert(sizeof(Char) == 1_sz);
@ -106,20 +112,23 @@ namespace toml::impl
source->seekg(initial_pos, std::ios::beg); source->seekg(initial_pos, std::ios::beg);
} }
[[nodiscard]] TOML_ALWAYS_INLINE [[nodiscard]]
TOML_ALWAYS_INLINE
bool eof() const noexcept bool eof() const noexcept
{ {
return source->eof(); return source->eof();
} }
[[nodiscard]] TOML_ALWAYS_INLINE [[nodiscard]]
TOML_ALWAYS_INLINE
bool peek_eof() const bool peek_eof() const
{ {
using stream_traits = typename std::remove_pointer_t<decltype(source)>::traits_type; using stream_traits = typename std::remove_pointer_t<decltype(source)>::traits_type;
return eof() || source->peek() == stream_traits::eof(); return eof() || source->peek() == stream_traits::eof();
} }
[[nodiscard]] TOML_ALWAYS_INLINE [[nodiscard]]
TOML_ALWAYS_INLINE
bool error() const noexcept bool error() const noexcept
{ {
return !(*source); return !(*source);
@ -135,71 +144,41 @@ namespace toml::impl
} }
}; };
TOML_ABI_NAMESPACE_BOOL(TOML_LARGE_FILES, impl_lf, impl_sf) TOML_ABI_NAMESPACE_BOOL(TOML_LARGE_FILES, lf, sf)
struct utf8_codepoint final struct utf8_codepoint final
{ {
char32_t value; char32_t value;
string_char bytes[4]; char bytes[4];
source_position position; source_position position;
template <typename Char = string_char>
[[nodiscard]] [[nodiscard]]
TOML_ALWAYS_INLINE std::string_view as_view() const noexcept
std::basic_string_view<Char> as_view() const noexcept
{ {
static_assert(
sizeof(Char) == 1,
"The string view's underlying character type must be 1 byte in size."
);
return bytes[3] return bytes[3]
? std::basic_string_view<Char>{ reinterpret_cast<const Char*>(bytes), 4_sz } ? std::string_view{ bytes, 4_sz }
: std::basic_string_view<Char>{ reinterpret_cast<const Char*>(bytes) }; : std::string_view{ bytes };
} }
[[nodiscard]] [[nodiscard]] TOML_ATTR(pure) constexpr operator char32_t& () noexcept { return value; }
TOML_ATTR(pure) [[nodiscard]] TOML_ATTR(pure) constexpr operator const char32_t& () const noexcept { return value; }
TOML_ALWAYS_INLINE [[nodiscard]] TOML_ATTR(pure) constexpr const char32_t& operator* () const noexcept { return value; }
constexpr operator char32_t& () noexcept
{
return value;
}
[[nodiscard]]
TOML_ATTR(pure)
TOML_ALWAYS_INLINE
constexpr operator const char32_t& () const noexcept
{
return value;
}
[[nodiscard]]
TOML_ATTR(pure)
TOML_ALWAYS_INLINE
constexpr const char32_t& operator* () const noexcept
{
return value;
}
}; };
static_assert(std::is_trivial_v<utf8_codepoint>); static_assert(std::is_trivial_v<utf8_codepoint>);
static_assert(std::is_standard_layout_v<utf8_codepoint>); static_assert(std::is_standard_layout_v<utf8_codepoint>);
TOML_ABI_NAMESPACE_END // TOML_LARGE_FILES TOML_ABI_NAMESPACE_END // TOML_LARGE_FILES
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, ex, noex)
#if TOML_EXCEPTIONS #if TOML_EXCEPTIONS
#define TOML_ERROR_CHECK (void)0 #define TOML_ERROR_CHECK (void)0
#define TOML_ERROR throw parse_error #define TOML_ERROR throw parse_error
TOML_ABI_NAMESPACE_START(impl_ex)
#else #else
#define TOML_ERROR_CHECK if (err) return nullptr #define TOML_ERROR_CHECK if (err) return nullptr
#define TOML_ERROR err.emplace #define TOML_ERROR err.emplace
TOML_ABI_NAMESPACE_START(impl_noex)
#endif #endif
TOML_PUSH_WARNINGS
TOML_DISABLE_VTABLE_WARNINGS
struct TOML_INTERFACE utf8_reader_interface struct TOML_INTERFACE utf8_reader_interface
{ {
[[nodiscard]] [[nodiscard]]
@ -222,7 +201,7 @@ namespace toml::impl
}; };
template <typename T> template <typename T>
class TOML_EMPTY_BASES utf8_reader final class TOML_EMPTY_BASES TOML_API utf8_reader final
: public utf8_reader_interface : public utf8_reader_interface
{ {
private: private:
@ -325,7 +304,7 @@ namespace toml::impl
TOML_ERROR_CHECK; TOML_ERROR_CHECK;
auto& current = codepoints[cp_idx % 2_sz]; auto& current = codepoints[cp_idx % 2_sz];
current.bytes[current_byte_count++] = static_cast<string_char>(next_byte); current.bytes[current_byte_count++] = static_cast<char>(next_byte);
if (decoder.has_code_point()) if (decoder.has_code_point())
{ {
//store codepoint //store codepoint
@ -372,12 +351,7 @@ namespace toml::impl
template <typename Char> template <typename Char>
utf8_reader(std::basic_istream<Char>&, std::string&&) -> utf8_reader<std::basic_istream<Char>>; utf8_reader(std::basic_istream<Char>&, std::string&&) -> utf8_reader<std::basic_istream<Char>>;
#if !TOML_EXCEPTIONS class TOML_EMPTY_BASES TOML_API utf8_buffered_reader final
#undef TOML_ERROR_CHECK
#define TOML_ERROR_CHECK if (reader.error()) return nullptr
#endif
class TOML_EMPTY_BASES utf8_buffered_reader final
: public utf8_reader_interface : public utf8_reader_interface
{ {
public: public:
@ -397,91 +371,19 @@ namespace toml::impl
size_t negative_offset = {}; size_t negative_offset = {};
public: public:
explicit utf8_buffered_reader(utf8_reader_interface& reader_) noexcept;
explicit utf8_buffered_reader(utf8_reader_interface& reader_) noexcept const source_path_ptr& source_path() const noexcept override;
: reader{ reader_ } const utf8_codepoint* read_next() override;
{} const utf8_codepoint* step_back(size_t count) noexcept;
bool peek_eof() const override;
[[nodiscard]]
const source_path_ptr& source_path() const noexcept override
{
return reader.source_path();
}
[[nodiscard]]
const utf8_codepoint* read_next() override
{
TOML_ERROR_CHECK;
if (negative_offset)
{
negative_offset--;
// an entry negative offset of 1 just means "replay the current head"
if (!negative_offset)
return head;
// otherwise step back into the history buffer
else
return history.buffer + ((history.first + history.count - negative_offset) % history_buffer_size);
}
else
{
// first character read from stream
if TOML_UNLIKELY(!history.count && !head)
head = reader.read_next();
// subsequent characters and not eof
else if (head)
{
if TOML_UNLIKELY(history.count < history_buffer_size)
history.buffer[history.count++] = *head;
else
history.buffer[(history.first++ + history_buffer_size) % history_buffer_size] = *head;
head = reader.read_next();
}
return head;
}
}
[[nodiscard]]
const utf8_codepoint* step_back(size_t count) noexcept
{
TOML_ERROR_CHECK;
TOML_ASSERT(history.count);
TOML_ASSERT(negative_offset + count <= history.count);
negative_offset += count;
return negative_offset
? history.buffer + ((history.first + history.count - negative_offset) % history_buffer_size)
: head;
}
[[nodiscard]]
bool peek_eof() const override
{
return reader.peek_eof();
}
#if !TOML_EXCEPTIONS #if !TOML_EXCEPTIONS
optional<parse_error>&& error() noexcept override;
[[nodiscard]]
optional<parse_error>&& error() noexcept override
{
return reader.error();
}
#endif #endif
}; };
#undef TOML_ERROR_CHECK
#undef TOML_ERROR
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
TOML_POP_WARNINGS
TOML_IMPL_NAMESPACE_END
} }
TOML_POP_WARNINGS // TOML_DISABLE_PADDING_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_PADDING_WARNINGS, TOML_DISABLE_MISC_WARNINGS

View File

@ -0,0 +1,113 @@
//# This file is a part of toml++ and is subject to the the terms of the MIT license.
//# Copyright (c) 2019-2020 Mark Gillard <mark.gillard@outlook.com.au>
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
// SPDX-License-Identifier: MIT
#pragma once
//# {{
#include "toml_preprocessor.h"
#if !TOML_IMPLEMENTATION
#error This is an implementation-only header.
#endif
#if !TOML_PARSER
#error This header cannot not be included when TOML_PARSER is disabled.
#endif
//# }}
#include "toml_utf8_streams.h"
#if !TOML_EXCEPTIONS
#undef TOML_ERROR_CHECK
#define TOML_ERROR_CHECK if (reader.error()) return nullptr
#endif
namespace toml
{
TOML_IMPL_NAMESPACE_START
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, ex, noex)
TOML_EXTERNAL_LINKAGE
utf8_buffered_reader::utf8_buffered_reader(utf8_reader_interface& reader_) noexcept
: reader{ reader_ }
{}
TOML_EXTERNAL_LINKAGE
const source_path_ptr& utf8_buffered_reader::source_path() const noexcept
{
return reader.source_path();
}
TOML_EXTERNAL_LINKAGE
const utf8_codepoint* utf8_buffered_reader::read_next()
{
TOML_ERROR_CHECK;
if (negative_offset)
{
negative_offset--;
// an entry negative offset of 1 just means "replay the current head"
if (!negative_offset)
return head;
// otherwise step back into the history buffer
else
return history.buffer + ((history.first + history.count - negative_offset) % history_buffer_size);
}
else
{
// first character read from stream
if TOML_UNLIKELY(!history.count && !head)
head = reader.read_next();
// subsequent characters and not eof
else if (head)
{
if TOML_UNLIKELY(history.count < history_buffer_size)
history.buffer[history.count++] = *head;
else
history.buffer[(history.first++ + history_buffer_size) % history_buffer_size] = *head;
head = reader.read_next();
}
return head;
}
}
TOML_EXTERNAL_LINKAGE
const utf8_codepoint* utf8_buffered_reader::step_back(size_t count) noexcept
{
TOML_ERROR_CHECK;
TOML_ASSERT(history.count);
TOML_ASSERT(negative_offset + count <= history.count);
negative_offset += count;
return negative_offset
? history.buffer + ((history.first + history.count - negative_offset) % history_buffer_size)
: head;
}
TOML_EXTERNAL_LINKAGE
bool utf8_buffered_reader::peek_eof() const
{
return reader.peek_eof();
}
#if !TOML_EXCEPTIONS
TOML_EXTERNAL_LINKAGE
optional<parse_error>&& utf8_buffered_reader::error() noexcept
{
return reader.error();
}
#endif
TOML_ABI_NAMESPACE_END // TOML_EXCEPTIONS
TOML_IMPL_NAMESPACE_END
}
#undef TOML_ERROR_CHECK
#undef TOML_ERROR

View File

@ -8,29 +8,129 @@
#include "toml_print_to_stream.h" #include "toml_print_to_stream.h"
TOML_PUSH_WARNINGS TOML_PUSH_WARNINGS
TOML_DISABLE_FLOAT_WARNINGS TOML_DISABLE_ARITHMETIC_WARNINGS
TOML_DISABLE_PADDING_WARNINGS TOML_DISABLE_PADDING_WARNINGS
TOML_DISABLE_MISC_WARNINGS
namespace toml namespace toml
{ {
TOML_IMPL_NAMESPACE_START
template <typename T, typename...>
struct native_value_maker
{
template <typename... Args>
[[nodiscard]]
static T make(Args&&... args) noexcept(std::is_nothrow_constructible_v<T, Args&&...>)
{
return T(std::forward<Args>(args)...);
}
};
template <typename T>
struct native_value_maker<T, T>
{
template <typename U>
[[nodiscard]]
TOML_ALWAYS_INLINE
static U&& make(U&& val) noexcept
{
return std::forward<U>(val);
}
};
#if defined(__cpp_lib_char8_t) || TOML_WINDOWS_COMPAT
struct string_maker
{
template <typename T>
[[nodiscard]]
static std::string make(T&& arg) noexcept
{
#ifdef __cpp_lib_char8_t
if constexpr (is_one_of<std::decay_t<T>, char8_t*, const char8_t*>)
return std::string(reinterpret_cast<const char*>(static_cast<const char8_t*>(arg)));
else if constexpr (is_one_of<remove_cvref_t<T>, std::u8string, std::u8string_view>)
return std::string(reinterpret_cast<const char*>(static_cast<const char8_t*>(arg.data())), arg.length());
#endif // __cpp_lib_char8_t
#if TOML_WINDOWS_COMPAT
if constexpr (is_wide_string<T>)
return narrow(std::forward<T>(arg));
#endif // TOML_WINDOWS_COMPAT
}
};
#ifdef __cpp_lib_char8_t
template <> struct native_value_maker<std::string, char8_t*> : string_maker {};
template <> struct native_value_maker<std::string, const char8_t*> : string_maker {};
template <> struct native_value_maker<std::string, std::u8string> : string_maker {};
template <> struct native_value_maker<std::string, std::u8string_view> : string_maker {};
#endif // __cpp_lib_char8_t
#if TOML_WINDOWS_COMPAT
template <> struct native_value_maker<std::string, wchar_t*> : string_maker {};
template <> struct native_value_maker<std::string, const wchar_t*> : string_maker {};
template <> struct native_value_maker<std::string, std::wstring> : string_maker {};
template <> struct native_value_maker<std::string, std::wstring_view> : string_maker {};
#endif // TOML_WINDOWS_COMPAT
#endif // defined(__cpp_lib_char8_t) || TOML_WINDOWS_COMPAT
template <typename T>
[[nodiscard]]
TOML_ATTR(const)
inline optional<T> node_integer_cast(int64_t val) noexcept
{
static_assert(node_type_of<T> == node_type::integer);
static_assert(!is_cvref<T>);
using traits = value_traits<T>;
if constexpr (!traits::is_signed)
{
if constexpr ((sizeof(T) * CHAR_BIT) <= 53) // 53 bits < int64_max < 54 bits
{
using common_t = decltype(int64_t{} + T{});
if (val < int64_t{} || static_cast<common_t>(val) > static_cast<common_t>(traits::max))
return {};
}
else
{
if (val < int64_t{})
return {};
}
}
else
{
if (val < traits::min || val > traits::max)
return {};
}
return { static_cast<T>(val) };
}
TOML_IMPL_NAMESPACE_END
}
namespace toml
{
TOML_ABI_NAMESPACE_VERSION
template <typename Char, typename T> template <typename Char, typename T>
std::basic_ostream<Char>& operator << (std::basic_ostream<Char>&, const value<T>&); std::basic_ostream<Char>& operator << (std::basic_ostream<Char>&, const value<T>&);
/// \brief A TOML value. /// \brief A TOML value.
/// ///
/// \tparam T The value's data type. Can be one of: /// \tparam ValueType The value's native TOML data type. Can be one of:
/// - toml::string /// - std::string
/// - toml::date /// - toml::date
/// - toml::time /// - toml::time
/// - toml::date_time /// - toml::date_time
/// - int64_t /// - int64_t
/// - double /// - double
/// - bool /// - bool
template <typename T> template <typename ValueType>
class TOML_API value final : public node class TOML_API value final : public node
{ {
static_assert( static_assert(
impl::is_native<T>, impl::is_native<ValueType> && !impl::is_cvref<ValueType>,
"A toml::value<> must model one of the native TOML value types:" "A toml::value<> must model one of the native TOML value types:"
TOML_NATIVE_VALUE_TYPE_LIST TOML_NATIVE_VALUE_TYPE_LIST
); );
@ -38,23 +138,24 @@ namespace toml
private: private:
friend class TOML_PARSER_TYPENAME; friend class TOML_PARSER_TYPENAME;
template <typename U, typename V> template <typename T, typename U>
[[nodiscard]] [[nodiscard]]
TOML_ALWAYS_INLINE TOML_ALWAYS_INLINE
static auto as_value([[maybe_unused]] V* ptr) noexcept TOML_ATTR(const)
static auto as_value([[maybe_unused]] U* ptr) noexcept
{ {
if constexpr (std::is_same_v<T, U>) if constexpr (std::is_same_v<value_type, T>)
return ptr; return ptr;
else else
return nullptr; return nullptr;
} }
T val_; ValueType val_;
public: public:
/// \brief The value's underlying data type. /// \brief The value's underlying data type.
using value_type = T; using value_type = ValueType;
/// \brief A type alias for 'value arguments'. /// \brief A type alias for 'value arguments'.
/// \details This differs according to the value's type argument: /// \details This differs according to the value's type argument:
@ -62,19 +163,22 @@ namespace toml
/// - strings: `string_view` /// - strings: `string_view`
/// - everything else: `const value_type&` /// - everything else: `const value_type&`
using value_arg = std::conditional_t< using value_arg = std::conditional_t<
std::is_same_v<T, string>, std::is_same_v<value_type, std::string>,
string_view, std::string_view,
std::conditional_t<impl::is_one_of<T, double, int64_t, bool>, T, const T&> std::conditional_t<impl::is_one_of<value_type, double, int64_t, bool>, value_type, const value_type&>
>; >;
/// \brief Constructs a toml value. /// \brief Constructs a toml value.
/// ///
/// \tparam U Constructor argument types. /// \tparam Args Constructor argument types.
/// \param args Arguments to forward to the internal value's constructor. /// \param args Arguments to forward to the internal value's constructor.
template <typename... U> template <typename... Args>
TOML_NODISCARD_CTOR TOML_NODISCARD_CTOR
explicit value(U&&... args) noexcept(std::is_nothrow_constructible_v<T, U&&...>) explicit value(Args&&... args)
: val_{ std::forward<U>(args)... } noexcept(noexcept(value_type(
impl::native_value_maker<value_type, std::decay_t<Args>...>::make(std::forward<Args>(args)...)
)))
: val_(impl::native_value_maker<value_type, std::decay_t<Args>...>::make(std::forward<Args>(args)...))
{} {}
/// \brief Move constructor. /// \brief Move constructor.
@ -105,7 +209,7 @@ namespace toml
/// - node_type::date /// - node_type::date
/// - node_type::time /// - node_type::time
/// - node_type::date_time /// - node_type::date_time
[[nodiscard]] node_type type() const noexcept override { return impl::node_type_of<T>; } [[nodiscard]] node_type type() const noexcept override { return impl::node_type_of<value_type>; }
/// \brief Always returns `false` for value nodes. /// \brief Always returns `false` for value nodes.
[[nodiscard]] bool is_table() const noexcept override { return false; } [[nodiscard]] bool is_table() const noexcept override { return false; }
@ -114,17 +218,17 @@ namespace toml
/// \brief Always returns `true` for value nodes. /// \brief Always returns `true` for value nodes.
[[nodiscard]] bool is_value() const noexcept override { return true; } [[nodiscard]] bool is_value() const noexcept override { return true; }
[[nodiscard]] bool is_string() const noexcept override { return std::is_same_v<T, string>; } [[nodiscard]] bool is_string() const noexcept override { return std::is_same_v<value_type, std::string>; }
[[nodiscard]] bool is_integer() const noexcept override { return std::is_same_v<T, int64_t>; } [[nodiscard]] bool is_integer() const noexcept override { return std::is_same_v<value_type, int64_t>; }
[[nodiscard]] bool is_floating_point() const noexcept override { return std::is_same_v<T, double>; } [[nodiscard]] bool is_floating_point() const noexcept override { return std::is_same_v<value_type, double>; }
[[nodiscard]] bool is_number() const noexcept override { return impl::is_one_of<T, int64_t, double>; } [[nodiscard]] bool is_number() const noexcept override { return impl::is_one_of<value_type, int64_t, double>; }
[[nodiscard]] bool is_boolean() const noexcept override { return std::is_same_v<T, bool>; } [[nodiscard]] bool is_boolean() const noexcept override { return std::is_same_v<value_type, bool>; }
[[nodiscard]] bool is_date() const noexcept override { return std::is_same_v<T, date>; } [[nodiscard]] bool is_date() const noexcept override { return std::is_same_v<value_type, date>; }
[[nodiscard]] bool is_time() const noexcept override { return std::is_same_v<T, time>; } [[nodiscard]] bool is_time() const noexcept override { return std::is_same_v<value_type, time>; }
[[nodiscard]] bool is_date_time() const noexcept override { return std::is_same_v<T, date_time>; } [[nodiscard]] bool is_date_time() const noexcept override { return std::is_same_v<value_type, date_time>; }
/// \brief Returns a pointer to the value if the data type is a string. /// \brief Returns a pointer to the value if the data type is a string.
[[nodiscard]] value<string>* as_string() noexcept override { return as_value<string>(this); } [[nodiscard]] value<std::string>* as_string() noexcept override { return as_value<std::string>(this); }
/// \brief Returns a pointer to the value if the data type is an integer. /// \brief Returns a pointer to the value if the data type is an integer.
[[nodiscard]] value<int64_t>* as_integer() noexcept override { return as_value<int64_t>(this); } [[nodiscard]] value<int64_t>* as_integer() noexcept override { return as_value<int64_t>(this); }
/// \brief Returns a pointer to the value if the data type is a floating-point. /// \brief Returns a pointer to the value if the data type is a floating-point.
@ -139,7 +243,7 @@ namespace toml
[[nodiscard]] value<date_time>* as_date_time() noexcept override { return as_value<date_time>(this); } [[nodiscard]] value<date_time>* as_date_time() noexcept override { return as_value<date_time>(this); }
/// \brief Returns a const pointer to the value if the data type is a string. /// \brief Returns a const pointer to the value if the data type is a string.
[[nodiscard]] const value<string>* as_string() const noexcept override { return as_value<string>(this); } [[nodiscard]] const value<std::string>* as_string() const noexcept override { return as_value<std::string>(this); }
/// \brief Returns a const pointer to the value if the data type is an integer. /// \brief Returns a const pointer to the value if the data type is an integer.
[[nodiscard]] const value<int64_t>* as_integer() const noexcept override { return as_value<int64_t>(this); } [[nodiscard]] const value<int64_t>* as_integer() const noexcept override { return as_value<int64_t>(this); }
/// \brief Returns a const pointer to the value if the data type is a floating-point. /// \brief Returns a const pointer to the value if the data type is a floating-point.
@ -154,42 +258,42 @@ namespace toml
[[nodiscard]] const value<date_time>* as_date_time() const noexcept override { return as_value<date_time>(this); } [[nodiscard]] const value<date_time>* as_date_time() const noexcept override { return as_value<date_time>(this); }
/// \brief Returns a reference to the underlying value. /// \brief Returns a reference to the underlying value.
[[nodiscard]] T& get() & noexcept { return val_; } [[nodiscard]] value_type& get() & noexcept { return val_; }
/// \brief Returns a reference to the underlying value (rvalue overload). /// \brief Returns a reference to the underlying value (rvalue overload).
[[nodiscard]] T&& get() && noexcept { return std::move(val_); } [[nodiscard]] value_type&& get() && noexcept { return std::move(val_); }
/// \brief Returns a reference to the underlying value (const overload). /// \brief Returns a reference to the underlying value (const overload).
[[nodiscard]] const T& get() const & noexcept { return val_; } [[nodiscard]] const value_type& get() const & noexcept { return val_; }
/// \brief Returns a reference to the underlying value. /// \brief Returns a reference to the underlying value.
[[nodiscard]] T& operator* () & noexcept { return val_; } [[nodiscard]] value_type& operator* () & noexcept { return val_; }
/// \brief Returns a reference to the underlying value (rvalue overload). /// \brief Returns a reference to the underlying value (rvalue overload).
[[nodiscard]] T&& operator* () && noexcept { return std::move(val_); } [[nodiscard]] value_type&& operator* () && noexcept { return std::move(val_); }
/// \brief Returns a reference to the underlying value (const overload). /// \brief Returns a reference to the underlying value (const overload).
[[nodiscard]] const T& operator* () const& noexcept { return val_; } [[nodiscard]] const value_type& operator* () const& noexcept { return val_; }
/// \brief Returns a reference to the underlying value. /// \brief Returns a reference to the underlying value.
[[nodiscard]] explicit operator T& () & noexcept { return val_; } [[nodiscard]] explicit operator value_type& () & noexcept { return val_; }
/// \brief Returns a reference to the underlying value (rvalue overload). /// \brief Returns a reference to the underlying value (rvalue overload).
[[nodiscard]] explicit operator T&& () && noexcept { return std::move(val_); } [[nodiscard]] explicit operator value_type && () && noexcept { return std::move(val_); }
/// \brief Returns a reference to the underlying value (const overload). /// \brief Returns a reference to the underlying value (const overload).
[[nodiscard]] explicit operator const T& () const& noexcept { return val_; } [[nodiscard]] explicit operator const value_type& () const& noexcept { return val_; }
/// \brief Prints the value out to a stream as formatted TOML. /// \brief Prints the value out to a stream as formatted TOML.
template <typename Char, typename U> template <typename Char, typename T>
friend std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const value<U>& rhs); friend std::basic_ostream<Char>& operator << (std::basic_ostream<Char>& lhs, const value<T>& rhs);
/// \brief Value-assignment operator. /// \brief Value-assignment operator.
value& operator= (value_arg rhs) noexcept value& operator= (value_arg rhs) noexcept
{ {
if constexpr (std::is_same_v<T, string>) if constexpr (std::is_same_v<value_type, std::string>)
val_.assign(rhs); val_.assign(rhs);
else else
val_ = rhs; val_ = rhs;
return *this; return *this;
} }
template <typename U = T, typename = std::enable_if_t<std::is_same_v<U, string>>> template <typename T = value_type, typename = std::enable_if_t<std::is_same_v<T, std::string>>>
value& operator= (string&& rhs) noexcept value& operator= (std::string&& rhs) noexcept
{ {
val_ = std::move(rhs); val_ = std::move(rhs);
return *this; return *this;
@ -261,11 +365,11 @@ namespace toml
/// \param rhs The RHS value. /// \param rhs The RHS value.
/// ///
/// \returns True if the values were of the same type and contained the same value. /// \returns True if the values were of the same type and contained the same value.
template <typename U> template <typename T>
[[nodiscard]] [[nodiscard]]
friend bool operator == (const value& lhs, const value<U>& rhs) noexcept friend bool operator == (const value& lhs, const value<T>& rhs) noexcept
{ {
if constexpr (std::is_same_v<T, U>) if constexpr (std::is_same_v<value_type, T>)
return lhs == rhs.val_; //calls asymmetrical value-equality operator defined above return lhs == rhs.val_; //calls asymmetrical value-equality operator defined above
else else
return false; return false;
@ -277,9 +381,9 @@ namespace toml
/// \param rhs The RHS value. /// \param rhs The RHS value.
/// ///
/// \returns True if the values were not of the same type, or did not contain the same value. /// \returns True if the values were not of the same type, or did not contain the same value.
template <typename U> template <typename T>
[[nodiscard]] [[nodiscard]]
friend bool operator != (const value& lhs, const value<U>& rhs) noexcept friend bool operator != (const value& lhs, const value<T>& rhs) noexcept
{ {
return !(lhs == rhs); return !(lhs == rhs);
} }
@ -291,14 +395,14 @@ namespace toml
/// ///
/// \returns <strong><em>Same value types:</em></strong> `lhs.get() < rhs.get()` <br> /// \returns <strong><em>Same value types:</em></strong> `lhs.get() < rhs.get()` <br>
/// <strong><em>Different value types:</em></strong> `lhs.type() < rhs.type()` /// <strong><em>Different value types:</em></strong> `lhs.type() < rhs.type()`
template <typename U> template <typename T>
[[nodiscard]] [[nodiscard]]
friend bool operator < (const value& lhs, const value<U>& rhs) noexcept friend bool operator < (const value& lhs, const value<T>& rhs) noexcept
{ {
if constexpr (std::is_same_v<T, U>) if constexpr (std::is_same_v<value_type, T>)
return lhs.val_ < rhs.val_; return lhs.val_ < rhs.val_;
else else
return impl::node_type_of<T> < impl::node_type_of<U>; return impl::node_type_of<value_type> < impl::node_type_of<T>;
} }
/// \brief Less-than-or-equal-to operator. /// \brief Less-than-or-equal-to operator.
@ -308,14 +412,14 @@ namespace toml
/// ///
/// \returns <strong><em>Same value types:</em></strong> `lhs.get() <= rhs.get()` <br> /// \returns <strong><em>Same value types:</em></strong> `lhs.get() <= rhs.get()` <br>
/// <strong><em>Different value types:</em></strong> `lhs.type() <= rhs.type()` /// <strong><em>Different value types:</em></strong> `lhs.type() <= rhs.type()`
template <typename U> template <typename T>
[[nodiscard]] [[nodiscard]]
friend bool operator <= (const value& lhs, const value<U>& rhs) noexcept friend bool operator <= (const value& lhs, const value<T>& rhs) noexcept
{ {
if constexpr (std::is_same_v<T, U>) if constexpr (std::is_same_v<value_type, T>)
return lhs.val_ <= rhs.val_; return lhs.val_ <= rhs.val_;
else else
return impl::node_type_of<T> <= impl::node_type_of<U>; return impl::node_type_of<value_type> <= impl::node_type_of<T>;
} }
/// \brief Greater-than operator. /// \brief Greater-than operator.
@ -325,14 +429,14 @@ namespace toml
/// ///
/// \returns <strong><em>Same value types:</em></strong> `lhs.get() > rhs.get()` <br> /// \returns <strong><em>Same value types:</em></strong> `lhs.get() > rhs.get()` <br>
/// <strong><em>Different value types:</em></strong> `lhs.type() > rhs.type()` /// <strong><em>Different value types:</em></strong> `lhs.type() > rhs.type()`
template <typename U> template <typename T>
[[nodiscard]] [[nodiscard]]
friend bool operator > (const value& lhs, const value<U>& rhs) noexcept friend bool operator > (const value& lhs, const value<T>& rhs) noexcept
{ {
if constexpr (std::is_same_v<T, U>) if constexpr (std::is_same_v<value_type, T>)
return lhs.val_ > rhs.val_; return lhs.val_ > rhs.val_;
else else
return impl::node_type_of<T> > impl::node_type_of<U>; return impl::node_type_of<value_type> > impl::node_type_of<T>;
} }
/// \brief Greater-than-or-equal-to operator. /// \brief Greater-than-or-equal-to operator.
@ -342,28 +446,25 @@ namespace toml
/// ///
/// \returns <strong><em>Same value types:</em></strong> `lhs.get() >= rhs.get()` <br> /// \returns <strong><em>Same value types:</em></strong> `lhs.get() >= rhs.get()` <br>
/// <strong><em>Different value types:</em></strong> `lhs.type() >= rhs.type()` /// <strong><em>Different value types:</em></strong> `lhs.type() >= rhs.type()`
template <typename U> template <typename T>
[[nodiscard]] [[nodiscard]]
friend bool operator >= (const value& lhs, const value<U>& rhs) noexcept friend bool operator >= (const value& lhs, const value<T>& rhs) noexcept
{ {
if constexpr (std::is_same_v<T, U>) if constexpr (std::is_same_v<value_type, T>)
return lhs.val_ >= rhs.val_; return lhs.val_ >= rhs.val_;
else else
return impl::node_type_of<T> >= impl::node_type_of<U>; return impl::node_type_of<value_type> >= impl::node_type_of<T>;
} }
}; };
#if !TOML_ALL_INLINE #if !TOML_ALL_INLINE
TOML_PUSH_WARNINGS extern template class TOML_API value<std::string>;
TOML_DISABLE_VTABLE_WARNINGS
extern template class TOML_API value<string>;
extern template class TOML_API value<int64_t>; extern template class TOML_API value<int64_t>;
extern template class TOML_API value<double>; extern template class TOML_API value<double>;
extern template class TOML_API value<bool>; extern template class TOML_API value<bool>;
extern template class TOML_API value<date>; extern template class TOML_API value<date>;
extern template class TOML_API value<time>; extern template class TOML_API value<time>;
extern template class TOML_API value<date_time>; extern template class TOML_API value<date_time>;
TOML_POP_WARNINGS
#endif #endif
template <typename T> template <typename T>
@ -383,16 +484,17 @@ namespace toml
static_assert(node_type_of<T> != node_type::table); static_assert(node_type_of<T> != node_type::table);
static_assert(node_type_of<T> != node_type::array); static_assert(node_type_of<T> != node_type::array);
static_assert(is_native<T> || can_represent_native<T>); static_assert(is_native<T> || can_represent_native<T>);
static_assert(!is_cvref<T>);
TOML_ASSERT(this->type() == node_type_of<T>); TOML_ASSERT(this->type() == node_type_of<T>);
if constexpr (node_type_of<T> == node_type::string) if constexpr (node_type_of<T> == node_type::string)
{ {
const auto& str = *ref_cast<string>(); const auto& str = *ref_cast<std::string>();
if constexpr (std::is_same_v<T, string>) if constexpr (std::is_same_v<T, std::string>)
return str; return str;
else if constexpr (std::is_same_v<T, string_view>) else if constexpr (std::is_same_v<T, std::string_view>)
return T{ str }; return T{ str };
else if constexpr (std::is_same_v<T, const string_char*>) else if constexpr (std::is_same_v<T, const char*>)
return str.c_str(); return str.c_str();
else if constexpr (std::is_same_v<T, std::wstring>) else if constexpr (std::is_same_v<T, std::wstring>)
@ -404,13 +506,8 @@ namespace toml
#endif #endif
} }
// char8_t -> char (safe)
else if constexpr (is_one_of<T, std::string, std::string_view>)
return T(reinterpret_cast<const char*>(str.c_str()), str.length());
else if constexpr (std::is_same_v<T, const char*>)
return reinterpret_cast<const char*>(str.c_str());
#ifdef __cpp_lib_char8_t #ifdef __cpp_lib_char8_t
// char -> char8_t (potentially unsafe - the feature is 'experimental'!) // char -> char8_t (potentially unsafe - the feature is 'experimental'!)
else if constexpr (is_one_of<T, std::u8string, std::u8string_view>) else if constexpr (is_one_of<T, std::u8string, std::u8string_view>)
return T(reinterpret_cast<const char8_t*>(str.c_str()), str.length()); return T(reinterpret_cast<const char8_t*>(str.c_str()), str.length());
@ -418,13 +515,13 @@ namespace toml
return reinterpret_cast<const char8_t*>(str.c_str()); return reinterpret_cast<const char8_t*>(str.c_str());
else else
static_assert(dependent_false<T>, "Evaluated unreachable branch!"); static_assert(dependent_false<T>, "Evaluated unreachable branch!");
#endif #endif
} }
else else
return static_cast<T>(*ref_cast<native_type_of<T>>()); return static_cast<T>(*ref_cast<native_type_of<T>>());
} }
template <typename T> template <typename T>
inline optional<T> node::value_exact() const noexcept inline optional<T> node::value_exact() const noexcept
{ {
@ -436,18 +533,14 @@ namespace toml
"supported on Windows with TOML_WINDOWS_COMPAT enabled." "supported on Windows with TOML_WINDOWS_COMPAT enabled."
); );
static_assert( static_assert(
is_native<T> || can_represent_native<T>, (is_native<T> || can_represent_native<T>) && !is_cvref<T>,
"The return type of node::value_exact() must be one of the following:" "The return type of node::value_exact() must be one of the following:"
"\n|" "\n|"
"\n| A native TOML value type" "\n| A native TOML value type"
TOML_NATIVE_VALUE_TYPE_LIST TOML_NATIVE_VALUE_TYPE_LIST
"\n|" "\n|"
"\n| A non-view type capable of losslessly representing a native TOML value type" "\n| A non-view type capable of losslessly representing a native TOML value type"
#if TOML_CHAR_8_STRINGS
"\n| - std::string" "\n| - std::string"
#elif defined __cpp_lib_char8_t
"\n| - std::u8string"
#endif
#if TOML_WINDOWS_COMPAT #if TOML_WINDOWS_COMPAT
"\n| - std::wstring" "\n| - std::wstring"
#endif #endif
@ -480,18 +573,14 @@ namespace toml
"supported on Windows with TOML_WINDOWS_COMPAT enabled." "supported on Windows with TOML_WINDOWS_COMPAT enabled."
); );
static_assert( static_assert(
is_native<T> || can_represent_native<T> || can_partially_represent_native<T>, (is_native<T> || can_represent_native<T> || can_partially_represent_native<T>) && !is_cvref<T>,
"The return type of node::value() must be one of the following:" "The return type of node::value() must be one of the following:"
"\n|" "\n|"
"\n| A native TOML value type" "\n| A native TOML value type"
TOML_NATIVE_VALUE_TYPE_LIST TOML_NATIVE_VALUE_TYPE_LIST
"\n|" "\n|"
"\n| A non-view type capable of losslessly representing a native TOML value type" "\n| A non-view type capable of losslessly representing a native TOML value type"
#if TOML_CHAR_8_STRINGS
"\n| - std::string" "\n| - std::string"
#elif defined __cpp_lib_char8_t
"\n| - std::u8string"
#endif
#if TOML_WINDOWS_COMPAT #if TOML_WINDOWS_COMPAT
"\n| - std::wstring" "\n| - std::wstring"
#endif #endif
@ -513,7 +602,7 @@ namespace toml
// when asking for strings, dates, times and date_times there's no 'fuzzy' conversion // when asking for strings, dates, times and date_times there's no 'fuzzy' conversion
// semantics to be mindful of so the exact retrieval is enough. // semantics to be mindful of so the exact retrieval is enough.
if constexpr (is_natively_one_of<T, string, time, date, date_time>) if constexpr (is_natively_one_of<T, std::string, time, date, date_time>)
{ {
if (type() == node_type_of<T>) if (type() == node_type_of<T>)
return { this->get_value_exact<T>() }; return { this->get_value_exact<T>() };
@ -535,30 +624,7 @@ namespace toml
if constexpr (is_native<T> || can_represent_native<T>) if constexpr (is_native<T> || can_represent_native<T>)
return static_cast<T>(*ref_cast<int64_t>()); return static_cast<T>(*ref_cast<int64_t>());
else else
{ return node_integer_cast<T>(*ref_cast<int64_t>());
using traits = value_traits<T>;
const int64_t val = *ref_cast<int64_t>();
if constexpr (!traits::is_signed)
{
if constexpr ((sizeof(T) * CHAR_BIT) <= 53) // 53 bits < int64_max < 54 bits
{
using common_t = decltype(int64_t{} + T{});
if (val < int64_t{} || static_cast<common_t>(val) > static_cast<common_t>(traits::max))
return {};
}
else
{
if (val < int64_t{})
return {};
}
}
else
{
if (val < traits::min || val > traits::max)
return {};
}
return { static_cast<T>(val) };
}
} }
// int -> float // int -> float
@ -600,6 +666,16 @@ namespace toml
} }
} }
// float -> int
else if constexpr (is_natively_one_of<T, int64_t>)
{
const double val = *ref_cast<double>();
if (static_cast<double>(static_cast<int64_t>(val)) == val)
return node_integer_cast<T>(static_cast<int64_t>(val));
else
return {};
}
// float -> anything else // float -> anything else
else else
return {}; return {};
@ -627,8 +703,6 @@ namespace toml
} }
} }
TOML_POP_WARNINGS
template <typename T> template <typename T>
inline auto node::value_or(T&& default_value) const noexcept inline auto node::value_or(T&& default_value) const noexcept
{ {
@ -646,7 +720,7 @@ namespace toml
#if TOML_WINDOWS_COMPAT #if TOML_WINDOWS_COMPAT
if (type() == node_type::string) if (type() == node_type::string)
return widen(*ref_cast<string>()); return widen(*ref_cast<std::string>());
return std::wstring{ std::forward<T>(default_value) }; return std::wstring{ std::forward<T>(default_value) };
#else #else
@ -672,11 +746,7 @@ namespace toml
TOML_NATIVE_VALUE_TYPE_LIST TOML_NATIVE_VALUE_TYPE_LIST
"\n| " "\n| "
"\n| A non-view type capable of losslessly representing a native TOML value type" "\n| A non-view type capable of losslessly representing a native TOML value type"
#if TOML_CHAR_8_STRINGS
"\n| - std::string" "\n| - std::string"
#elif defined __cpp_lib_char8_t
"\n| - std::u8string"
#endif
#if TOML_WINDOWS_COMPAT #if TOML_WINDOWS_COMPAT
"\n| - std::wstring" "\n| - std::wstring"
#endif #endif
@ -723,6 +793,58 @@ namespace toml
} }
} }
} }
#if !TOML_ALL_INLINE
#define TOML_EXTERN(name, T) \
extern template TOML_API optional<T> node::name<T>() const noexcept
TOML_EXTERN(value_exact, std::string_view);
TOML_EXTERN(value_exact, std::string);
TOML_EXTERN(value_exact, const char*);
TOML_EXTERN(value_exact, int64_t);
TOML_EXTERN(value_exact, double);
TOML_EXTERN(value_exact, date);
TOML_EXTERN(value_exact, time);
TOML_EXTERN(value_exact, date_time);
TOML_EXTERN(value_exact, bool);
TOML_EXTERN(value, std::string_view);
TOML_EXTERN(value, std::string);
TOML_EXTERN(value, const char*);
TOML_EXTERN(value, signed char);
TOML_EXTERN(value, signed short);
TOML_EXTERN(value, signed int);
TOML_EXTERN(value, signed long);
TOML_EXTERN(value, signed long long);
TOML_EXTERN(value, unsigned char);
TOML_EXTERN(value, unsigned short);
TOML_EXTERN(value, unsigned int);
TOML_EXTERN(value, unsigned long);
TOML_EXTERN(value, unsigned long long);
TOML_EXTERN(value, double);
TOML_EXTERN(value, float);
TOML_EXTERN(value, date);
TOML_EXTERN(value, time);
TOML_EXTERN(value, date_time);
TOML_EXTERN(value, bool);
#ifdef __cpp_lib_char8_t
TOML_EXTERN(value_exact, std::u8string_view);
TOML_EXTERN(value_exact, std::u8string);
TOML_EXTERN(value_exact, const char8_t*);
TOML_EXTERN(value, std::u8string_view);
TOML_EXTERN(value, std::u8string);
TOML_EXTERN(value, const char8_t*);
#endif
#if TOML_WINDOWS_COMPAT
TOML_EXTERN(value_exact, std::wstring);
TOML_EXTERN(value, std::wstring);
#endif
#undef TOML_EXTERN
#endif // !TOML_ALL_INLINE
TOML_POP_WARNINGS // TOML_DISABLE_INIT_WARNINGS, TOML_DISABLE_SWITCH_WARNINGS
TOML_ABI_NAMESPACE_END // version
} }
TOML_POP_WARNINGS // TOML_DISABLE_FLOAT_WARNINGS, TOML_DISABLE_PADDING_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_ARITHMETIC_WARNINGS, TOML_DISABLE_PADDING_WARNINGS

View File

@ -5,8 +5,8 @@
#pragma once #pragma once
#define TOML_LIB_MAJOR 1 #define TOML_LIB_MAJOR 2
#define TOML_LIB_MINOR 4 #define TOML_LIB_MINOR 0
#define TOML_LIB_PATCH 0 #define TOML_LIB_PATCH 0
#define TOML_LANG_MAJOR 1 #define TOML_LANG_MAJOR 1

View File

@ -1,7 +1,7 @@
project( project(
'tomlplusplus', 'tomlplusplus',
'cpp', 'cpp',
version : '1.4.0', version : '2.0.0',
license : 'MIT', license : 'MIT',
default_options : [ default_options : [
'cpp_std=c++17', 'cpp_std=c++17',

View File

@ -30,7 +30,7 @@ def python_value_to_tomlpp(val):
if re.fullmatch(r'^[+-]?[0-9]+[eE][+-]?[0-9]+$', val, re.M): if re.fullmatch(r'^[+-]?[0-9]+[eE][+-]?[0-9]+$', val, re.M):
return str(float(val)) return str(float(val))
else: else:
return 'S(R"({})"sv)'.format(val) return 'R"({})"sv'.format(val)
elif isinstance(val, bool): elif isinstance(val, bool):
return 'true' if val else 'false' return 'true' if val else 'false'
elif isinstance(val, float): elif isinstance(val, float):

View File

@ -73,7 +73,6 @@ type_names = [
'time', 'time',
'date_time', 'date_time',
'time_offset', 'time_offset',
'string_char',
'parse_result', 'parse_result',
'parse_error', 'parse_error',
'json_formatter', 'json_formatter',

View File

@ -8,51 +8,61 @@ import sys
import os.path as path import os.path as path
import utils import utils
import re import re
from io import StringIO
class Preprocessor: class Preprocessor:
def __init__(self): __re_strip_blocks = re.compile(r'//[#!]\s*[{][{].*?//[#!]\s*[}][}]*?\n', re.I | re.S)
pass __re_includes = re.compile(r'^\s*#\s*include\s+"(.+?)"', re.I | re.M)
def preprocess(self, match): def __preprocess(self, match):
raw_incl = match if isinstance(match, str) else match.group(1) raw_incl = match if isinstance(match, str) else match.group(1)
incl = raw_incl.strip().lower() incl = raw_incl.strip().lower()
if incl in self.processed_includes: if incl in self.__processed_includes:
return '' return ''
self.processed_includes.append(incl) self.__processed_includes.append(incl)
text = utils.read_all_text_from_file(path.join(utils.get_script_folder(), '..', 'include', 'toml++', incl)).strip() + '\n' text = utils.read_all_text_from_file(path.join(utils.get_script_folder(), '..', 'include', 'toml++', incl)).strip() + '\n'
text = re.sub('\r\n', '\n', text, 0, re.I | re.M) # convert windows newlines text = text.replace('\r\n', '\n') # convert windows newlines
text = re.sub(r'//[#!]\s*[{][{].*?//[#!]\s*[}][}]*?\n', '', text, 0, re.I | re.S) # strip {{ }} blocks text = self.__re_strip_blocks.sub('', text, 0) # strip {{ }} blocks
self.current_level += 1 self.__current_level += 1
text = re.sub(r'^\s*#\s*include\s+"(.+?)"', lambda m : self.preprocess(m), text, 0, re.I | re.M) text = self.__re_includes.sub(lambda m : self.__preprocess(m), text, 0)
self.current_level -= 1 self.__current_level -= 1
if (self.current_level == 1): if (self.__current_level == 1):
header_text = '' + raw_incl header_text = '' + raw_incl
lpad = 28 + ((25 * (self.header_indent % 4)) - int((len(header_text) + 4) / 2)) lpad = 28 + ((25 * (self.__header_indent % 4)) - int((len(header_text) + 4) / 2))
self.header_indent += 1 self.__header_indent += 1
text = '{}\n#if 1\n\n{}\n\n#endif\n{}\n'.format( text = '{}\n#if 1\n\n{}\n\n#endif\n{}\n'.format(
utils.make_divider(header_text, lpad), text, utils.make_divider('' + raw_incl, lpad) utils.make_divider(header_text, lpad), text, utils.make_divider('' + raw_incl, lpad)
) )
return '\n\n' + text + '\n\n' # will get merged later return '\n\n' + text + '\n\n' # will get merged later
def __call__(self, file): def __init__(self, file):
self.processed_includes = [] self.__processed_includes = []
self.header_indent = 0 self.__header_indent = 0
self.current_level = 0 self.__current_level = 0
return self.preprocess(file) self.__string = self.__preprocess(file)
def __str__(self):
return self.__string
def increment_dict_value(dict, key, delta = 1):
if key in dict:
dict[key] = dict[key] + delta
else:
dict[key] = delta
def main(): def main():
# preprocess header(s) # preprocess header(s)
source_text = Preprocessor()('toml.h') source_text = str(Preprocessor('toml.h'))
source_text = re.sub(r'^\s*#\s*pragma\s+once\s*$', '', source_text, 0, re.I | re.M) # 'pragma once' source_text = re.sub(r'^\s*#\s*pragma\s+once\s*$', '', source_text, 0, re.I | re.M) # 'pragma once'
source_text = re.sub(r'^\s*//\s*clang-format\s+.+?$', '', source_text, 0, re.I | re.M) # clang-format directives source_text = re.sub(r'^\s*//\s*clang-format\s+.+?$', '', source_text, 0, re.I | re.M) # clang-format directives
source_text = re.sub(r'^\s*//\s*SPDX-License-Identifier:.+?$', '', source_text, 0, re.I | re.M) # spdx source_text = re.sub(r'^\s*//\s*SPDX-License-Identifier:.+?$', '', source_text, 0, re.I | re.M) # spdx
@ -107,52 +117,73 @@ def main():
# build the preamble (license etc) # build the preamble (license etc)
preamble = [] preamble = []
preamble.append(''' preamble.append('''
toml++ v{major}.{minor}.{patch} // toml++ v{major}.{minor}.{patch}
https://github.com/marzer/tomlplusplus // https://github.com/marzer/tomlplusplus
SPDX-License-Identifier: MIT'''.format(**library_version)) // SPDX-License-Identifier: MIT'''.format(**library_version))
preamble.append(''' preamble.append('''
- THIS FILE WAS ASSEMBLED FROM MULTIPLE HEADER FILES BY A SCRIPT - PLEASE DON'T EDIT IT DIRECTLY - // - THIS FILE WAS ASSEMBLED FROM MULTIPLE HEADER FILES BY A SCRIPT - PLEASE DON'T EDIT IT DIRECTLY -
//
If you wish to submit a contribution to toml++, hooray and thanks! Before you crack on, please be aware that this // If you wish to submit a contribution to toml++, hooray and thanks! Before you crack on, please be aware that this
file was assembled from a number of smaller files by a python script, and code contributions should not be made // file was assembled from a number of smaller files by a python script, and code contributions should not be made
against it directly. You should instead make your changes in the relevant source file(s). The file names of the files // against it directly. You should instead make your changes in the relevant source file(s). The file names of the files
that contributed to this header can be found at the beginnings and ends of the corresponding sections of this file.''') // that contributed to this header can be found at the beginnings and ends of the corresponding sections of this file.''')
preamble.append(''' preamble.append('''
TOML language specifications: // TOML language specifications:
Latest: https://github.com/toml-lang/toml/blob/master/README.md // Latest: https://github.com/toml-lang/toml/blob/master/README.md
v1.0.0-rc.1: https://toml.io/en/v1.0.0-rc.1 // v1.0.0-rc.1: https://toml.io/en/v1.0.0-rc.1
v0.5.0: https://toml.io/en/v0.5.0''') // v0.5.0: https://toml.io/en/v0.5.0''')
preamble.append(utils.read_all_text_from_file(path.join(utils.get_script_folder(), '..', 'LICENSE'))) preamble.append(utils.read_all_text_from_file(path.join(utils.get_script_folder(), '..', 'LICENSE')))
# write the output file # write the output
output_file_path = path.join(utils.get_script_folder(), '..', 'toml.hpp') with StringIO(newline='\n') as output:
print("Writing to {}".format(output_file_path))
with open(output_file_path,'w', encoding='utf-8', newline='\n') as output_file: # build in a string buffer
write = lambda txt, end='\n': print(txt, file=output, end=end)
if (len(preamble) > 0): if (len(preamble) > 0):
print(utils.make_divider(), file=output_file) write(utils.make_divider())
for pre in preamble: for pre in preamble:
print('//', file=output_file) write('//')
for line in pre.strip().splitlines(): for line in pre.strip().splitlines():
print('//', file=output_file, end = '') if len(line) == 0:
if (len(line) > 0): write('//')
print(' ', file=output_file, end = '') continue
print(line, file=output_file) if not line.startswith('//'):
else: write('// ', end = '')
print('\n', file=output_file, end = '') write(line)
print('//', file=output_file) write('//')
print(utils.make_divider(), file=output_file) write(utils.make_divider())
print('''// clang-format off write('// clang-format off')
#ifndef INCLUDE_TOMLPLUSPLUS_H write('#ifndef INCLUDE_TOMLPLUSPLUS_H')
#define INCLUDE_TOMLPLUSPLUS_H write('#define TOML_LIB_SINGLE_HEADER 1')
write('')
write(source_text)
write('')
write('#endif // INCLUDE_TOMLPLUSPLUS_H')
write('// clang-format on')
#define TOML_LIB_SINGLE_HEADER 1 output_str = output.getvalue().strip()
''', file=output_file)
print(source_text, file=output_file)
print('''
#endif // INCLUDE_TOMLPLUSPLUS_H
// clang-format on''', file=output_file)
# analyze the output to find any potentially missing #undefs
#re_define = re.compile(r'^\s*#\s*define\s+([a-zA-Z0-9_]+)(?:$|\s|\()')
#re_undef = re.compile(r'^\s*#\s*undef\s+([a-zA-Z0-9_]+)(?:$|\s|//)')
#defines = dict()
#for output_line in output_str.splitlines():
# m = re_define.match(output_line)
# if m:
# increment_dict_value(defines, m.group(1))
# else:
# m = re_undef.match(output_line)
# if m:
# increment_dict_value(defines, m.group(1), -1)
#for define, num in defines.items():
# if num > 0:
# print(f" {define} {num}")
# write the output file
output_file_path = path.join(utils.get_script_folder(), '..', 'toml.hpp')
print("Writing to {}".format(output_file_path))
with open(output_file_path,'w', encoding='utf-8', newline='\n') as output_file:
print(output_str, file=output_file)
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -1113,8 +1113,10 @@ def write_to_files(codepoints, header_file, test_file):
header('#pragma once') header('#pragma once')
header('#include "toml_preprocessor.h"') header('#include "toml_preprocessor.h"')
header('') header('')
header('namespace toml::impl') header('namespace toml')
header('{') header('{')
header(' TOML_IMPL_NAMESPACE_START')
header('')
test('#include "tests.h"') test('#include "tests.h"')
test('#include "unicode.h"') test('#include "unicode.h"')
@ -1133,6 +1135,8 @@ def write_to_files(codepoints, header_file, test_file):
emit_category_function('is_unicode_combining_mark', header_file, test_file, codepoints, ('Mn', 'Mc'), unicode_exclusions) emit_category_function('is_unicode_combining_mark', header_file, test_file, codepoints, ('Mn', 'Mc'), unicode_exclusions)
both('#endif // TOML_LANG_UNRELEASED') both('#endif // TOML_LANG_UNRELEASED')
header('')
header(' TOML_IMPL_NAMESPACE_END')
header('} // toml::impl') header('} // toml::impl')

View File

@ -0,0 +1,146 @@
#!/usr/bin/env python3
# This file is a part of toml++ and is subject to the the terms of the MIT license.
# Copyright (c) 2019-2020 Mark Gillard <mark.gillard@outlook.com.au>
# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
# SPDX-License-Identifier: MIT
import sys
import os.path as path
import utils
import re
import itertools
from uuid import UUID, uuid5
def main():
mode_keys = [ 'x86', 'cpplatest', 'unrel', 'noexcept' ]
modes = [ [] ]
for n in range(1, len(mode_keys)):
for combo in itertools.combinations(mode_keys, n):
modes.append([i for i in combo])
modes.append(mode_keys)
for mode in modes:
if 'x86' not in mode:
mode.insert(0, 'x64')
modes.sort()
vs_root = path.join(utils.get_script_folder(), '..', 'vs')
uuid_namespace = UUID('{51C7001B-048C-4AF0-B598-D75E78FF31F0}')
platform_name = lambda x: 'Win32' if x == 'x86' else x
language_level = lambda x: 'Win32' if x == 'x86' else x
for mode in modes:
file_path = path.join(vs_root, 'test_{}.vcxproj'.format('_'.join(mode)))
print("Writing to {}".format(file_path))
with open(file_path, 'w', encoding='utf-8-sig', newline='\r\n') as file:
write = lambda txt: print(txt, file=file)
write(r'''
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|{platform}">
<Configuration>Debug</Configuration>
<Platform>{platform}</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|{platform}">
<Configuration>Release</Configuration>
<Platform>{platform}</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{{{uuid}}}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|{platform}'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|{platform}'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>{exceptions}</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES={unreleased_features};%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>std{standard}</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
'''.strip().format(
platform=next(platform_name(x) for x in mode if x in ('x64', 'x86')),
uuid=str(uuid5(uuid_namespace, '_'.join(mode))).upper(),
exceptions='false' if 'noexcept' in mode else 'Sync',
unreleased_features=1 if 'unrel' in mode else 0,
standard='cpplatest' if 'cpplatest' in mode else 'cpp17'
))
if __name__ == '__main__':
utils.run(main)

View File

@ -263,7 +263,7 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(thevoid)"sv), toml::array{ R"(thevoid)"sv, toml::array{
toml::inserter{toml::array{ toml::inserter{toml::array{
toml::inserter{toml::array{ toml::inserter{toml::array{
toml::inserter{toml::array{ toml::inserter{toml::array{
@ -281,7 +281,7 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(ints)"sv), toml::array{ R"(ints)"sv, toml::array{
1, 1,
2, 2,
3, 3,
@ -295,8 +295,8 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(title)"sv), toml::array{ R"(title)"sv, toml::array{
S(R"( ", )"sv), R"( ", )"sv,
} }
}, },
}}; }};
@ -307,9 +307,9 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(title)"sv), toml::array{ R"(title)"sv, toml::array{
S(R"(Client: "XXXX", Job: XXXX)"sv), R"(Client: "XXXX", Job: XXXX)"sv,
S(R"(Code: XXXX)"sv), R"(Code: XXXX)"sv,
} }
}, },
}}; }};
@ -320,9 +320,9 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(title)"sv), toml::array{ R"(title)"sv, toml::array{
S(R"(Client: XXXX, Job: XXXX)"sv), R"(Client: XXXX, Job: XXXX)"sv,
S(R"(Code: XXXX)"sv), R"(Code: XXXX)"sv,
} }
}, },
}}; }};
@ -333,9 +333,9 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(foo)"sv), toml::array{ R"(foo)"sv, toml::array{
toml::table{{ toml::table{{
{ S(R"(bar)"sv), S(R"("{{baz}}")"sv) }, { R"(bar)"sv, R"("{{baz}}")"sv },
}}, }},
} }
}, },
@ -347,14 +347,14 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(mixed)"sv), toml::array{ R"(mixed)"sv, toml::array{
toml::array{ toml::array{
1, 1,
2, 2,
}, },
toml::array{ toml::array{
S(R"(a)"sv), R"(a)"sv,
S(R"(b)"sv), R"(b)"sv,
}, },
toml::array{ toml::array{
1.1, 1.1,
@ -370,12 +370,12 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(nest)"sv), toml::array{ R"(nest)"sv, toml::array{
toml::array{ toml::array{
S(R"(a)"sv), R"(a)"sv,
}, },
toml::array{ toml::array{
S(R"(b)"sv), R"(b)"sv,
}, },
} }
}, },
@ -387,35 +387,35 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(ints)"sv), toml::array{ R"(ints)"sv, toml::array{
1, 1,
2, 2,
3, 3,
} }
}, },
{ {
S(R"(floats)"sv), toml::array{ R"(floats)"sv, toml::array{
1.1, 1.1,
2.1, 2.1,
3.1, 3.1,
} }
}, },
{ {
S(R"(strings)"sv), toml::array{ R"(strings)"sv, toml::array{
S(R"(a)"sv), R"(a)"sv,
S(R"(b)"sv), R"(b)"sv,
S(R"(c)"sv), R"(c)"sv,
} }
}, },
{ {
S(R"(dates)"sv), toml::array{ R"(dates)"sv, toml::array{
toml::date_time{ { 1987, 7, 5 }, { 17, 45, 0, 0u }, { 0, 0 } }, toml::date_time{ { 1987, 7, 5 }, { 17, 45, 0, 0u }, { 0, 0 } },
toml::date_time{ { 1979, 5, 27 }, { 7, 32, 0, 0u }, { 0, 0 } }, toml::date_time{ { 1979, 5, 27 }, { 7, 32, 0, 0u }, { 0, 0 } },
toml::date_time{ { 2006, 6, 1 }, { 11, 0, 0, 0u }, { 0, 0 } }, toml::date_time{ { 2006, 6, 1 }, { 11, 0, 0, 0u }, { 0, 0 } },
} }
}, },
{ {
S(R"(comments)"sv), toml::array{ R"(comments)"sv, toml::array{
1, 1,
2, 2,
} }
@ -427,8 +427,8 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, bool_, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, bool_, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(f)"sv), false }, { R"(f)"sv, false },
{ S(R"(t)"sv), true }, { R"(t)"sv, true },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -436,7 +436,7 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, comments_at_eof, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, comments_at_eof, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(key)"sv), S(R"(value)"sv) }, { R"(key)"sv, R"(value)"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -444,7 +444,7 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, comments_at_eof2, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, comments_at_eof2, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(key)"sv), S(R"(value)"sv) }, { R"(key)"sv, R"(value)"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -453,10 +453,10 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(group)"sv), toml::table{{ R"(group)"sv, toml::table{{
{ S(R"(answer)"sv), 42 }, { R"(answer)"sv, 42 },
{ {
S(R"(more)"sv), toml::array{ R"(more)"sv, toml::array{
42, 42,
42, 42,
} }
@ -470,7 +470,7 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, datetime_timezone, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, datetime_timezone, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(bestdayever)"sv), toml::date_time{ { 2017, 6, 6 }, { 12, 34, 56, 0u }, { -5, 0 } } }, { R"(bestdayever)"sv, toml::date_time{ { 2017, 6, 6 }, { 12, 34, 56, 0u }, { -5, 0 } } },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -478,7 +478,7 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, double_quote_escape, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, double_quote_escape, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(test)"sv), S(R"("one")"sv) }, { R"(test)"sv, R"("one")"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -492,7 +492,7 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, escaped_escape, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, escaped_escape, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(answer)"sv), S(R"(\x64)"sv) }, { R"(answer)"sv, R"(\x64)"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -500,12 +500,12 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, example, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, example, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(best-day-ever)"sv), toml::date_time{ { 1987, 7, 5 }, { 17, 45, 0, 0u }, { 0, 0 } } }, { R"(best-day-ever)"sv, toml::date_time{ { 1987, 7, 5 }, { 17, 45, 0, 0u }, { 0, 0 } } },
{ {
S(R"(numtheory)"sv), toml::table{{ R"(numtheory)"sv, toml::table{{
{ S(R"(boring)"sv), false }, { R"(boring)"sv, false },
{ {
S(R"(perfection)"sv), toml::array{ R"(perfection)"sv, toml::array{
6, 6,
28, 28,
496, 496,
@ -520,9 +520,9 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, exponent_part_float, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, exponent_part_float, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(million)"sv), 1000000.0 }, { R"(million)"sv, 1000000.0 },
{ S(R"(minustenth)"sv), -0.1 }, { R"(minustenth)"sv, -0.1 },
{ S(R"(beast)"sv), 666.0 }, { R"(beast)"sv, 666.0 },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -530,13 +530,13 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, float_exponent, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, float_exponent, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(lower)"sv), 300.0 }, { R"(lower)"sv, 300.0 },
{ S(R"(upper)"sv), 300.0 }, { R"(upper)"sv, 300.0 },
{ S(R"(neg)"sv), 0.03 }, { R"(neg)"sv, 0.03 },
{ S(R"(pos)"sv), 300.0 }, { R"(pos)"sv, 300.0 },
{ S(R"(zero)"sv), 3.0 }, { R"(zero)"sv, 3.0 },
{ S(R"(pointlower)"sv), 310.0 }, { R"(pointlower)"sv, 310.0 },
{ S(R"(pointupper)"sv), 310.0 }, { R"(pointupper)"sv, 310.0 },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -544,9 +544,9 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, float_underscore, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, float_underscore, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(before)"sv), 3141.5927 }, { R"(before)"sv, 3141.5927 },
{ S(R"(after)"sv), 3141.5927 }, { R"(after)"sv, 3141.5927 },
{ S(R"(exponent)"sv), 300000000000000.0 }, { R"(exponent)"sv, 300000000000000.0 },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -554,10 +554,10 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, float_, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, float_, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(pi)"sv), 3.14 }, { R"(pi)"sv, 3.14 },
{ S(R"(pospi)"sv), 3.14 }, { R"(pospi)"sv, 3.14 },
{ S(R"(negpi)"sv), -3.14 }, { R"(negpi)"sv, -3.14 },
{ S(R"(zero-intpart)"sv), 0.123 }, { R"(zero-intpart)"sv, 0.123 },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -566,13 +566,13 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(a)"sv), toml::table{{ R"(a)"sv, toml::table{{
{ S(R"(better)"sv), 43 }, { R"(better)"sv, 43 },
{ {
S(R"(b)"sv), toml::table{{ R"(b)"sv, toml::table{{
{ {
S(R"(c)"sv), toml::table{{ R"(c)"sv, toml::table{{
{ S(R"(answer)"sv), 42 }, { R"(answer)"sv, 42 },
}} }}
}, },
}} }}
@ -587,13 +587,13 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(a)"sv), toml::table{{ R"(a)"sv, toml::table{{
{ S(R"(better)"sv), 43 }, { R"(better)"sv, 43 },
{ {
S(R"(b)"sv), toml::table{{ R"(b)"sv, toml::table{{
{ {
S(R"(c)"sv), toml::table{{ R"(c)"sv, toml::table{{
{ S(R"(answer)"sv), 42 }, { R"(answer)"sv, 42 },
}} }}
}, },
}} }}
@ -608,12 +608,12 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(a)"sv), toml::table{{ R"(a)"sv, toml::table{{
{ {
S(R"(b)"sv), toml::table{{ R"(b)"sv, toml::table{{
{ {
S(R"(c)"sv), toml::table{{ R"(c)"sv, toml::table{{
{ S(R"(answer)"sv), 42 }, { R"(answer)"sv, 42 },
}} }}
}, },
}} }}
@ -628,18 +628,18 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(people)"sv), toml::array{ R"(people)"sv, toml::array{
toml::table{{ toml::table{{
{ S(R"(first_name)"sv), S(R"(Bruce)"sv) }, { R"(first_name)"sv, R"(Bruce)"sv },
{ S(R"(last_name)"sv), S(R"(Springsteen)"sv) }, { R"(last_name)"sv, R"(Springsteen)"sv },
}}, }},
toml::table{{ toml::table{{
{ S(R"(first_name)"sv), S(R"(Eric)"sv) }, { R"(first_name)"sv, R"(Eric)"sv },
{ S(R"(last_name)"sv), S(R"(Clapton)"sv) }, { R"(last_name)"sv, R"(Clapton)"sv },
}}, }},
toml::table{{ toml::table{{
{ S(R"(first_name)"sv), S(R"(Bob)"sv) }, { R"(first_name)"sv, R"(Bob)"sv },
{ S(R"(last_name)"sv), S(R"(Seger)"sv) }, { R"(last_name)"sv, R"(Seger)"sv },
}}, }},
} }
}, },
@ -651,34 +651,34 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(name)"sv), toml::table{{ R"(name)"sv, toml::table{{
{ S(R"(first)"sv), S(R"(Tom)"sv) }, { R"(first)"sv, R"(Tom)"sv },
{ S(R"(last)"sv), S(R"(Preston-Werner)"sv) }, { R"(last)"sv, R"(Preston-Werner)"sv },
}} }}
}, },
{ {
S(R"(point)"sv), toml::table{{ R"(point)"sv, toml::table{{
{ S(R"(x)"sv), 1 }, { R"(x)"sv, 1 },
{ S(R"(y)"sv), 2 }, { R"(y)"sv, 2 },
}} }}
}, },
{ {
S(R"(simple)"sv), toml::table{{ R"(simple)"sv, toml::table{{
{ S(R"(a)"sv), 1 }, { R"(a)"sv, 1 },
}} }}
}, },
{ {
S(R"(str-key)"sv), toml::table{{ R"(str-key)"sv, toml::table{{
{ S(R"(a)"sv), 1 }, { R"(a)"sv, 1 },
}} }}
}, },
{ {
S(R"(table-array)"sv), toml::array{ R"(table-array)"sv, toml::array{
toml::table{{ toml::table{{
{ S(R"(a)"sv), 1 }, { R"(a)"sv, 1 },
}}, }},
toml::table{{ toml::table{{
{ S(R"(b)"sv), 2 }, { R"(b)"sv, 2 },
}}, }},
} }
}, },
@ -689,7 +689,7 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, integer_underscore, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, integer_underscore, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(kilo)"sv), 1000 }, { R"(kilo)"sv, 1000 },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -697,10 +697,10 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, integer, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, integer, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(answer)"sv), 42 }, { R"(answer)"sv, 42 },
{ S(R"(neganswer)"sv), -42 }, { R"(neganswer)"sv, -42 },
{ S(R"(posanswer)"sv), 42 }, { R"(posanswer)"sv, 42 },
{ S(R"(zero)"sv), 0 }, { R"(zero)"sv, 0 },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -708,7 +708,7 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, key_equals_nospace, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, key_equals_nospace, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(answer)"sv), 42 }, { R"(answer)"sv, 42 },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -716,7 +716,7 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, key_numeric, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, key_numeric, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(1)"sv), 1 }, { R"(1)"sv, 1 },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -724,7 +724,7 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, key_space, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, key_space, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(a b)"sv), 1 }, { R"(a b)"sv, 1 },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -732,7 +732,7 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, key_special_chars, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, key_special_chars, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(~!@$^&*()_+-`1234567890[]|/?><.,;:')"sv), 1 }, { R"(~!@$^&*()_+-`1234567890[]|/?><.,;:')"sv, 1 },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -740,20 +740,20 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, keys_with_dots, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, keys_with_dots, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(plain)"sv), 1 }, { R"(plain)"sv, 1 },
{ S(R"(with.dot)"sv), 2 }, { R"(with.dot)"sv, 2 },
{ {
S(R"(plain_table)"sv), toml::table{{ R"(plain_table)"sv, toml::table{{
{ S(R"(plain)"sv), 3 }, { R"(plain)"sv, 3 },
{ S(R"(with.dot)"sv), 4 }, { R"(with.dot)"sv, 4 },
}} }}
}, },
{ {
S(R"(table)"sv), toml::table{{ R"(table)"sv, toml::table{{
{ {
S(R"(withdot)"sv), toml::table{{ R"(withdot)"sv, toml::table{{
{ S(R"(plain)"sv), 5 }, { R"(plain)"sv, 5 },
{ S(R"(key.with.dots)"sv), 6 }, { R"(key.with.dots)"sv, 6 },
}} }}
}, },
}} }}
@ -765,8 +765,8 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, long_float, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, long_float, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(longpi)"sv), 3.141592653589793 }, { R"(longpi)"sv, 3.141592653589793 },
{ S(R"(neglongpi)"sv), -3.141592653589793 }, { R"(neglongpi)"sv, -3.141592653589793 },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -774,8 +774,8 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, long_integer, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, long_integer, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(answer)"sv), INT64_MAX }, { R"(answer)"sv, INT64_MAX },
{ S(R"(neganswer)"sv), INT64_MIN }, { R"(neganswer)"sv, INT64_MIN },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -783,13 +783,13 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, multiline_string, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, multiline_string, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(multiline_empty_one)"sv), S(R"()"sv) }, { R"(multiline_empty_one)"sv, R"()"sv },
{ S(R"(multiline_empty_two)"sv), S(R"()"sv) }, { R"(multiline_empty_two)"sv, R"()"sv },
{ S(R"(multiline_empty_three)"sv), S(R"()"sv) }, { R"(multiline_empty_three)"sv, R"()"sv },
{ S(R"(multiline_empty_four)"sv), S(R"()"sv) }, { R"(multiline_empty_four)"sv, R"()"sv },
{ S(R"(equivalent_one)"sv), S(R"(The quick brown fox jumps over the lazy dog.)"sv) }, { R"(equivalent_one)"sv, R"(The quick brown fox jumps over the lazy dog.)"sv },
{ S(R"(equivalent_two)"sv), S(R"(The quick brown fox jumps over the lazy dog.)"sv) }, { R"(equivalent_two)"sv, R"(The quick brown fox jumps over the lazy dog.)"sv },
{ S(R"(equivalent_three)"sv), S(R"(The quick brown fox jumps over the lazy dog.)"sv) }, { R"(equivalent_three)"sv, R"(The quick brown fox jumps over the lazy dog.)"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -798,9 +798,9 @@ TEST_CASE("conformance - burntsushi/valid")
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(a)"sv), toml::array{ R"(a)"sv, toml::array{
toml::table{{ toml::table{{
{ S(R"(b)"sv), toml::table{} }, { R"(b)"sv, toml::table{} },
}}, }},
} }
}, },
@ -811,8 +811,8 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, newline_crlf, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, newline_crlf, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(os)"sv), S(R"(DOS)"sv) }, { R"(os)"sv, R"(DOS)"sv },
{ S(R"(newline)"sv), S(R"(crlf)"sv) }, { R"(newline)"sv, R"(crlf)"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -820,8 +820,8 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, newline_lf, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, newline_lf, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(os)"sv), S(R"(unix)"sv) }, { R"(os)"sv, R"(unix)"sv },
{ S(R"(newline)"sv), S(R"(lf)"sv) }, { R"(newline)"sv, R"(lf)"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -829,13 +829,13 @@ TEST_CASE("conformance - burntsushi/valid")
parsing_should_succeed(FILE_LINE_ARGS, raw_multiline_string, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, raw_multiline_string, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(oneline)"sv), S(R"(This string has a ' quote character.)"sv) }, { R"(oneline)"sv, R"(This string has a ' quote character.)"sv },
{ S(R"(firstnl)"sv), S(R"(This string has a ' quote character.)"sv) }, { R"(firstnl)"sv, R"(This string has a ' quote character.)"sv },
{ S(R"(multiline)"sv), S(R"(This string { R"(multiline)"sv, R"(This string
has ' a quote character has ' a quote character
and more than and more than
one newline one newline
in it.)"sv) }, in it.)"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -843,13 +843,13 @@ in it.)"sv) },
parsing_should_succeed(FILE_LINE_ARGS, raw_string, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, raw_string, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(backspace)"sv), S(R"(This string has a \b backspace character.)"sv) }, { R"(backspace)"sv, R"(This string has a \b backspace character.)"sv },
{ S(R"(tab)"sv), S(R"(This string has a \t tab character.)"sv) }, { R"(tab)"sv, R"(This string has a \t tab character.)"sv },
{ S(R"(newline)"sv), S(R"(This string has a \n new line character.)"sv) }, { R"(newline)"sv, R"(This string has a \n new line character.)"sv },
{ S(R"(formfeed)"sv), S(R"(This string has a \f form feed character.)"sv) }, { R"(formfeed)"sv, R"(This string has a \f form feed character.)"sv },
{ S(R"(carriage)"sv), S(R"(This string has a \r carriage return character.)"sv) }, { R"(carriage)"sv, R"(This string has a \r carriage return character.)"sv },
{ S(R"(slash)"sv), S(R"(This string has a \/ slash character.)"sv) }, { R"(slash)"sv, R"(This string has a \/ slash character.)"sv },
{ S(R"(backslash)"sv), S(R"(This string has a \\ backslash character.)"sv) }, { R"(backslash)"sv, R"(This string has a \\ backslash character.)"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -858,10 +858,10 @@ in it.)"sv) },
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(black)"sv), toml::table{{ R"(black)"sv, toml::table{{
{ S(R"(allow_prereleases)"sv), true }, { R"(allow_prereleases)"sv, true },
{ S(R"(python)"sv), S(R"(>3.6)"sv) }, { R"(python)"sv, R"(>3.6)"sv },
{ S(R"(version)"sv), S(R"(>=18.9b0)"sv) }, { R"(version)"sv, R"(>=18.9b0)"sv },
}} }}
}, },
}}; }};
@ -871,7 +871,7 @@ in it.)"sv) },
parsing_should_succeed(FILE_LINE_ARGS, string_empty, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, string_empty, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(answer)"sv), S(R"()"sv) }, { R"(answer)"sv, R"()"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -879,13 +879,13 @@ in it.)"sv) },
parsing_should_succeed(FILE_LINE_ARGS, string_nl, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, string_nl, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(nl_mid)"sv), S(R"(val { R"(nl_mid)"sv, R"(val
ue)"sv) }, ue)"sv },
{ S(R"(nl_end)"sv), S(R"(value { R"(nl_end)"sv, R"(value
)"sv) }, )"sv },
{ S(R"(lit_nl_end)"sv), S(R"(value\n)"sv) }, { R"(lit_nl_end)"sv, R"(value\n)"sv },
{ S(R"(lit_nl_mid)"sv), S(R"(val\nue)"sv) }, { R"(lit_nl_mid)"sv, R"(val\nue)"sv },
{ S(R"(lit_nl_uni)"sv), S(R"(val\ue)"sv) }, { R"(lit_nl_uni)"sv, R"(val\ue)"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -893,7 +893,7 @@ ue)"sv) },
parsing_should_succeed(FILE_LINE_ARGS, string_simple, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, string_simple, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(answer)"sv), S(R"(You are not drinking enough whisky.)"sv) }, { R"(answer)"sv, R"(You are not drinking enough whisky.)"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -901,8 +901,8 @@ ue)"sv) },
parsing_should_succeed(FILE_LINE_ARGS, string_with_pound, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, string_with_pound, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(pound)"sv), S(R"(We see no # comments here.)"sv) }, { R"(pound)"sv, R"(We see no # comments here.)"sv },
{ S(R"(poundcomment)"sv), S(R"(But there are # some comments here.)"sv) }, { R"(poundcomment)"sv, R"(But there are # some comments here.)"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -911,11 +911,11 @@ ue)"sv) },
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(albums)"sv), toml::table{{ R"(albums)"sv, toml::table{{
{ {
S(R"(songs)"sv), toml::array{ R"(songs)"sv, toml::array{
toml::table{{ toml::table{{
{ S(R"(name)"sv), S(R"(Glory Days)"sv) }, { R"(name)"sv, R"(Glory Days)"sv },
}}, }},
} }
}, },
@ -929,18 +929,18 @@ ue)"sv) },
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(people)"sv), toml::array{ R"(people)"sv, toml::array{
toml::table{{ toml::table{{
{ S(R"(first_name)"sv), S(R"(Bruce)"sv) }, { R"(first_name)"sv, R"(Bruce)"sv },
{ S(R"(last_name)"sv), S(R"(Springsteen)"sv) }, { R"(last_name)"sv, R"(Springsteen)"sv },
}}, }},
toml::table{{ toml::table{{
{ S(R"(first_name)"sv), S(R"(Eric)"sv) }, { R"(first_name)"sv, R"(Eric)"sv },
{ S(R"(last_name)"sv), S(R"(Clapton)"sv) }, { R"(last_name)"sv, R"(Clapton)"sv },
}}, }},
toml::table{{ toml::table{{
{ S(R"(first_name)"sv), S(R"(Bob)"sv) }, { R"(first_name)"sv, R"(Bob)"sv },
{ S(R"(last_name)"sv), S(R"(Seger)"sv) }, { R"(last_name)"sv, R"(Seger)"sv },
}}, }},
} }
}, },
@ -952,29 +952,29 @@ ue)"sv) },
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(albums)"sv), toml::array{ R"(albums)"sv, toml::array{
toml::table{{ toml::table{{
{ S(R"(name)"sv), S(R"(Born to Run)"sv) }, { R"(name)"sv, R"(Born to Run)"sv },
{ {
S(R"(songs)"sv), toml::array{ R"(songs)"sv, toml::array{
toml::table{{ toml::table{{
{ S(R"(name)"sv), S(R"(Jungleland)"sv) }, { R"(name)"sv, R"(Jungleland)"sv },
}}, }},
toml::table{{ toml::table{{
{ S(R"(name)"sv), S(R"(Meeting Across the River)"sv) }, { R"(name)"sv, R"(Meeting Across the River)"sv },
}}, }},
} }
}, },
}}, }},
toml::table{{ toml::table{{
{ S(R"(name)"sv), S(R"(Born in the USA)"sv) }, { R"(name)"sv, R"(Born in the USA)"sv },
{ {
S(R"(songs)"sv), toml::array{ R"(songs)"sv, toml::array{
toml::table{{ toml::table{{
{ S(R"(name)"sv), S(R"(Glory Days)"sv) }, { R"(name)"sv, R"(Glory Days)"sv },
}}, }},
toml::table{{ toml::table{{
{ S(R"(name)"sv), S(R"(Dancing in the Dark)"sv) }, { R"(name)"sv, R"(Dancing in the Dark)"sv },
}}, }},
} }
}, },
@ -989,10 +989,10 @@ ue)"sv) },
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(people)"sv), toml::array{ R"(people)"sv, toml::array{
toml::table{{ toml::table{{
{ S(R"(first_name)"sv), S(R"(Bruce)"sv) }, { R"(first_name)"sv, R"(Bruce)"sv },
{ S(R"(last_name)"sv), S(R"(Springsteen)"sv) }, { R"(last_name)"sv, R"(Springsteen)"sv },
}}, }},
} }
}, },
@ -1004,21 +1004,21 @@ ue)"sv) },
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(a)"sv), toml::array{ R"(a)"sv, toml::array{
toml::table{{ toml::table{{
{ {
S(R"(b)"sv), toml::array{ R"(b)"sv, toml::array{
toml::table{{ toml::table{{
{ {
S(R"(c)"sv), toml::table{{ R"(c)"sv, toml::table{{
{ S(R"(d)"sv), S(R"(val0)"sv) }, { R"(d)"sv, R"(val0)"sv },
}} }}
}, },
}}, }},
toml::table{{ toml::table{{
{ {
S(R"(c)"sv), toml::table{{ R"(c)"sv, toml::table{{
{ S(R"(d)"sv), S(R"(val1)"sv) }, { R"(d)"sv, R"(val1)"sv },
}} }}
}, },
}}, }},
@ -1034,7 +1034,7 @@ ue)"sv) },
parsing_should_succeed(FILE_LINE_ARGS, table_empty, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, table_empty, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(a)"sv), toml::table{} }, { R"(a)"sv, toml::table{} },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -1042,7 +1042,7 @@ ue)"sv) },
parsing_should_succeed(FILE_LINE_ARGS, table_no_eol, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, table_no_eol, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(table)"sv), toml::table{} }, { R"(table)"sv, toml::table{} },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -1051,8 +1051,8 @@ ue)"sv) },
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(a)"sv), toml::table{{ R"(a)"sv, toml::table{{
{ S(R"(b)"sv), toml::table{} }, { R"(b)"sv, toml::table{} },
}} }}
}, },
}}; }};
@ -1062,7 +1062,7 @@ ue)"sv) },
parsing_should_succeed(FILE_LINE_ARGS, table_whitespace, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, table_whitespace, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(valid key)"sv), toml::table{} }, { R"(valid key)"sv, toml::table{} },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -1071,12 +1071,12 @@ ue)"sv) },
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(a)"sv), toml::table{{ R"(a)"sv, toml::table{{
{ {
S(R"("b")"sv), toml::table{{ R"("b")"sv, toml::table{{
{ {
S(R"(c)"sv), toml::table{{ R"(c)"sv, toml::table{{
{ S(R"(answer)"sv), 42 }, { R"(answer)"sv, 42 },
}} }}
}, },
}} }}
@ -1091,8 +1091,8 @@ ue)"sv) },
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(key#group)"sv), toml::table{{ R"(key#group)"sv, toml::table{{
{ S(R"(answer)"sv), 42 }, { R"(answer)"sv, 42 },
}} }}
}, },
}}; }};
@ -1103,12 +1103,12 @@ ue)"sv) },
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ {
S(R"(a)"sv), toml::table{{ R"(a)"sv, toml::table{{
{ {
S(R"(b)"sv), toml::table{{ R"(b)"sv, toml::table{{
{ {
S(R"(c)"sv), toml::table{{ R"(c)"sv, toml::table{{
{ S(R"(answer)"sv), 42 }, { R"(answer)"sv, 42 },
}} }}
}, },
}} }}
@ -1122,7 +1122,7 @@ ue)"sv) },
parsing_should_succeed(FILE_LINE_ARGS, underscored_float, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, underscored_float, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(electron_mass)"sv), 9.109109383e-31 }, { R"(electron_mass)"sv, 9.109109383e-31 },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -1130,7 +1130,7 @@ ue)"sv) },
parsing_should_succeed(FILE_LINE_ARGS, underscored_integer, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, underscored_integer, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(million)"sv), 1000000 }, { R"(million)"sv, 1000000 },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -1138,8 +1138,8 @@ ue)"sv) },
parsing_should_succeed(FILE_LINE_ARGS, unicode_escape, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, unicode_escape, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(answer4)"sv), S(R"(δ)"sv) }, { R"(answer4)"sv, R"(δ)"sv },
{ S(R"(answer8)"sv), S(R"(δ)"sv) }, { R"(answer8)"sv, R"(δ)"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });
@ -1147,7 +1147,7 @@ ue)"sv) },
parsing_should_succeed(FILE_LINE_ARGS, unicode_literal, [](toml::table&& tbl) parsing_should_succeed(FILE_LINE_ARGS, unicode_literal, [](toml::table&& tbl)
{ {
auto expected = toml::table{{ auto expected = toml::table{{
{ S(R"(answer)"sv), S(R"(δ)"sv) }, { R"(answer)"sv, R"(δ)"sv },
}}; }};
REQUIRE(tbl == expected); REQUIRE(tbl == expected);
}); });

File diff suppressed because it is too large Load Diff

View File

@ -39,6 +39,31 @@ namespace toml
using std::declval; using std::declval;
using std::is_same_v; using std::is_same_v;
#define CHECK_NODE_TYPE_MAPPING(T, expected) \
static_assert(impl::node_type_of<T> == expected); \
static_assert(impl::node_type_of<T&> == expected); \
static_assert(impl::node_type_of<T&&> == expected); \
static_assert(impl::node_type_of<const T> == expected); \
static_assert(impl::node_type_of<const T&> == expected); \
static_assert(impl::node_type_of<const T&&> == expected); \
static_assert(impl::node_type_of<volatile T> == expected); \
static_assert(impl::node_type_of<volatile T&> == expected); \
static_assert(impl::node_type_of<volatile T&&> == expected); \
static_assert(impl::node_type_of<const volatile T> == expected); \
static_assert(impl::node_type_of<const volatile T&> == expected); \
static_assert(impl::node_type_of<const volatile T&&> == expected)
CHECK_NODE_TYPE_MAPPING(int64_t, node_type::integer);
CHECK_NODE_TYPE_MAPPING(double, node_type::floating_point);
CHECK_NODE_TYPE_MAPPING(std::string, node_type::string);
CHECK_NODE_TYPE_MAPPING(bool, node_type::boolean);
CHECK_NODE_TYPE_MAPPING(toml::date, node_type::date);
CHECK_NODE_TYPE_MAPPING(toml::time, node_type::time);
CHECK_NODE_TYPE_MAPPING(toml::date_time, node_type::date_time);
CHECK_NODE_TYPE_MAPPING(toml::array, node_type::array);
CHECK_NODE_TYPE_MAPPING(toml::table, node_type::table);
#define CHECK_CAN_REPRESENT_NATIVE(T, expected) \ #define CHECK_CAN_REPRESENT_NATIVE(T, expected) \
static_assert((impl::value_traits<T>::is_native || impl::value_traits<T>::can_represent_native) == expected) static_assert((impl::value_traits<T>::is_native || impl::value_traits<T>::can_represent_native) == expected)

View File

@ -20,15 +20,15 @@ TEST_CASE("arrays - moving")
CHECK(*tbl.source().path == filename); CHECK(*tbl.source().path == filename);
CHECK(tbl.size() == 1_sz); CHECK(tbl.size() == 1_sz);
auto arr1 = tbl[S("test")].as<array>(); auto arr1 = tbl["test"].as<array>();
REQUIRE(arr1); REQUIRE(arr1);
CHECK(arr1->size() == 1_sz); CHECK(arr1->size() == 1_sz);
CHECK(arr1->source().begin == source_position{ 1, 8 }); CHECK(arr1->source().begin == source_position{ 1, 8 });
CHECK(arr1->source().end == source_position{ 1, 17 }); CHECK(arr1->source().end == source_position{ 1, 17 });
CHECK(arr1->source().path); CHECK(arr1->source().path);
CHECK(*arr1->source().path == filename); CHECK(*arr1->source().path == filename);
REQUIRE(arr1->get_as<string>(0_sz)); REQUIRE(arr1->get_as<std::string>(0_sz));
CHECK(*arr1->get_as<string>(0_sz) == S("foo"sv)); CHECK(*arr1->get_as<std::string>(0_sz) == "foo"sv);
array arr2; array arr2;
CHECK(arr2.source().begin == source_position{}); CHECK(arr2.source().begin == source_position{});
@ -42,8 +42,8 @@ TEST_CASE("arrays - moving")
CHECK(arr2.source().path); CHECK(arr2.source().path);
CHECK(*arr2.source().path == filename); CHECK(*arr2.source().path == filename);
CHECK(arr2.size() == 1_sz); CHECK(arr2.size() == 1_sz);
REQUIRE(arr2.get_as<string>(0_sz)); REQUIRE(arr2.get_as<std::string>(0_sz));
CHECK(*arr2.get_as<string>(0_sz) == S("foo"sv)); CHECK(*arr2.get_as<std::string>(0_sz) == "foo"sv);
CHECK(arr1->source().begin == source_position{}); CHECK(arr1->source().begin == source_position{});
CHECK(arr1->source().end == source_position{}); CHECK(arr1->source().end == source_position{});
@ -79,16 +79,17 @@ TEST_CASE("arrays - construction")
CHECK(*arr.get_as<int64_t>(0_sz) == 42); CHECK(*arr.get_as<int64_t>(0_sz) == 42);
CHECK(arr.is_homogeneous()); CHECK(arr.is_homogeneous());
CHECK(arr.is_homogeneous<int64_t>()); CHECK(arr.is_homogeneous<int64_t>());
CHECK(!arr.is_homogeneous<double>());
} }
{ {
array arr{ 42, S("test"sv), 10.0f, array{}, value{ 3 } }; array arr{ 42, "test"sv, 10.0f, array{}, value{ 3 } };
CHECK(arr.size() == 5_sz); CHECK(arr.size() == 5_sz);
CHECK(!arr.empty()); CHECK(!arr.empty());
REQUIRE(arr.get_as<int64_t>(0_sz)); REQUIRE(arr.get_as<int64_t>(0_sz));
CHECK(*arr.get_as<int64_t>(0_sz) == 42); CHECK(*arr.get_as<int64_t>(0_sz) == 42);
REQUIRE(arr.get_as<string>(1_sz)); REQUIRE(arr.get_as<std::string>(1_sz));
CHECK(*arr.get_as<string>(1_sz) == S("test"sv)); CHECK(*arr.get_as<std::string>(1_sz) == "test"sv);
REQUIRE(arr.get_as<double>(2_sz)); REQUIRE(arr.get_as<double>(2_sz));
CHECK(*arr.get_as<double>(2_sz) == 10.0); CHECK(*arr.get_as<double>(2_sz) == 10.0);
REQUIRE(arr.get_as<array>(3_sz)); REQUIRE(arr.get_as<array>(3_sz));
@ -96,6 +97,19 @@ TEST_CASE("arrays - construction")
CHECK(*arr.get_as<int64_t>(4_sz) == 3); CHECK(*arr.get_as<int64_t>(4_sz) == 3);
CHECK(!arr.is_homogeneous()); CHECK(!arr.is_homogeneous());
} }
#if TOML_WINDOWS_COMPAT
{
array arr{ "mixed", "string"sv, L"test", L"kek"sv };
CHECK(arr.size() == 4_sz);
CHECK(arr.is_homogeneous());
CHECK(arr.is_homogeneous<std::string>());
CHECK(*arr.get_as<std::string>(0) == "mixed"sv);
CHECK(*arr.get_as<std::string>(1) == "string"sv);
CHECK(*arr.get_as<std::string>(2) == "test"sv);
CHECK(*arr.get_as<std::string>(3) == "kek"sv);
}
#endif // TOML_WINDOWS_COMPAT
} }
TEST_CASE("arrays - equality") TEST_CASE("arrays - equality")
@ -170,44 +184,60 @@ TEST_CASE("arrays - insertion and erasure")
REQUIRE(arr == array{ array{ 1, 2, 3 }, 42, 10.0, 10.0, 10.0 }); REQUIRE(arr == array{ array{ 1, 2, 3 }, 42, 10.0, 10.0, 10.0 });
{ {
decltype(auto) val = arr.push_back(S("test"sv)); decltype(auto) val = arr.push_back("test"sv);
CHECK(arr.size() == 6_sz); CHECK(arr.size() == 6_sz);
REQUIRE(arr.get_as<string>(5_sz)); REQUIRE(arr.get_as<std::string>(5_sz));
CHECK(*arr.get_as<string>(5_sz) == S("test"sv)); CHECK(*arr.get_as<std::string>(5_sz) == "test"sv);
CHECK(val == S("test"sv)); CHECK(val == "test"sv);
CHECK(&val == &arr.back()); CHECK(&val == &arr.back());
REQUIRE(arr == array{ array{ 1, 2, 3 }, 42, 10.0, 10.0, 10.0, S("test"sv) }); REQUIRE(arr == array{ array{ 1, 2, 3 }, 42, 10.0, 10.0, 10.0, "test"sv });
} }
{ {
decltype(auto) val = arr.emplace_back<string>(S("test2"sv)); decltype(auto) val = arr.emplace_back<std::string>("test2"sv);
CHECK(arr.size() == 7_sz); CHECK(arr.size() == 7_sz);
REQUIRE(arr.get_as<string>(6_sz)); REQUIRE(arr.get_as<std::string>(6_sz));
CHECK(*arr.get_as<string>(6_sz) == S("test2"sv)); CHECK(*arr.get_as<std::string>(6_sz) == "test2"sv);
CHECK(val == S("test2"sv)); CHECK(val == "test2"sv);
CHECK(&val == &arr.back()); CHECK(&val == &arr.back());
REQUIRE(arr == array{ array{ 1, 2, 3 }, 42, 10.0, 10.0, 10.0, S("test"sv), S("test2"sv) }); REQUIRE(arr == array{ array{ 1, 2, 3 }, 42, 10.0, 10.0, 10.0, "test"sv, "test2"sv });
} }
it = arr.erase(arr.cbegin()); it = arr.erase(arr.cbegin());
REQUIRE(arr == array{ 42, 10.0, 10.0, 10.0, S("test"sv), S("test2"sv) }); REQUIRE(arr == array{ 42, 10.0, 10.0, 10.0, "test"sv, "test2"sv });
CHECK(it == arr.begin()); CHECK(it == arr.begin());
CHECK(arr.size() == 6_sz); CHECK(arr.size() == 6_sz);
it = arr.erase(arr.cbegin() + 2, arr.cbegin() + 4); it = arr.erase(arr.cbegin() + 2, arr.cbegin() + 4);
REQUIRE(arr == array{ 42, 10.0, S("test"sv), S("test2"sv) }); REQUIRE(arr == array{ 42, 10.0, "test"sv, "test2"sv });
CHECK(it == arr.begin() + 2); CHECK(it == arr.begin() + 2);
CHECK(arr.size() == 4_sz); CHECK(arr.size() == 4_sz);
arr.pop_back(); arr.pop_back();
REQUIRE(arr == array{ 42, 10.0, S("test"sv) }); REQUIRE(arr == array{ 42, 10.0, "test"sv });
CHECK(arr.size() == 3_sz); CHECK(arr.size() == 3_sz);
arr.clear(); arr.clear();
REQUIRE(arr == array{}); REQUIRE(arr == array{});
CHECK(arr.size() == 0_sz); CHECK(arr.size() == 0_sz);
CHECK(arr.empty()); CHECK(arr.empty());
#if TOML_WINDOWS_COMPAT
it = arr.insert(arr.cbegin(), L"test");
REQUIRE(*arr.get_as<std::string>(0_sz) == "test"sv);
it = arr.emplace<std::string>(arr.cbegin(), L"test2"sv);
REQUIRE(*arr.get_as<std::string>(0_sz) == "test2"sv);
arr.push_back(L"test3"s);
REQUIRE(*arr.back().as_string() == "test3"sv);
arr.emplace_back<std::string>(L"test4");
REQUIRE(*arr.back().as_string() == "test4"sv);
#endif // TOML_WINDOWS_COMPAT
} }
TEST_CASE("arrays - flattening") TEST_CASE("arrays - flattening")

View File

@ -27,9 +27,9 @@ TEST_CASE("parse_result - good parse")
REQUIRE(!static_cast<const table&>(result).empty()); REQUIRE(!static_cast<const table&>(result).empty());
auto& tbl = static_cast<table&>(result); auto& tbl = static_cast<table&>(result);
CHECK(tbl[S("key"sv)]); CHECK(tbl["key"sv]);
CHECK(result[S("key"sv)]); CHECK(result["key"sv]);
CHECK(&result[S("key"sv)].ref<bool>() == &tbl[S("key"sv)].ref<bool>()); CHECK(&result["key"sv].ref<bool>() == &tbl["key"sv].ref<bool>());
CHECK(result.begin() == tbl.begin()); CHECK(result.begin() == tbl.begin());
CHECK(result.end() == tbl.end()); CHECK(result.end() == tbl.end());
CHECK(result.begin() != tbl.end()); CHECK(result.begin() != tbl.end());
@ -45,9 +45,9 @@ TEST_CASE("parse_result - good parse")
CHECK(cresult.cbegin() == ctbl.cbegin()); CHECK(cresult.cbegin() == ctbl.cbegin());
CHECK(cresult.cend() == ctbl.cend()); CHECK(cresult.cend() == ctbl.cend());
CHECK(cresult.cbegin() != ctbl.cend()); CHECK(cresult.cbegin() != ctbl.cend());
CHECK(ctbl[S("key"sv)]); CHECK(ctbl["key"sv]);
CHECK(cresult[S("key"sv)]); CHECK(cresult["key"sv]);
CHECK(&cresult[S("key"sv)].ref<bool>() == &ctbl[S("key"sv)].ref<bool>()); CHECK(&cresult["key"sv].ref<bool>() == &ctbl["key"sv].ref<bool>());
size_t tbl_iterations{}; size_t tbl_iterations{};
for (auto&& [k, v] : tbl) for (auto&& [k, v] : tbl)
@ -83,14 +83,14 @@ TEST_CASE("parse_result - bad parse")
REQUIRE(result.failed()); REQUIRE(result.failed());
REQUIRE(!result); REQUIRE(!result);
CHECK(!result[S("key"sv)]); CHECK(!result["key"sv]);
CHECK(result.begin() == decltype(result.begin()){}); CHECK(result.begin() == decltype(result.begin()){});
CHECK(result.end() == decltype(result.end()){}); CHECK(result.end() == decltype(result.end()){});
CHECK(result.cbegin() == decltype(result.cbegin()){}); CHECK(result.cbegin() == decltype(result.cbegin()){});
CHECK(result.cend() == decltype(result.cend()){}); CHECK(result.cend() == decltype(result.cend()){});
auto& cresult = static_cast<const parse_result&>(result); auto& cresult = static_cast<const parse_result&>(result);
CHECK(!result[S("key"sv)]); CHECK(!result["key"sv]);
CHECK(cresult.begin() == decltype(cresult.begin()){}); CHECK(cresult.begin() == decltype(cresult.begin()){});
CHECK(cresult.end() == decltype(cresult.end()){}); CHECK(cresult.end() == decltype(cresult.end()){});
CHECK(cresult.cbegin() == decltype(cresult.cbegin()){}); CHECK(cresult.cbegin() == decltype(cresult.cbegin()){});

View File

@ -20,11 +20,11 @@ TEST_CASE("tables - moving")
CHECK(*tbl.source().path == filename); CHECK(*tbl.source().path == filename);
CHECK(tbl.size() == 1_sz); CHECK(tbl.size() == 1_sz);
REQUIRE(tbl[S("test")].as<table>()); REQUIRE(tbl["test"].as<table>());
CHECK(tbl[S("test")].as<table>()->size() == 1_sz); CHECK(tbl["test"].as<table>()->size() == 1_sz);
CHECK(tbl[S("test")].as<table>()->source().begin == source_position{ 1, 8 }); CHECK(tbl["test"].as<table>()->source().begin == source_position{ 1, 8 });
CHECK(tbl[S("test")].as<table>()->source().end == source_position{ 1, 24 }); CHECK(tbl["test"].as<table>()->source().end == source_position{ 1, 24 });
CHECK(tbl[S("test")][S("val1")] == S("foo"sv)); CHECK(tbl["test"]["val1"] == "foo");
table tbl2 = std::move(tbl); table tbl2 = std::move(tbl);
CHECK(tbl2.source().begin == source_position{ 1, 1 }); CHECK(tbl2.source().begin == source_position{ 1, 1 });
@ -32,15 +32,15 @@ TEST_CASE("tables - moving")
CHECK(tbl2.source().path); CHECK(tbl2.source().path);
CHECK(*tbl2.source().path == filename); CHECK(*tbl2.source().path == filename);
CHECK(tbl2.size() == 1_sz); CHECK(tbl2.size() == 1_sz);
REQUIRE(tbl2[S("test")].as<table>()); REQUIRE(tbl2["test"].as<table>());
CHECK(tbl2[S("test")].as<table>()->size() == 1_sz); CHECK(tbl2["test"].as<table>()->size() == 1_sz);
CHECK(tbl2[S("test")][S("val1")] == S("foo"sv)); CHECK(tbl2["test"]["val1"] == "foo"sv);
CHECK(tbl.source().begin == source_position{}); CHECK(tbl.source().begin == source_position{});
CHECK(tbl.source().end == source_position{}); CHECK(tbl.source().end == source_position{});
CHECK(!tbl.source().path); CHECK(!tbl.source().path);
CHECK(tbl.size() == 0_sz); CHECK(tbl.size() == 0_sz);
CHECK(!tbl[S("test")].as<table>()); CHECK(!tbl["test"].as<table>());
}, },
filename filename
); );
@ -61,72 +61,93 @@ TEST_CASE("tables - construction")
{ {
table tbl{{ table tbl{{
{ S("foo"sv), 42 } { "foo"sv, 42 }
}}; }};
CHECK(tbl.size() == 1_sz); CHECK(tbl.size() == 1_sz);
CHECK(!tbl.empty()); CHECK(!tbl.empty());
CHECK(tbl.begin() != tbl.end()); CHECK(tbl.begin() != tbl.end());
CHECK(tbl.cbegin() != tbl.cend()); CHECK(tbl.cbegin() != tbl.cend());
REQUIRE(tbl.get_as<int64_t>(S("foo"sv))); REQUIRE(tbl.get_as<int64_t>("foo"sv));
CHECK(*tbl.get_as<int64_t>(S("foo"sv)) == 42); CHECK(*tbl.get_as<int64_t>("foo"sv) == 42);
} }
{ {
table tbl{{ table tbl{{
{ S("foo"sv), 42 }, { "foo"sv, 42 },
{ S("bar"sv), 10.0 }, { "bar"sv, 10.0 },
{ S("kek"sv), false }, { "kek"sv, false },
{ S("qux"sv), array{ 1 } } { "qux"sv, array{ 1 } }
}}; }};
CHECK(tbl.size() == 4_sz); CHECK(tbl.size() == 4_sz);
CHECK(!tbl.empty()); CHECK(!tbl.empty());
REQUIRE(tbl.get_as<int64_t>(S("foo"sv))); REQUIRE(tbl.get_as<int64_t>("foo"sv));
CHECK(*tbl.get_as<int64_t>(S("foo"sv)) == 42); CHECK(*tbl.get_as<int64_t>("foo"sv) == 42);
REQUIRE(tbl.get_as<double>(S("bar"sv))); REQUIRE(tbl.get_as<double>("bar"sv));
CHECK(*tbl.get_as<double>(S("bar"sv)) == 10.0); CHECK(*tbl.get_as<double>("bar"sv) == 10.0);
REQUIRE(tbl.get_as<bool>(S("kek"sv))); REQUIRE(tbl.get_as<bool>("kek"sv));
CHECK(*tbl.get_as<bool>(S("kek"sv)) == false); CHECK(*tbl.get_as<bool>("kek"sv) == false);
REQUIRE(tbl.get_as<array>(S("qux"sv))); REQUIRE(tbl.get_as<array>("qux"sv));
CHECK(*tbl.get_as<array>(S("qux"sv)) == array{ 1 }); CHECK(*tbl.get_as<array>("qux"sv) == array{ 1 });
} }
#if TOML_WINDOWS_COMPAT
{
table tbl{ {
{ L"foo", L"test1" },
{ L"bar"sv, L"test2"sv },
{ L"kek"s, L"test3"sv },
{ L"qux"sv.data(), L"test4"sv.data() }
} };
CHECK(tbl.size() == 4_sz);
CHECK(!tbl.empty());
REQUIRE(tbl.get_as<std::string>("foo"sv));
CHECK(*tbl.get_as<std::string>("foo"sv) == "test1"sv);
REQUIRE(tbl.get_as<std::string>("bar"sv));
CHECK(*tbl.get_as<std::string>("bar"sv) == "test2"sv);
REQUIRE(tbl.get_as<std::string>("kek"sv));
CHECK(*tbl.get_as<std::string>("kek"sv) == "test3"sv);
REQUIRE(tbl.get_as<std::string>("qux"sv));
CHECK(*tbl.get_as<std::string>("qux"sv) == "test4"sv);
}
#endif // TOML_WINDOWS_COMPAT
} }
TEST_CASE("tables - equality") TEST_CASE("tables - equality")
{ {
static constexpr const string_char* one = S("one"); static constexpr const char* one = "one";
table tbl1{{ table tbl1{{
{ one, 1 }, { one, 1 },
{ S("two"), 2 }, { "two", 2 },
{ S("three"), 3 } { "three", 3 }
}}; }};
CHECK(tbl1 == tbl1); CHECK(tbl1 == tbl1);
table tbl2{{ table tbl2{{
{ S("one"sv), 1 }, { "one"sv, 1 },
{ S("two"sv), 2 }, { "two"sv, 2 },
{ S("three"sv), 3 } { "three"sv, 3 }
}}; }};
CHECK(tbl1 == tbl2); CHECK(tbl1 == tbl2);
table tbl3{{ table tbl3{{
{ S("one"sv), 1 }, { "one"sv, 1 },
{ S("two"sv), 2 } { "two"sv, 2 }
}}; }};
CHECK(tbl1 != tbl3); CHECK(tbl1 != tbl3);
table tbl4{{ table tbl4{{
{ S("one"sv), 1 }, { "one"sv, 1 },
{ S("two"sv), 2 }, { "two"sv, 2 },
{ S("three"sv), 3 }, { "three"sv, 3 },
{ S("four"sv), 4 } { "four"sv, 4 }
}}; }};
CHECK(tbl1 != tbl4); CHECK(tbl1 != tbl4);
table tbl5{{ table tbl5{{
{ S("one"sv), 1 }, { "one"sv, 1 },
{ S("two"sv), 2 }, { "two"sv, 2 },
{ S("three"sv), 3.0 } { "three"sv, 3.0 }
}}; }};
CHECK(tbl1 != tbl5); CHECK(tbl1 != tbl5);
@ -160,71 +181,71 @@ namespace
TEST_CASE("tables - insertion and erasure") TEST_CASE("tables - insertion and erasure")
{ {
table tbl; table tbl;
auto res = tbl.insert(S("a"), 42); auto res = tbl.insert("a", 42);
CHECK(res.first == tbl.begin()); CHECK(res.first == tbl.begin());
CHECK(res.second == true); CHECK(res.second == true);
CHECK(tbl.size() == 1_sz); CHECK(tbl.size() == 1_sz);
CHECK(!tbl.empty()); CHECK(!tbl.empty());
REQUIRE(tbl.get_as<int64_t>(S("a"sv))); REQUIRE(tbl.get_as<int64_t>("a"sv));
CHECK(*tbl.get_as<int64_t>(S("a"sv)) == 42); CHECK(*tbl.get_as<int64_t>("a"sv) == 42);
REQUIRE(tbl == table{{ { S("a"sv), 42 } }}); REQUIRE(tbl == table{{ { "a"sv, 42 } }});
res = tbl.insert(S("a"), 69); res = tbl.insert("a", 69);
CHECK(res.first == tbl.begin()); CHECK(res.first == tbl.begin());
CHECK(res.second == false); CHECK(res.second == false);
CHECK(tbl.size() == 1_sz); CHECK(tbl.size() == 1_sz);
REQUIRE(tbl.get_as<int64_t>(S("a"))); REQUIRE(tbl.get_as<int64_t>("a"));
CHECK(*tbl.get_as<int64_t>(S("a")) == 42); CHECK(*tbl.get_as<int64_t>("a") == 42);
REQUIRE(tbl == table{{ { S("a"sv), 42 } }}); REQUIRE(tbl == table{{ { "a"sv, 42 } }});
static constexpr const string_char* a = S("a"); static constexpr const char* a = "a";
res = tbl.insert_or_assign(a, 69); res = tbl.insert_or_assign(a, 69);
CHECK(res.first == tbl.begin()); CHECK(res.first == tbl.begin());
CHECK(res.second == false); // should assign CHECK(res.second == false); // should assign
CHECK(tbl.size() == 1_sz); CHECK(tbl.size() == 1_sz);
REQUIRE(tbl.get_as<int64_t>(S("a"))); REQUIRE(tbl.get_as<int64_t>("a"));
CHECK(*tbl.get_as<int64_t>(S("a")) == 69); CHECK(*tbl.get_as<int64_t>("a") == 69);
REQUIRE(tbl == table{{ { S("a"sv), 69 } }}); REQUIRE(tbl == table{{ { "a"sv, 69 } }});
res = tbl.insert_or_assign(S("b"), S("kek")); res = tbl.insert_or_assign("b", "kek");
CHECK(res.first == advance(tbl.begin(), 1)); CHECK(res.first == advance(tbl.begin(), 1));
CHECK(res.second == true); // should insert CHECK(res.second == true); // should insert
CHECK(tbl.size() == 2_sz); CHECK(tbl.size() == 2_sz);
REQUIRE(tbl.get_as<string>(S("b"))); REQUIRE(tbl.get_as<std::string>("b"));
CHECK(*tbl.get_as<string>(S("b")) == S("kek"sv)); CHECK(*tbl.get_as<std::string>("b") == "kek"sv);
REQUIRE(tbl == table{{ { S("a"sv), 69 }, { S("b"sv), S("kek") } }}); REQUIRE(tbl == table{{ { "a"sv, 69 }, { "b"sv, "kek" } }});
res = tbl.emplace<array>(S("c"), 1, 2, 3); res = tbl.emplace<array>("c", 1, 2, 3);
CHECK(res.first == advance(tbl.begin(), 2)); CHECK(res.first == advance(tbl.begin(), 2));
CHECK(res.second == true); CHECK(res.second == true);
CHECK(tbl.size() == 3_sz); CHECK(tbl.size() == 3_sz);
REQUIRE(tbl.get_as<array>(S("c"))); REQUIRE(tbl.get_as<array>("c"));
CHECK(*tbl.get_as<array>(S("c")) == array{ 1, 2, 3 }); CHECK(*tbl.get_as<array>("c") == array{ 1, 2, 3 });
REQUIRE(tbl == table{{ { S("a"sv), 69 }, { S("b"sv), S("kek"sv) }, { S("c"sv), array{ 1, 2, 3 } } }}); REQUIRE(tbl == table{{ { "a"sv, 69 }, { "b"sv, "kek"sv }, { "c"sv, array{ 1, 2, 3 } } }});
res = tbl.emplace<int64_t>(S("c"), 1); res = tbl.emplace<int64_t>("c", 1);
CHECK(res.first == advance(tbl.begin(), 2)); CHECK(res.first == advance(tbl.begin(), 2));
CHECK(res.second == false); CHECK(res.second == false);
CHECK(tbl.size() == 3_sz); CHECK(tbl.size() == 3_sz);
REQUIRE(!tbl.get_as<int64_t>(S("c"))); REQUIRE(!tbl.get_as<int64_t>("c"));
REQUIRE(tbl.get_as<array>(S("c"))); REQUIRE(tbl.get_as<array>("c"));
REQUIRE(tbl == table{{ { S("a"sv), 69 }, { S("b"sv), S("kek"s) }, { S("c"sv), array{ 1, 2, 3 } } }}); REQUIRE(tbl == table{{ { "a"sv, 69 }, { "b"sv, "kek"s }, { "c"sv, array{ 1, 2, 3 } } }});
auto it = tbl.erase(tbl.cbegin()); auto it = tbl.erase(tbl.cbegin());
REQUIRE(tbl == table{{ { S("b"sv), S("kek") }, { S("c"sv), array{ 1, 2, 3 } } }}); REQUIRE(tbl == table{{ { "b"sv, "kek" }, { "c"sv, array{ 1, 2, 3 } } }});
CHECK(it == tbl.begin()); CHECK(it == tbl.begin());
CHECK(tbl.size() == 2_sz); CHECK(tbl.size() == 2_sz);
res = tbl.insert_or_assign(S("a"sv), 69); res = tbl.insert_or_assign("a"sv, 69);
CHECK(res.first == tbl.begin()); CHECK(res.first == tbl.begin());
CHECK(res.second == true); // should insert CHECK(res.second == true); // should insert
CHECK(tbl.size() == 3_sz); CHECK(tbl.size() == 3_sz);
REQUIRE(tbl.get_as<int64_t>(S("a"))); REQUIRE(tbl.get_as<int64_t>("a"));
CHECK(*tbl.get_as<int64_t>(S("a")) == 69); CHECK(*tbl.get_as<int64_t>("a") == 69);
REQUIRE(tbl == table{{ { S("a"sv), 69 }, { S("b"sv), S("kek") }, { S("c"sv), array{ 1, 2, 3 } } }}); REQUIRE(tbl == table{{ { "a"sv, 69 }, { "b"sv, "kek" }, { "c"sv, array{ 1, 2, 3 } } }});
it = tbl.erase(advance(tbl.cbegin(), 1), advance(tbl.cbegin(), 3)); it = tbl.erase(advance(tbl.cbegin(), 1), advance(tbl.cbegin(), 3));
REQUIRE(tbl == table{{ { S("a"sv), 69 } }}); REQUIRE(tbl == table{{ { "a"sv, 69 } }});
CHECK(it == tbl.end()); CHECK(it == tbl.end());
CHECK(tbl.size() == 1_sz); CHECK(tbl.size() == 1_sz);
@ -232,4 +253,21 @@ TEST_CASE("tables - insertion and erasure")
REQUIRE(tbl == table{}); REQUIRE(tbl == table{});
CHECK(tbl.size() == 0_sz); CHECK(tbl.size() == 0_sz);
CHECK(tbl.empty()); CHECK(tbl.empty());
#if TOML_WINDOWS_COMPAT
tbl.insert(L"a", L"test1");
REQUIRE(*tbl.get_as<std::string>(L"a"sv) == "test1"sv);
tbl.insert_or_assign(L"a"sv, L"test2");
REQUIRE(*tbl.get_as<std::string>(L"a"sv) == "test2"sv);
tbl.emplace<std::string>(L"b", L"test3");
REQUIRE(*tbl.get_as<std::string>(L"b"sv) == "test3"sv);
CHECK(tbl.size() == 2_sz);
tbl.erase(L"b");
CHECK(tbl.size() == 1_sz);
tbl.erase(L"a"s);
CHECK(tbl.size() == 0_sz);
#endif // TOML_WINDOWS_COMPAT
} }

View File

@ -5,13 +5,95 @@
#include "tests.h" #include "tests.h"
#ifdef _WIN32
TOML_PUSH_WARNINGS
TOML_DISABLE_ALL_WARNINGS
#include <Windows.h>
TOML_POP_WARNINGS
#endif
// TOML_PUSH_WARNINGS
// TOML_DISABLE_ARITHMETIC_WARNINGS
template <typename T>
static constexpr T one = static_cast<T>(1);
TEST_CASE("values - construction")
{
#define CHECK_VALUE_INIT2(initializer, target_type, equiv) \
do { \
auto v = value{ initializer }; \
static_assert(std::is_same_v<decltype(v), value<target_type>>); \
CHECK(v == equiv); \
CHECK(equiv == v); \
CHECK(*v == equiv); \
CHECK(v.get() == equiv); \
} while (false)
#define CHECK_VALUE_INIT(initializer, target_type) \
CHECK_VALUE_INIT2(initializer, target_type, initializer)
CHECK_VALUE_INIT(one<signed char>, int64_t);
CHECK_VALUE_INIT(one<signed short>, int64_t);
CHECK_VALUE_INIT(one<signed int>, int64_t);
CHECK_VALUE_INIT(one<signed long>, int64_t);
CHECK_VALUE_INIT(one<signed long long>, int64_t);
CHECK_VALUE_INIT2(one<unsigned char>, int64_t, 1u);
CHECK_VALUE_INIT2(one<unsigned short>, int64_t, 1u);
CHECK_VALUE_INIT2(one<unsigned int>, int64_t, 1u);
CHECK_VALUE_INIT2(one<unsigned long>, int64_t, 1u);
CHECK_VALUE_INIT2(one<unsigned long long>, int64_t, 1u);
CHECK_VALUE_INIT(true, bool);
CHECK_VALUE_INIT(false, bool);
CHECK_VALUE_INIT("kek", std::string);
CHECK_VALUE_INIT("kek"s, std::string);
CHECK_VALUE_INIT("kek"sv, std::string);
CHECK_VALUE_INIT2("kek"sv.data(), std::string, "kek"sv);
#ifdef __cpp_lib_char8_t
CHECK_VALUE_INIT2(u8"kek", std::string, "kek"sv);
CHECK_VALUE_INIT2(u8"kek"s, std::string, "kek"sv);
CHECK_VALUE_INIT2(u8"kek"sv, std::string, "kek"sv);
CHECK_VALUE_INIT2(u8"kek"sv.data(), std::string, "kek"sv);
#endif
#ifdef _WIN32
CHECK_VALUE_INIT(one<BOOL>, int64_t);
CHECK_VALUE_INIT(one<SHORT>, int64_t);
CHECK_VALUE_INIT(one<INT>, int64_t);
CHECK_VALUE_INIT(one<LONG>, int64_t);
CHECK_VALUE_INIT(one<INT_PTR>, int64_t);
CHECK_VALUE_INIT(one<LONG_PTR>, int64_t);
CHECK_VALUE_INIT2(one<USHORT>, int64_t, 1u);
CHECK_VALUE_INIT2(one<UINT>, int64_t, 1u);
CHECK_VALUE_INIT2(one<ULONG>, int64_t, 1u);
CHECK_VALUE_INIT2(one<UINT_PTR>, int64_t, 1u);
CHECK_VALUE_INIT2(one<ULONG_PTR>, int64_t, 1u);
CHECK_VALUE_INIT2(one<WORD>, int64_t, 1u);
CHECK_VALUE_INIT2(one<DWORD>, int64_t, 1u);
CHECK_VALUE_INIT2(one<DWORD32>, int64_t, 1u);
CHECK_VALUE_INIT2(one<DWORD64>, int64_t, 1u);
CHECK_VALUE_INIT2(one<DWORDLONG>, int64_t, 1u);
#if TOML_WINDOWS_COMPAT
CHECK_VALUE_INIT2(L"kek", std::string, "kek"sv);
CHECK_VALUE_INIT2(L"kek"s, std::string, "kek"sv);
CHECK_VALUE_INIT2(L"kek"sv, std::string, "kek"sv);
CHECK_VALUE_INIT2(L"kek"sv.data(), std::string, "kek"sv);
#endif // TOML_WINDOWS_COMPAT
#endif
}
// TOML_POP_WARNINGS
TEST_CASE("values - printing") TEST_CASE("values - printing")
{ {
static constexpr auto print_value = [](auto&& raw) static constexpr auto print_value = [](auto&& raw)
{ {
auto val = toml::value{ std::forward<decltype(raw)>(raw) }; auto val = toml::value{ std::forward<decltype(raw)>(raw) };
std::stringstream ss; std::stringstream ss;
ss.imbue(std::locale::classic());
ss << val; ss << val;
return ss.str(); return ss.str();
}; };

View File

@ -68,16 +68,36 @@ compiler_supports_char8 = compiler_supports_cpp20 and compiler.links('''
args : [ '-std=c++2a', '-fchar8_t' ] args : [ '-std=c++2a', '-fchar8_t' ]
) )
compiler_supports_consteval = compiler_supports_cpp20 and compiler.compiles('''
consteval int kek() noexcept
{
return 42;
}
int main()
{
return kek();
}
''',
name : 'supports consteval',
args : [ '-std=c++2a' ]
)
compiler_supports_float16_args = []
if compiler.get_id() == 'gcc'
compiler_supports_float16_args += '-mfp16-format=ieee'
endif
compiler_supports_float16 = compiler.links(''' compiler_supports_float16 = compiler.links('''
int main() int main()
{ {
static_assert(sizeof(_Float16) = 2); static_assert(sizeof(_Float16) == 2);
_Float16 f = static_cast<_Float16>(1); _Float16 f = static_cast<_Float16>(1);
return 0; return 0;
} }
''', ''',
name : 'supports float16', name : 'supports float16',
args : [ '-mfp16-format=ieee' ] args : compiler_supports_float16_args
) )
compiler_supports_fast_math = compiler.links(''' compiler_supports_fast_math = compiler.links('''
@ -94,7 +114,6 @@ compiler_supports_fast_math = compiler.links('''
) )
fast_math_modes = [ false, true ] fast_math_modes = [ false, true ]
char8_modes = [ false, true ]
exception_modes = [ true, false ] exception_modes = [ true, false ]
strict_modes = [ false, true ] strict_modes = [ false, true ]
cpp20_modes = [ false, true ] cpp20_modes = [ false, true ]
@ -105,100 +124,91 @@ foreach cpp20 : cpp20_modes
if cpp20 and not compiler_supports_cpp20 if cpp20 and not compiler_supports_cpp20
continue continue
endif endif
foreach char8 : char8_modes foreach fast_math : fast_math_modes
if char8 and (not cpp20 or not compiler_supports_char8 or strict) if fast_math and not compiler_supports_fast_math
continue continue
endif endif
foreach fast_math : fast_math_modes foreach exceptions : exception_modes
if fast_math and not compiler_supports_fast_math
continue
endif
foreach exceptions : exception_modes
name = '' name = ''
overrides = [] overrides = []
args = [] args = []
if compiler_supports_float16 if compiler_supports_float16
if compiler.get_id() == 'gcc'
args += '-mfp16-format=ieee' args += '-mfp16-format=ieee'
endif endif
endif
if cpp20 if cpp20
name = 'cpp20' name = 'cpp20'
overrides += 'cpp_std=none' overrides += 'cpp_std=none'
args += '-std=c++2a' args += '-std=c++2a'
if compiler_supports_char8 if compiler_supports_char8
args += '-fchar8_t' args += '-fchar8_t'
endif
else
name = 'cpp17'
endif endif
else
name = 'cpp17'
endif
if strict if strict
name = name + '_strict' name = name + '_strict'
args += '-DTOML_UNRELEASED_FEATURES=0' args += '-DTOML_UNRELEASED_FEATURES=0'
else else
args += '-DTOML_UNRELEASED_FEATURES=1' args += '-DTOML_UNRELEASED_FEATURES=1'
endif endif
if char8 if not exceptions
name = name + '_char8' name = name + '_noexcept'
args += '-DTOML_CHAR_8_STRINGS=1' overrides += 'cpp_eh=none'
endif endif
if fast_math
name = name + '_fastmath'
if compiler.get_id() == 'gcc' or compiler.get_id() == 'clang'
args += '-ffast-math'
args += '-ffp-contract=fast'
endif
endif
if not exceptions if counter % 6 == 3
name = name + '_noexcept' args += '-DTOML_ALL_INLINE=1'
overrides += 'cpp_eh=none' endif
endif if counter % 2 == 1
args += '-DUSE_SINGLE_HEADER=1'
endif
if counter % 4 == 2 and exceptions
args += '-DUSE_TARTANLLAMA_OPTIONAL=1'
name = name + '_tlopt'
endif
if fast_math if compiler.get_id() == 'gcc'
name = name + '_fastmath' args += '-Wno-padded'
if compiler.get_id() == 'gcc' or compiler.get_id() == 'clang' args += '-Wno-float-equal'
args += '-ffast-math' endif
args += '-ffp-contract=fast'
endif
endif
if counter % 6 == 3 if compiler.get_id() == 'clang'
args += '-DTOML_ALL_INLINE=1' args += '-Wno-padded'
endif args += '-Wno-float-equal'
if counter % 2 == 1 args += '-Wno-double-promotion'
args += '-DUSE_SINGLE_HEADER=1' endif
endif
if counter % 4 == 2 and exceptions
args += '-DUSE_TARTANLLAMA_OPTIONAL=1'
name = name + '_tlopt'
endif
if compiler.get_id() == 'gcc' executables += [[
args += '-Wno-padded' name,
args += '-Wno-float-equal' executable(
endif
if compiler.get_id() == 'clang'
args += '-Wno-padded'
args += '-Wno-float-equal'
args += '-Wno-double-promotion'
endif
executables += [[
name, name,
executable( test_sources,
name, include_directories : inc,
test_sources, cpp_args : args,
include_directories : inc, override_options : overrides
cpp_args : args, )
override_options : overrides ]]
)
]]
counter = counter + 1 counter = counter + 1
endforeach # exceptions endforeach # exceptions
endforeach # fast_math endforeach # fast_math
endforeach # char8
endforeach # strict endforeach # strict
endforeach # cpp20 endforeach # cpp20

View File

@ -25,76 +25,76 @@ TEST_CASE("parsing - arrays")
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
REQUIRE(tbl[S("integers")].as<array>()); REQUIRE(tbl["integers"].as<array>());
CHECK(tbl[S("integers")].as<array>()->is_homogeneous()); CHECK(tbl["integers"].as<array>()->is_homogeneous());
CHECK(tbl[S("integers")].as<array>()->size() == 3); CHECK(tbl["integers"].as<array>()->size() == 3);
CHECK(tbl[S("integers")][0] == 1); CHECK(tbl["integers"][0] == 1);
CHECK(tbl[S("integers")][1] == 2); CHECK(tbl["integers"][1] == 2);
CHECK(tbl[S("integers")][2] == 3); CHECK(tbl["integers"][2] == 3);
REQUIRE(tbl[S("integers2")].as<array>()); REQUIRE(tbl["integers2"].as<array>());
CHECK(tbl[S("integers2")].as<array>()->is_homogeneous()); CHECK(tbl["integers2"].as<array>()->is_homogeneous());
CHECK(tbl[S("integers2")].as<array>()->size() == 3); CHECK(tbl["integers2"].as<array>()->size() == 3);
CHECK(tbl[S("integers2")][0] == 1); CHECK(tbl["integers2"][0] == 1);
CHECK(tbl[S("integers2")][1] == 2); CHECK(tbl["integers2"][1] == 2);
CHECK(tbl[S("integers2")][2] == 3); CHECK(tbl["integers2"][2] == 3);
REQUIRE(tbl[S("integers3")].as<array>()); REQUIRE(tbl["integers3"].as<array>());
CHECK(tbl[S("integers3")].as<array>()->is_homogeneous()); CHECK(tbl["integers3"].as<array>()->is_homogeneous());
CHECK(tbl[S("integers3")].as<array>()->size() == 2); CHECK(tbl["integers3"].as<array>()->size() == 2);
CHECK(tbl[S("integers3")][0] == 1); CHECK(tbl["integers3"][0] == 1);
CHECK(tbl[S("integers3")][1] == 2); CHECK(tbl["integers3"][1] == 2);
REQUIRE(tbl[S("colors")].as<array>()); REQUIRE(tbl["colors"].as<array>());
CHECK(tbl[S("colors")].as<array>()->is_homogeneous()); CHECK(tbl["colors"].as<array>()->is_homogeneous());
CHECK(tbl[S("colors")].as<array>()->size() == 3); CHECK(tbl["colors"].as<array>()->size() == 3);
CHECK(tbl[S("colors")][0] == S("red"sv)); CHECK(tbl["colors"][0] == "red"sv);
CHECK(tbl[S("colors")][1] == S("yellow"sv)); CHECK(tbl["colors"][1] == "yellow"sv);
CHECK(tbl[S("colors")][2] == S("green"sv)); CHECK(tbl["colors"][2] == "green"sv);
REQUIRE(tbl[S("nested_array_of_int")].as<array>()); REQUIRE(tbl["nested_array_of_int"].as<array>());
CHECK(tbl[S("nested_array_of_int")].as<array>()->is_homogeneous()); CHECK(tbl["nested_array_of_int"].as<array>()->is_homogeneous());
CHECK(tbl[S("nested_array_of_int")].as<array>()->size() == 2); CHECK(tbl["nested_array_of_int"].as<array>()->size() == 2);
REQUIRE(tbl[S("nested_array_of_int")][0].as<array>()); REQUIRE(tbl["nested_array_of_int"][0].as<array>());
CHECK(tbl[S("nested_array_of_int")][0].as<array>()->is_homogeneous()); CHECK(tbl["nested_array_of_int"][0].as<array>()->is_homogeneous());
CHECK(tbl[S("nested_array_of_int")][0].as<array>()->size() == 2); CHECK(tbl["nested_array_of_int"][0].as<array>()->size() == 2);
CHECK(tbl[S("nested_array_of_int")][0][0] == 1); CHECK(tbl["nested_array_of_int"][0][0] == 1);
CHECK(tbl[S("nested_array_of_int")][0][1] == 2); CHECK(tbl["nested_array_of_int"][0][1] == 2);
REQUIRE(tbl[S("nested_array_of_int")][1].as<array>()); REQUIRE(tbl["nested_array_of_int"][1].as<array>());
CHECK(tbl[S("nested_array_of_int")][1].as<array>()->is_homogeneous()); CHECK(tbl["nested_array_of_int"][1].as<array>()->is_homogeneous());
CHECK(tbl[S("nested_array_of_int")][1].as<array>()->size() == 3); CHECK(tbl["nested_array_of_int"][1].as<array>()->size() == 3);
CHECK(tbl[S("nested_array_of_int")][1][0] == 3); CHECK(tbl["nested_array_of_int"][1][0] == 3);
CHECK(tbl[S("nested_array_of_int")][1][1] == 4); CHECK(tbl["nested_array_of_int"][1][1] == 4);
CHECK(tbl[S("nested_array_of_int")][1][2] == 5); CHECK(tbl["nested_array_of_int"][1][2] == 5);
REQUIRE(tbl[S("nested_mixed_array")].as<array>()); REQUIRE(tbl["nested_mixed_array"].as<array>());
CHECK(tbl[S("nested_mixed_array")].as<array>()->is_homogeneous()); CHECK(tbl["nested_mixed_array"].as<array>()->is_homogeneous());
CHECK(tbl[S("nested_mixed_array")].as<array>()->size() == 2); CHECK(tbl["nested_mixed_array"].as<array>()->size() == 2);
REQUIRE(tbl[S("nested_mixed_array")][0].as<array>()); REQUIRE(tbl["nested_mixed_array"][0].as<array>());
CHECK(tbl[S("nested_mixed_array")][0].as<array>()->is_homogeneous()); CHECK(tbl["nested_mixed_array"][0].as<array>()->is_homogeneous());
CHECK(tbl[S("nested_mixed_array")][0].as<array>()->size() == 2); CHECK(tbl["nested_mixed_array"][0].as<array>()->size() == 2);
CHECK(tbl[S("nested_mixed_array")][0][0] == 1); CHECK(tbl["nested_mixed_array"][0][0] == 1);
CHECK(tbl[S("nested_mixed_array")][0][1] == 2); CHECK(tbl["nested_mixed_array"][0][1] == 2);
REQUIRE(tbl[S("nested_mixed_array")][1].as<array>()); REQUIRE(tbl["nested_mixed_array"][1].as<array>());
CHECK(tbl[S("nested_mixed_array")][1].as<array>()->is_homogeneous()); CHECK(tbl["nested_mixed_array"][1].as<array>()->is_homogeneous());
CHECK(tbl[S("nested_mixed_array")][1].as<array>()->size() == 3); CHECK(tbl["nested_mixed_array"][1].as<array>()->size() == 3);
CHECK(tbl[S("nested_mixed_array")][1][0] == S("a"sv)); CHECK(tbl["nested_mixed_array"][1][0] == "a"sv);
CHECK(tbl[S("nested_mixed_array")][1][1] == S("b"sv)); CHECK(tbl["nested_mixed_array"][1][1] == "b"sv);
CHECK(tbl[S("nested_mixed_array")][1][2] == S("c"sv)); CHECK(tbl["nested_mixed_array"][1][2] == "c"sv);
REQUIRE(tbl[S("string_array")].as<array>()); REQUIRE(tbl["string_array"].as<array>());
CHECK(tbl[S("string_array")].as<array>()->is_homogeneous()); CHECK(tbl["string_array"].as<array>()->is_homogeneous());
CHECK(tbl[S("string_array")].as<array>()->size() == 4); CHECK(tbl["string_array"].as<array>()->size() == 4);
CHECK(tbl[S("string_array")][0] == S("all"sv)); CHECK(tbl["string_array"][0] == "all"sv);
CHECK(tbl[S("string_array")][1] == S("strings"sv)); CHECK(tbl["string_array"][1] == "strings"sv);
CHECK(tbl[S("string_array")][2] == S("are the same"sv)); CHECK(tbl["string_array"][2] == "are the same"sv);
CHECK(tbl[S("string_array")][3] == S("type"sv)); CHECK(tbl["string_array"][3] == "type"sv);
REQUIRE(tbl[S("integers")].as<array>()); REQUIRE(tbl["integers"].as<array>());
CHECK(tbl[S("integers")].as<array>()->is_homogeneous()); CHECK(tbl["integers"].as<array>()->is_homogeneous());
CHECK(tbl[S("integers")].as<array>()->size() == 3); CHECK(tbl["integers"].as<array>()->size() == 3);
CHECK(tbl[S("integers")][0] == 1); CHECK(tbl["integers"][0] == 1);
CHECK(tbl[S("integers")][1] == 2); CHECK(tbl["integers"][1] == 2);
CHECK(tbl[S("integers")][2] == 3); CHECK(tbl["integers"][2] == 3);
} }
); );
@ -113,37 +113,37 @@ TEST_CASE("parsing - arrays")
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
REQUIRE(tbl[S("numbers")].as<array>()); REQUIRE(tbl["numbers"].as<array>());
CHECK(!tbl[S("numbers")].as<array>()->is_homogeneous()); CHECK(!tbl["numbers"].as<array>()->is_homogeneous());
CHECK(tbl[S("numbers")].as<array>()->size() == 6); CHECK(tbl["numbers"].as<array>()->size() == 6);
CHECK(tbl[S("numbers")][0].as<double>()); CHECK(tbl["numbers"][0].as<double>());
CHECK(tbl[S("numbers")][1].as<double>()); CHECK(tbl["numbers"][1].as<double>());
CHECK(tbl[S("numbers")][2].as<double>()); CHECK(tbl["numbers"][2].as<double>());
CHECK(tbl[S("numbers")][3].as<int64_t>()); CHECK(tbl["numbers"][3].as<int64_t>());
CHECK(tbl[S("numbers")][4].as<int64_t>()); CHECK(tbl["numbers"][4].as<int64_t>());
CHECK(tbl[S("numbers")][5].as<int64_t>()); CHECK(tbl["numbers"][5].as<int64_t>());
CHECK(tbl[S("numbers")][0] == 0.1); CHECK(tbl["numbers"][0] == 0.1);
CHECK(tbl[S("numbers")][1] == 0.2); CHECK(tbl["numbers"][1] == 0.2);
CHECK(tbl[S("numbers")][2] == 0.5); CHECK(tbl["numbers"][2] == 0.5);
CHECK(tbl[S("numbers")][3] == 1); CHECK(tbl["numbers"][3] == 1);
CHECK(tbl[S("numbers")][4] == 2); CHECK(tbl["numbers"][4] == 2);
CHECK(tbl[S("numbers")][5] == 5); CHECK(tbl["numbers"][5] == 5);
REQUIRE(tbl[S("contributors")].as<array>()); REQUIRE(tbl["contributors"].as<array>());
CHECK(!tbl[S("contributors")].as<array>()->is_homogeneous()); CHECK(!tbl["contributors"].as<array>()->is_homogeneous());
CHECK(tbl[S("contributors")].as<array>()->size() == 2); CHECK(tbl["contributors"].as<array>()->size() == 2);
CHECK(tbl[S("contributors")][0].as<string>()); CHECK(tbl["contributors"][0].as<std::string>());
CHECK(tbl[S("contributors")][1].as<table>()); CHECK(tbl["contributors"][1].as<table>());
CHECK(tbl[S("contributors")][0] == S("Foo Bar <foo@example.com>"sv)); CHECK(tbl["contributors"][0] == "Foo Bar <foo@example.com>"sv);
CHECK(tbl[S("contributors")][1][S("name")] == S("Baz Qux"sv)); CHECK(tbl["contributors"][1]["name"] == "Baz Qux"sv);
CHECK(tbl[S("contributors")][1][S("email")] == S("bazqux@example.com"sv)); CHECK(tbl["contributors"][1]["email"] == "bazqux@example.com"sv);
CHECK(tbl[S("contributors")][1][S("url")] == S("https://example.com/bazqux"sv)); CHECK(tbl["contributors"][1]["url"] == "https://example.com/bazqux"sv);
} }
); );
#else #else
parsing_should_fail(FILE_LINE_ARGS, S("numbers = [ 0.1, 0.2, 0.5, 1, 2, 5 ]"sv)); parsing_should_fail(FILE_LINE_ARGS, "numbers = [ 0.1, 0.2, 0.5, 1, 2, 5 ]"sv);
#endif #endif
} }

View File

@ -15,8 +15,8 @@ TEST_CASE("parsing - booleans")
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("bool1")] == true); CHECK(tbl["bool1"] == true);
CHECK(tbl[S("bool2")] == false); CHECK(tbl["bool2"] == false);
} }
); );

View File

@ -16,8 +16,8 @@ TEST_CASE("parsing - comments")
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl.size() == 2); CHECK(tbl.size() == 2);
CHECK(tbl[S("key")] == S("value"sv)); CHECK(tbl["key"] == "value"sv);
CHECK(tbl[S("another")] == S("# This is not a comment"sv)); CHECK(tbl["another"] == "# This is not a comment"sv);
} }
); );

View File

@ -26,23 +26,23 @@ TEST_CASE("parsing - dates and times")
[](table&& tbl) [](table&& tbl)
{ {
static constexpr auto odt1 = date_time{ { 1979, 5, 27 }, { 7, 32 }, {} }; static constexpr auto odt1 = date_time{ { 1979, 5, 27 }, { 7, 32 }, {} };
CHECK(tbl[S("odt1")] == odt1); CHECK(tbl["odt1"] == odt1);
static constexpr auto odt2 = date_time{ { 1979, 5, 27 }, { 0, 32 }, { -7, 0 } }; static constexpr auto odt2 = date_time{ { 1979, 5, 27 }, { 0, 32 }, { -7, 0 } };
CHECK(tbl[S("odt2")] == odt2); CHECK(tbl["odt2"] == odt2);
static constexpr auto odt3 = date_time{ { 1979, 5, 27 }, { 0, 32, 0, 999999000u }, { -7, 0 } }; static constexpr auto odt3 = date_time{ { 1979, 5, 27 }, { 0, 32, 0, 999999000u }, { -7, 0 } };
CHECK(tbl[S("odt3")] == odt3); CHECK(tbl["odt3"] == odt3);
static constexpr auto odt4 = date_time{ { 1979, 5, 27 }, { 7, 32 }, {} }; static constexpr auto odt4 = date_time{ { 1979, 5, 27 }, { 7, 32 }, {} };
CHECK(tbl[S("odt4")] == odt4); CHECK(tbl["odt4"] == odt4);
static constexpr auto ldt1 = date_time{ { 1979, 5, 27 }, { 7, 32 } }; static constexpr auto ldt1 = date_time{ { 1979, 5, 27 }, { 7, 32 } };
CHECK(tbl[S("ldt1")] == ldt1); CHECK(tbl["ldt1"] == ldt1);
static constexpr auto ldt2 = date_time{ { 1979, 5, 27 }, { 0, 32, 0, 999999000u } }; static constexpr auto ldt2 = date_time{ { 1979, 5, 27 }, { 0, 32, 0, 999999000u } };
CHECK(tbl[S("ldt2")] == ldt2); CHECK(tbl["ldt2"] == ldt2);
static constexpr auto ld1 = date{ 1979, 5, 27 }; static constexpr auto ld1 = date{ 1979, 5, 27 };
CHECK(tbl[S("ld1")] == ld1); CHECK(tbl["ld1"] == ld1);
static constexpr auto lt1 = toml::time{ 7, 32 }; static constexpr auto lt1 = toml::time{ 7, 32 };
CHECK(tbl[S("lt1")] == lt1); CHECK(tbl["lt1"] == lt1);
static constexpr auto lt2 = toml::time{ 0, 32, 0, 999999000u }; static constexpr auto lt2 = toml::time{ 0, 32, 0, 999999000u };
CHECK(tbl[S("lt2")] == lt2); CHECK(tbl["lt2"] == lt2);
} }
); );

View File

@ -5,7 +5,7 @@
#include "tests.h" #include "tests.h"
TOML_DISABLE_FLOAT_WARNINGS TOML_DISABLE_ARITHMETIC_WARNINGS
TEST_CASE("parsing - floats") TEST_CASE("parsing - floats")
{ {
@ -29,14 +29,14 @@ TEST_CASE("parsing - floats")
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("flt1")] == 1.0); CHECK(tbl["flt1"] == 1.0);
CHECK(tbl[S("flt2")] == 3.1415); CHECK(tbl["flt2"] == 3.1415);
CHECK(tbl[S("flt3")] == -0.01); CHECK(tbl["flt3"] == -0.01);
CHECK(tbl[S("flt4")].as<double>()->get() == 5e+22_a); CHECK(tbl["flt4"].as<double>()->get() == 5e+22_a);
CHECK(tbl[S("flt5")].as<double>()->get() == 1e6_a); CHECK(tbl["flt5"].as<double>()->get() == 1e6_a);
CHECK(tbl[S("flt6")] == -2E-2); CHECK(tbl["flt6"] == -2E-2);
CHECK(tbl[S("flt7")].as<double>()->get() == 6.626e-34_a); CHECK(tbl["flt7"].as<double>()->get() == 6.626e-34_a);
CHECK(tbl[S("flt8")].as<double>()->get() == 224617.445991228_a); CHECK(tbl["flt8"].as<double>()->get() == 224617.445991228_a);
} }
); );
@ -51,8 +51,8 @@ TEST_CASE("parsing - floats")
R"(zeroes = [-0.0, +0.0])"sv, R"(zeroes = [-0.0, +0.0])"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("zeroes")][0] == -0.0); CHECK(tbl["zeroes"][0] == -0.0);
CHECK(tbl[S("zeroes")][1] == +0.0); CHECK(tbl["zeroes"][1] == +0.0);
} }
); );
@ -200,12 +200,12 @@ TEST_CASE("parsing - inf and nan")
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(impl::fpclassify(**tbl[S("sf1")].as<double>()) == impl::fp_class::pos_inf); CHECK(impl::fpclassify(**tbl["sf1"].as<double>()) == impl::fp_class::pos_inf);
CHECK(impl::fpclassify(**tbl[S("sf2")].as<double>()) == impl::fp_class::pos_inf); CHECK(impl::fpclassify(**tbl["sf2"].as<double>()) == impl::fp_class::pos_inf);
CHECK(impl::fpclassify(**tbl[S("sf3")].as<double>()) == impl::fp_class::neg_inf); CHECK(impl::fpclassify(**tbl["sf3"].as<double>()) == impl::fp_class::neg_inf);
CHECK(impl::fpclassify(**tbl[S("sf4")].as<double>()) == impl::fp_class::nan); CHECK(impl::fpclassify(**tbl["sf4"].as<double>()) == impl::fp_class::nan);
CHECK(impl::fpclassify(**tbl[S("sf5")].as<double>()) == impl::fp_class::nan); CHECK(impl::fpclassify(**tbl["sf5"].as<double>()) == impl::fp_class::nan);
CHECK(impl::fpclassify(**tbl[S("sf6")].as<double>()) == impl::fp_class::nan); CHECK(impl::fpclassify(**tbl["sf6"].as<double>()) == impl::fp_class::nan);
} }
); );

View File

@ -20,13 +20,13 @@ TEST_CASE("parsing - integers (decimal)")
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("int1")] == 99); CHECK(tbl["int1"] == 99);
CHECK(tbl[S("int2")] == 42); CHECK(tbl["int2"] == 42);
CHECK(tbl[S("int3")] == 0); CHECK(tbl["int3"] == 0);
CHECK(tbl[S("int4")] == -17); CHECK(tbl["int4"] == -17);
CHECK(tbl[S("int5")] == 1000); CHECK(tbl["int5"] == 1000);
CHECK(tbl[S("int6")] == 5349221); CHECK(tbl["int6"] == 5349221);
CHECK(tbl[S("int7")] == 12345); CHECK(tbl["int7"] == 12345);
} }
); );
@ -50,8 +50,8 @@ TEST_CASE("parsing - integers (decimal)")
"zeroes = [-0, +0]"sv, "zeroes = [-0, +0]"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("zeroes")][0] == 0); CHECK(tbl["zeroes"][0] == 0);
CHECK(tbl[S("zeroes")][1] == 0); CHECK(tbl["zeroes"][1] == 0);
} }
); );
@ -104,12 +104,12 @@ TEST_CASE("parsing - integers (hex, bin, oct)")
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("hex1")] == 0xDEADBEEF); CHECK(tbl["hex1"] == 0xDEADBEEF);
CHECK(tbl[S("hex2")] == 0xDEADBEEF); CHECK(tbl["hex2"] == 0xDEADBEEF);
CHECK(tbl[S("hex3")] == 0xDEADBEEF); CHECK(tbl["hex3"] == 0xDEADBEEF);
CHECK(tbl[S("oct1")] == 01234567); CHECK(tbl["oct1"] == 01234567);
CHECK(tbl[S("oct2")] == 0755); CHECK(tbl["oct2"] == 0755);
CHECK(tbl[S("bin1")] == 0b11010110); CHECK(tbl["bin1"] == 0b11010110);
} }
); );
@ -135,12 +135,12 @@ TEST_CASE("parsing - integers (hex, bin, oct)")
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("hex1")] == 0xDEADBEEF); CHECK(tbl["hex1"] == 0xDEADBEEF);
CHECK(tbl[S("hex2")] == 0xDEADBEEF); CHECK(tbl["hex2"] == 0xDEADBEEF);
CHECK(tbl[S("hex3")] == 0xDEADBEEF); CHECK(tbl["hex3"] == 0xDEADBEEF);
CHECK(tbl[S("oct1")] == 01234567); CHECK(tbl["oct1"] == 01234567);
CHECK(tbl[S("oct2")] == 0755); CHECK(tbl["oct2"] == 0755);
CHECK(tbl[S("bin1")] == 0b11010110); CHECK(tbl["bin1"] == 0b11010110);
} }
); );

View File

@ -19,11 +19,11 @@ TEST_CASE("parsing - key-value pairs")
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl.size() == 5); CHECK(tbl.size() == 5);
CHECK(tbl[S("key")] == S("value"sv)); CHECK(tbl["key"] == "value"sv);
CHECK(tbl[S("bare_key")] == S("value"sv)); CHECK(tbl["bare_key"] == "value"sv);
CHECK(tbl[S("bare-key")] == S("value"sv)); CHECK(tbl["bare-key"] == "value"sv);
CHECK(tbl[S("1234")] == S("value"sv)); CHECK(tbl["1234"] == "value"sv);
CHECK(tbl[S("")] == S("blank"sv)); CHECK(tbl[""] == "blank"sv);
} }
); );
@ -41,12 +41,12 @@ TEST_CASE("parsing - key-value pairs")
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("127.0.0.1")] == S("value"sv)); CHECK(tbl["127.0.0.1"] == "value"sv);
CHECK(tbl[S("character encoding")] == S("value"sv)); CHECK(tbl["character encoding"] == "value"sv);
CHECK(tbl[S("ʎǝʞ")] == S("value"sv)); CHECK(tbl["ʎǝʞ"] == "value"sv);
CHECK(tbl[S("key2")] == S("value"sv)); CHECK(tbl["key2"] == "value"sv);
CHECK(tbl[S("quoted \"value\"")] == S("value"sv)); CHECK(tbl["quoted \"value\""] == "value"sv);
CHECK(tbl[S("")] == S("blank"sv)); CHECK(tbl[""] == "blank"sv);
} }
); );
@ -73,11 +73,11 @@ TEST_CASE("parsing - key-value pairs (dotted)")
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl.size() == 4); CHECK(tbl.size() == 4);
CHECK(tbl[S("name")] == S("Orange"sv)); CHECK(tbl["name"] == "Orange"sv);
CHECK(tbl[S("physical")][S("color")] == S("orange"sv)); CHECK(tbl["physical"]["color"] == "orange"sv);
CHECK(tbl[S("physical")][S("shape")] == S("round"sv)); CHECK(tbl["physical"]["shape"] == "round"sv);
CHECK(tbl[S("site")][S("google.com")] == true); CHECK(tbl["site"]["google.com"] == true);
CHECK(tbl[S("3")][S("14159")] == S("pi"sv)); CHECK(tbl["3"]["14159"] == "pi"sv);
} }
); );
@ -90,8 +90,8 @@ TEST_CASE("parsing - key-value pairs (dotted)")
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("fruit")][S("apple")][S("smooth")] == true); CHECK(tbl["fruit"]["apple"]["smooth"] == true);
CHECK(tbl[S("fruit")][S("orange")] == 2); CHECK(tbl["fruit"]["orange"] == 2);
} }
); );
@ -117,12 +117,12 @@ TEST_CASE("parsing - key-value pairs (dotted)")
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("apple")][S("type")] == S("fruit"sv)); CHECK(tbl["apple"]["type"] == "fruit"sv);
CHECK(tbl[S("apple")][S("skin")] == S("thin"sv)); CHECK(tbl["apple"]["skin"] == "thin"sv);
CHECK(tbl[S("apple")][S("color")] == S("red"sv)); CHECK(tbl["apple"]["color"] == "red"sv);
CHECK(tbl[S("orange")][S("type")] == S("fruit"sv)); CHECK(tbl["orange"]["type"] == "fruit"sv);
CHECK(tbl[S("orange")][S("skin")] == S("thick"sv)); CHECK(tbl["orange"]["skin"] == "thick"sv);
CHECK(tbl[S("orange")][S("color")] == S("orange"sv)); CHECK(tbl["orange"]["color"] == "orange"sv);
} }
); );
@ -141,12 +141,12 @@ TEST_CASE("parsing - key-value pairs (dotted)")
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("apple")][S("type")] == S("fruit"sv)); CHECK(tbl["apple"]["type"] == "fruit"sv);
CHECK(tbl[S("apple")][S("skin")] == S("thin"sv)); CHECK(tbl["apple"]["skin"] == "thin"sv);
CHECK(tbl[S("apple")][S("color")] == S("red"sv)); CHECK(tbl["apple"]["color"] == "red"sv);
CHECK(tbl[S("orange")][S("type")] == S("fruit"sv)); CHECK(tbl["orange"]["type"] == "fruit"sv);
CHECK(tbl[S("orange")][S("skin")] == S("thick"sv)); CHECK(tbl["orange"]["skin"] == "thick"sv);
CHECK(tbl[S("orange")][S("color")] == S("orange"sv)); CHECK(tbl["orange"]["color"] == "orange"sv);
} }
); );
@ -161,8 +161,8 @@ TEST_CASE("parsing - key-value pairs (dotted)")
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl.size() == 2); CHECK(tbl.size() == 2);
CHECK(tbl[S("key+1")] == 0); CHECK(tbl["key+1"] == 0);
CHECK(tbl[S("ʎǝʞ2")] == 0); CHECK(tbl["ʎǝʞ2"] == 0);
} }
); );
#else #else
@ -245,8 +245,8 @@ TEST_CASE("parsing - key-value pairs (string keys)")
b = "to do" b = "to do"
)"sv, [](table&& tbl) )"sv, [](table&& tbl)
{ {
CHECK(tbl[S("a")] == S(" to do "sv)); CHECK(tbl["a"] == " to do "sv);
CHECK(tbl[S("b")] == S("to do"sv)); CHECK(tbl["b"] == "to do"sv);
}); });
// values must be quoted, syntax error // values must be quoted, syntax error
@ -285,8 +285,8 @@ TEST_CASE("parsing - key-value pairs (string keys)")
b = """"quoted"""" b = """"quoted""""
)"sv, [](table&& tbl) )"sv, [](table&& tbl)
{ {
CHECK(tbl[S("a")] == S("\"quoted\""sv)); CHECK(tbl["a"] == "\"quoted\""sv);
CHECK(tbl[S("b")] == S("\"quoted\""sv)); CHECK(tbl["b"] == "\"quoted\""sv);
}); });
// quote correction is not applied, fail syntax error // quote correction is not applied, fail syntax error

View File

@ -53,44 +53,44 @@ TEST_CASE("parsing - TOML spec example")
{ {
CHECK(tbl.size() == 5); CHECK(tbl.size() == 5);
CHECK(tbl[S("title")] == S("TOML Example"sv)); CHECK(tbl["title"] == "TOML Example"sv);
CHECK(tbl[S("owner")]); CHECK(tbl["owner"]);
CHECK(tbl[S("owner")].as<table>()); CHECK(tbl["owner"].as<table>());
CHECK(tbl[S("owner")][S("name")] == S("Tom Preston-Werner"sv)); CHECK(tbl["owner"]["name"] == "Tom Preston-Werner"sv);
const auto dob = date_time{ { 1979, 5, 27 }, { 7, 32 }, { -8, 0 } }; const auto dob = date_time{ { 1979, 5, 27 }, { 7, 32 }, { -8, 0 } };
CHECK(tbl[S("owner")][S("dob")] == dob); CHECK(tbl["owner"]["dob"] == dob);
CHECK(tbl[S("database")].as<table>()); CHECK(tbl["database"].as<table>());
CHECK(tbl[S("database")][S("server")] == S("192.168.1.1"sv)); CHECK(tbl["database"]["server"] == "192.168.1.1"sv);
const auto ports = { 8001, 8001, 8002 }; const auto ports = { 8001, 8001, 8002 };
CHECK(tbl[S("database")][S("ports")] == ports); CHECK(tbl["database"]["ports"] == ports);
CHECK(tbl[S("database")][S("connection_max")] == 5000); CHECK(tbl["database"]["connection_max"] == 5000);
CHECK(tbl[S("database")][S("enabled")] == true); CHECK(tbl["database"]["enabled"] == true);
CHECK(tbl[S("servers")].as<table>()); CHECK(tbl["servers"].as<table>());
CHECK(tbl[S("servers")][S("alpha")].as<table>()); CHECK(tbl["servers"]["alpha"].as<table>());
CHECK(tbl[S("servers")][S("alpha")][S("ip")] == S("10.0.0.1"sv)); CHECK(tbl["servers"]["alpha"]["ip"] == "10.0.0.1"sv);
CHECK(tbl[S("servers")][S("alpha")][S("dc")] == S("eqdc10"sv)); CHECK(tbl["servers"]["alpha"]["dc"] == "eqdc10"sv);
CHECK(tbl[S("servers")][S("beta")].as<table>()); CHECK(tbl["servers"]["beta"].as<table>());
CHECK(tbl[S("servers")][S("beta")][S("ip")] == S("10.0.0.2"sv)); CHECK(tbl["servers"]["beta"]["ip"] == "10.0.0.2"sv);
CHECK(tbl[S("servers")][S("beta")][S("dc")] == S("eqdc10"sv)); CHECK(tbl["servers"]["beta"]["dc"] == "eqdc10"sv);
CHECK(tbl[S("clients")].as<table>()); CHECK(tbl["clients"].as<table>());
REQUIRE(tbl[S("clients")][S("data")].as<array>()); REQUIRE(tbl["clients"]["data"].as<array>());
CHECK(tbl[S("clients")][S("data")].as<array>()->size() == 2); CHECK(tbl["clients"]["data"].as<array>()->size() == 2);
REQUIRE(tbl[S("clients")][S("data")][0].as<array>()); REQUIRE(tbl["clients"]["data"][0].as<array>());
CHECK(tbl[S("clients")][S("data")][0].as<array>()->size() == 2); CHECK(tbl["clients"]["data"][0].as<array>()->size() == 2);
CHECK(tbl[S("clients")][S("data")][0][0] == S("gamma"sv)); CHECK(tbl["clients"]["data"][0][0] == "gamma"sv);
CHECK(tbl[S("clients")][S("data")][0][1] == S("delta"sv)); CHECK(tbl["clients"]["data"][0][1] == "delta"sv);
REQUIRE(tbl[S("clients")][S("data")][1].as<array>()); REQUIRE(tbl["clients"]["data"][1].as<array>());
CHECK(tbl[S("clients")][S("data")][1].as<array>()->size() == 2); CHECK(tbl["clients"]["data"][1].as<array>()->size() == 2);
CHECK(tbl[S("clients")][S("data")][1][0] == 1); CHECK(tbl["clients"]["data"][1][0] == 1);
CHECK(tbl[S("clients")][S("data")][1][1] == 2); CHECK(tbl["clients"]["data"][1][1] == 2);
REQUIRE(tbl[S("clients")][S("hosts")].as<array>()); REQUIRE(tbl["clients"]["hosts"].as<array>());
CHECK(tbl[S("clients")][S("hosts")].as<array>()->size() == 2); CHECK(tbl["clients"]["hosts"].as<array>()->size() == 2);
CHECK(tbl[S("clients")][S("hosts")][0] == S("alpha"sv)); CHECK(tbl["clients"]["hosts"][0] == "alpha"sv);
CHECK(tbl[S("clients")][S("hosts")][1] == S("omega"sv)); CHECK(tbl["clients"]["hosts"][1] == "omega"sv);
} }
); );
} }

View File

@ -23,9 +23,9 @@ Violets are blue"""
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("str")] == S("I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF."sv)); CHECK(tbl["str"] == "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF."sv);
CHECK(tbl[S("str1")] == S("Roses are red\nViolets are blue"sv)); CHECK(tbl["str1"] == "Roses are red\nViolets are blue"sv);
CHECK(tbl[S("str2")] == S("\nRoses are red\nViolets are blue"sv)); CHECK(tbl["str2"] == "\nRoses are red\nViolets are blue"sv);
} }
); );
@ -58,14 +58,14 @@ str7 = """"This," she said, "is just a pointless statement.""""
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
static constexpr auto quick_brown_fox = S("The quick brown fox jumps over the lazy dog."sv); static constexpr auto quick_brown_fox = "The quick brown fox jumps over the lazy dog."sv;
CHECK(tbl[S("str1")] == quick_brown_fox); CHECK(tbl["str1"] == quick_brown_fox);
CHECK(tbl[S("str2")] == quick_brown_fox); CHECK(tbl["str2"] == quick_brown_fox);
CHECK(tbl[S("str3")] == quick_brown_fox); CHECK(tbl["str3"] == quick_brown_fox);
CHECK(tbl[S("str4")] == S(R"(Here are two quotation marks: "". Simple enough.)"sv)); CHECK(tbl["str4"] == R"(Here are two quotation marks: "". Simple enough.)"sv);
CHECK(tbl[S("str5")] == S(R"(Here are three quotation marks: """.)"sv)); CHECK(tbl["str5"] == R"(Here are three quotation marks: """.)"sv);
CHECK(tbl[S("str6")] == S(R"(Here are fifteen quotation marks: """"""""""""""".)"sv)); CHECK(tbl["str6"] == R"(Here are fifteen quotation marks: """"""""""""""".)"sv);
CHECK(tbl[S("str7")] == S(R"("This," she said, "is just a pointless statement.")"sv)); CHECK(tbl["str7"] == R"("This," she said, "is just a pointless statement.")"sv);
} }
); );
@ -96,22 +96,22 @@ trimmed in raw strings.
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("winpath")] == S(R"(C:\Users\nodejs\templates)"sv)); CHECK(tbl["winpath"] == R"(C:\Users\nodejs\templates)"sv);
CHECK(tbl[S("winpath2")] == S(R"(\\ServerX\admin$\system32\)"sv)); CHECK(tbl["winpath2"] == R"(\\ServerX\admin$\system32\)"sv);
CHECK(tbl[S("quoted")] == S(R"(Tom "Dubs" Preston-Werner)"sv)); CHECK(tbl["quoted"] == R"(Tom "Dubs" Preston-Werner)"sv);
CHECK(tbl[S("regex")] == S(R"(<\i\c*\s*>)"sv)); CHECK(tbl["regex"] == R"(<\i\c*\s*>)"sv);
CHECK(tbl[S("regex2")] == S(R"(I [dw]on't need \d{2} apples)"sv)); CHECK(tbl["regex2"] == R"(I [dw]on't need \d{2} apples)"sv);
CHECK(tbl[S("lines")] == S(R"(The first newline is CHECK(tbl["lines"] == R"(The first newline is
trimmed in raw strings. trimmed in raw strings.
All other whitespace All other whitespace
is preserved. is preserved.
)"sv)); )"sv);
CHECK(tbl[S("lines2")] == S(R"( CHECK(tbl["lines2"] == R"(
The first newline is The first newline is
trimmed in raw strings. trimmed in raw strings.
All other whitespace All other whitespace
is preserved. is preserved.
)"sv)); )"sv);
} }
); );
@ -128,9 +128,9 @@ str = ''''That's still pointless', she said.'''
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
CHECK(tbl[S("quot15")] == S(R"(Here are fifteen quotation marks: """"""""""""""")"sv)); CHECK(tbl["quot15"] == R"(Here are fifteen quotation marks: """"""""""""""")"sv);
CHECK(tbl[S("apos15")] == S(R"(Here are fifteen apostrophes: ''''''''''''''')"sv)); CHECK(tbl["apos15"] == R"(Here are fifteen apostrophes: ''''''''''''''')"sv);
CHECK(tbl[S("str")] == S(R"('That's still pointless', she said.)"sv)); CHECK(tbl["str"] == R"('That's still pointless', she said.)"sv);
} }
); );
@ -140,42 +140,42 @@ str = ''''That's still pointless', she said.'''
parse_expected_value( parse_expected_value(
FILE_LINE_ARGS, FILE_LINE_ARGS,
R"("The quick brown fox jumps over the lazy dog")"sv, R"("The quick brown fox jumps over the lazy dog")"sv,
S("The quick brown fox jumps over the lazy dog"sv)); "The quick brown fox jumps over the lazy dog"sv);
parse_expected_value( parse_expected_value(
FILE_LINE_ARGS, FILE_LINE_ARGS,
R"('The quick brown fox jumps over the lazy dog')"sv, R"('The quick brown fox jumps over the lazy dog')"sv,
S("The quick brown fox jumps over the lazy dog"sv)); "The quick brown fox jumps over the lazy dog"sv);
parse_expected_value( parse_expected_value(
FILE_LINE_ARGS, FILE_LINE_ARGS,
R"("""The quick brown fox jumps over the lazy dog""")"sv, R"("""The quick brown fox jumps over the lazy dog""")"sv,
S("The quick brown fox jumps over the lazy dog"sv)); "The quick brown fox jumps over the lazy dog"sv);
parse_expected_value( parse_expected_value(
FILE_LINE_ARGS, FILE_LINE_ARGS,
R"('''The quick brown fox jumps over the lazy dog''')"sv, R"('''The quick brown fox jumps over the lazy dog''')"sv,
S("The quick brown fox jumps over the lazy dog"sv)); "The quick brown fox jumps over the lazy dog"sv);
parse_expected_value( parse_expected_value(
FILE_LINE_ARGS, FILE_LINE_ARGS,
R"("Ýôú' λáƭè è áƒƭèř ƭλïƨ - #")"sv, R"("Ýôú' λáƭè è áƒƭèř ƭλïƨ - #")"sv,
S(R"(Ýôú' λáƭè ₥è áƒƭèř ƭλïƨ - #)"sv)); R"(Ýôú' λáƭè ₥è áƒƭèř ƭλïƨ - #)"sv);
parse_expected_value( parse_expected_value(
FILE_LINE_ARGS, FILE_LINE_ARGS,
R"(" Âñδ ωλèñ \"'ƨ ářè ïñ ƭλè ƨƭřïñϱ, áℓôñϱ ωïƭλ # \"")"sv, R"(" Âñδ ωλèñ \"'ƨ ářè ïñ ƭλè ƨƭřïñϱ, áℓôñϱ ωïƭλ # \"")"sv,
S(R"( Âñδ ωλèñ "'ƨ ářè ïñ ƭλè ƨƭřïñϱ, áôñϱ ωïƭλ # ")"sv)); R"( Âñδ ωλèñ "'ƨ ářè ïñ ƭλè ƨƭřïñϱ, áôñϱ ωïƭλ # ")"sv);
parse_expected_value( parse_expected_value(
FILE_LINE_ARGS, FILE_LINE_ARGS,
R"("Ýôú δôñ'ƭ ƭλïñƙ ƨôè úƨèř ωôñ'ƭ δô ƭλáƭ?")"sv, R"("Ýôú δôñ'ƭ ƭλïñƙ ƨôè úƨèř ωôñ'ƭ δô ƭλáƭ?")"sv,
S(R"(Ýôú δôñ'ƭ ƭλïñƙ ƨô₥è úƨèř ωôñ'ƭ δô ƭλáƭ?)"sv)); R"(Ýôú δôñ'ƭ ƭλïñƙ ƨô₥è úƨèř ωôñ'ƭ δô ƭλáƭ?)"sv);
parse_expected_value( parse_expected_value(
FILE_LINE_ARGS, FILE_LINE_ARGS,
R"("\"\u03B1\u03B2\u03B3\"")"sv, R"("\"\u03B1\u03B2\u03B3\"")"sv,
S("\"\u03B1\u03B2\u03B3\""sv)); "\"\u03B1\u03B2\u03B3\""sv);
// toml/pull/709 (\xHH unicode scalars) // toml/pull/709 (\xHH unicode scalars)
#if TOML_LANG_UNRELEASED #if TOML_LANG_UNRELEASED
parse_expected_value( parse_expected_value(
FILE_LINE_ARGS, FILE_LINE_ARGS,
R"("\x00\x10\x20\x30\x40\x50\x60\x70\x80\x90\x11\xFF\xEE")"sv, R"("\x00\x10\x20\x30\x40\x50\x60\x70\x80\x90\x11\xFF\xEE")"sv,
S("\u0000\u0010\u0020\u0030\u0040\u0050\u0060\u0070\u0080\u0090\u0011\u00FF\u00EE"sv)); "\u0000\u0010\u0020\u0030\u0040\u0050\u0060\u0070\u0080\u0090\u0011\u00FF\u00EE"sv);
#else #else
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\x00\x10\x20\x30\x40\x50\x60\x70\x80\x90\x11\xFF\xEE")"sv); parsing_should_fail(FILE_LINE_ARGS, R"(str = "\x00\x10\x20\x30\x40\x50\x60\x70\x80\x90\x11\xFF\xEE")"sv);
#endif #endif
@ -198,22 +198,22 @@ str = ''''That's still pointless', she said.'''
parsing_should_fail(FILE_LINE_ARGS, R"(str = "\x1")"sv); parsing_should_fail(FILE_LINE_ARGS, R"(str = "\x1")"sv);
// ML string examples from https://github.com/toml-lang/toml/issues/725 // ML string examples from https://github.com/toml-lang/toml/issues/725
parse_expected_value(FILE_LINE_ARGS, R"( """ """ )"sv, S(R"( )"sv)); parse_expected_value(FILE_LINE_ARGS, R"( """ """ )"sv, R"( )"sv);
parse_expected_value(FILE_LINE_ARGS, R"( """ """" )"sv, S(R"( ")"sv)); parse_expected_value(FILE_LINE_ARGS, R"( """ """" )"sv, R"( ")"sv);
parse_expected_value(FILE_LINE_ARGS, R"( """ """"" )"sv, S(R"( "")"sv)); parse_expected_value(FILE_LINE_ARGS, R"( """ """"" )"sv, R"( "")"sv);
parsing_should_fail(FILE_LINE_ARGS, R"(v= """ """""" )"sv); parsing_should_fail(FILE_LINE_ARGS, R"(v= """ """""" )"sv);
parse_expected_value(FILE_LINE_ARGS, R"( ''' ''' )"sv, S(R"( )"sv)); parse_expected_value(FILE_LINE_ARGS, R"( ''' ''' )"sv, R"( )"sv);
parse_expected_value(FILE_LINE_ARGS, R"( ''' '''' )"sv, S(R"( ')"sv)); parse_expected_value(FILE_LINE_ARGS, R"( ''' '''' )"sv, R"( ')"sv);
parse_expected_value(FILE_LINE_ARGS, R"( ''' ''''' )"sv, S(R"( '')"sv)); parse_expected_value(FILE_LINE_ARGS, R"( ''' ''''' )"sv, R"( '')"sv);
parsing_should_fail(FILE_LINE_ARGS, R"(v= ''' '''''' )"sv); parsing_should_fail(FILE_LINE_ARGS, R"(v= ''' '''''' )"sv);
parse_expected_value(FILE_LINE_ARGS, R"( """""" )"sv, S(R"()"sv)); parse_expected_value(FILE_LINE_ARGS, R"( """""" )"sv, R"()"sv);
parse_expected_value(FILE_LINE_ARGS, R"( """" """ )"sv, S(R"(" )"sv)); parse_expected_value(FILE_LINE_ARGS, R"( """" """ )"sv, R"(" )"sv);
parse_expected_value(FILE_LINE_ARGS, R"( """"" """ )"sv, S(R"("" )"sv)); parse_expected_value(FILE_LINE_ARGS, R"( """"" """ )"sv, R"("" )"sv);
parsing_should_fail(FILE_LINE_ARGS, R"(v= """""" """ )"sv); parsing_should_fail(FILE_LINE_ARGS, R"(v= """""" """ )"sv);
parse_expected_value(FILE_LINE_ARGS, R"( '''''' )"sv, S(R"()"sv)); parse_expected_value(FILE_LINE_ARGS, R"( '''''' )"sv, R"()"sv);
parse_expected_value(FILE_LINE_ARGS, R"( '''' ''' )"sv, S(R"(' )"sv)); parse_expected_value(FILE_LINE_ARGS, R"( '''' ''' )"sv, R"(' )"sv);
parse_expected_value(FILE_LINE_ARGS, R"( ''''' ''' )"sv, S(R"('' )"sv)); parse_expected_value(FILE_LINE_ARGS, R"( ''''' ''' )"sv, R"('' )"sv);
parsing_should_fail(FILE_LINE_ARGS, R"(v= '''''' ''' )"sv); parsing_should_fail(FILE_LINE_ARGS, R"(v= '''''' ''' )"sv);
parse_expected_value(FILE_LINE_ARGS, R"( """""\"""""" )"sv, S(R"(""""")"sv)); parse_expected_value(FILE_LINE_ARGS, R"( """""\"""""" )"sv, R"(""""")"sv);
parse_expected_value(FILE_LINE_ARGS, R"( """""\"""\"""""" )"sv, S(R"("""""""")"sv)); parse_expected_value(FILE_LINE_ARGS, R"( """""\"""\"""""" )"sv, R"("""""""")"sv);
} }

View File

@ -45,46 +45,46 @@ smooth = true
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
REQUIRE(tbl[S("table")].as<table>()); REQUIRE(tbl["table"].as<table>());
CHECK(tbl[S("table")].as<table>()->size() == 0_sz); CHECK(tbl["table"].as<table>()->size() == 0_sz);
REQUIRE(tbl[S("table-1")].as<table>()); REQUIRE(tbl["table-1"].as<table>());
CHECK(tbl[S("table-1")].as<table>()->size() == 2_sz); CHECK(tbl["table-1"].as<table>()->size() == 2_sz);
CHECK(tbl[S("table-1")][S("key1")] == S("some string"sv)); CHECK(tbl["table-1"]["key1"] == "some string"sv);
CHECK(tbl[S("table-1")][S("key2")] == 123); CHECK(tbl["table-1"]["key2"] == 123);
REQUIRE(tbl[S("table-2")].as<table>()); REQUIRE(tbl["table-2"].as<table>());
CHECK(tbl[S("table-2")].as<table>()->size() == 2_sz); CHECK(tbl["table-2"].as<table>()->size() == 2_sz);
CHECK(tbl[S("table-2")][S("key1")] == S("another string"sv)); CHECK(tbl["table-2"]["key1"] == "another string"sv);
CHECK(tbl[S("table-2")][S("key2")] == 456); CHECK(tbl["table-2"]["key2"] == 456);
REQUIRE(tbl[S("dog")].as<table>()); REQUIRE(tbl["dog"].as<table>());
CHECK(tbl[S("dog")].as<table>()->size() == 1_sz); CHECK(tbl["dog"].as<table>()->size() == 1_sz);
REQUIRE(tbl[S("dog")][S("tater.man")].as<table>()); REQUIRE(tbl["dog"]["tater.man"].as<table>());
CHECK(tbl[S("dog")][S("tater.man")].as<table>()->size() == 1_sz); CHECK(tbl["dog"]["tater.man"].as<table>()->size() == 1_sz);
CHECK(tbl[S("dog")][S("tater.man")][S("type")][S("name")] == S("pug"sv)); CHECK(tbl["dog"]["tater.man"]["type"]["name"] == "pug"sv);
CHECK(tbl[S("a")].as<table>()); CHECK(tbl["a"].as<table>());
CHECK(tbl[S("a")][S("b")].as<table>()); CHECK(tbl["a"]["b"].as<table>());
CHECK(tbl[S("a")][S("b")][S("c")].as<table>()); CHECK(tbl["a"]["b"]["c"].as<table>());
CHECK(tbl[S("d")].as<table>()); CHECK(tbl["d"].as<table>());
CHECK(tbl[S("d")][S("e")].as<table>()); CHECK(tbl["d"]["e"].as<table>());
CHECK(tbl[S("d")][S("e")][S("f")].as<table>()); CHECK(tbl["d"]["e"]["f"].as<table>());
CHECK(tbl[S("g")].as<table>()); CHECK(tbl["g"].as<table>());
CHECK(tbl[S("g")][S("h")].as<table>()); CHECK(tbl["g"]["h"].as<table>());
CHECK(tbl[S("g")][S("h")][S("i")].as<table>()); CHECK(tbl["g"]["h"]["i"].as<table>());
CHECK(tbl[S("j")].as<table>()); CHECK(tbl["j"].as<table>());
CHECK(tbl[S("j")][S("ʞ")].as<table>()); CHECK(tbl["j"]["ʞ"].as<table>());
CHECK(tbl[S("j")][S("ʞ")][S("l")].as<table>()); CHECK(tbl["j"]["ʞ"]["l"].as<table>());
REQUIRE(tbl[S("fruit")].as<table>()); REQUIRE(tbl["fruit"].as<table>());
CHECK(tbl[S("fruit")][S("apple")][S("color")] == S("red"sv)); CHECK(tbl["fruit"]["apple"]["color"] == "red"sv);
CHECK(tbl[S("fruit")][S("apple")][S("taste")][S("sweet")] == true); CHECK(tbl["fruit"]["apple"]["taste"]["sweet"] == true);
CHECK(tbl[S("fruit")][S("apple")][S("texture")][S("smooth")] == true); CHECK(tbl["fruit"]["apple"]["texture"]["smooth"] == true);
} }
); );
@ -135,14 +135,14 @@ apple.taste.sweet = true
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
REQUIRE(tbl[S("animal")].as<table>()); REQUIRE(tbl["animal"].as<table>());
CHECK(tbl[S("animal")].as<table>()->size() == 0_sz); CHECK(tbl["animal"].as<table>()->size() == 0_sz);
REQUIRE(tbl[S("fruit")].as<table>()); REQUIRE(tbl["fruit"].as<table>());
CHECK(tbl[S("fruit")].as<table>()->size() == 2_sz); CHECK(tbl["fruit"].as<table>()->size() == 2_sz);
REQUIRE(tbl[S("fruit")][S("apple")].as<table>()); REQUIRE(tbl["fruit"]["apple"].as<table>());
REQUIRE(tbl[S("fruit")][S("orange")].as<table>()); REQUIRE(tbl["fruit"]["orange"].as<table>());
} }
); );
@ -157,14 +157,14 @@ apple.taste.sweet = true
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
REQUIRE(tbl[S("animal")].as<table>()); REQUIRE(tbl["animal"].as<table>());
CHECK(tbl[S("animal")].as<table>()->size() == 0_sz); CHECK(tbl["animal"].as<table>()->size() == 0_sz);
REQUIRE(tbl[S("fruit")].as<table>()); REQUIRE(tbl["fruit"].as<table>());
CHECK(tbl[S("fruit")].as<table>()->size() == 2_sz); CHECK(tbl["fruit"].as<table>()->size() == 2_sz);
REQUIRE(tbl[S("fruit")][S("apple")].as<table>()); REQUIRE(tbl["fruit"]["apple"].as<table>());
REQUIRE(tbl[S("fruit")][S("orange")].as<table>()); REQUIRE(tbl["fruit"]["orange"].as<table>());
} }
); );
@ -185,27 +185,27 @@ type = { name = "Nail" }
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
REQUIRE(tbl[S("name")].as<table>()); REQUIRE(tbl["name"].as<table>());
CHECK(tbl[S("name")].as<table>()->size() == 2_sz); CHECK(tbl["name"].as<table>()->size() == 2_sz);
CHECK(tbl[S("name")][S("first")] == S("Tom"sv)); CHECK(tbl["name"]["first"] == "Tom"sv);
CHECK(tbl[S("name")][S("last")] == S("Preston-Werner"sv)); CHECK(tbl["name"]["last"] == "Preston-Werner"sv);
REQUIRE(tbl[S("point")].as<table>()); REQUIRE(tbl["point"].as<table>());
CHECK(tbl[S("point")].as<table>()->size() == 2_sz); CHECK(tbl["point"].as<table>()->size() == 2_sz);
CHECK(tbl[S("point")][S("x")] == 1); CHECK(tbl["point"]["x"] == 1);
CHECK(tbl[S("point")][S("y")] == 2); CHECK(tbl["point"]["y"] == 2);
REQUIRE(tbl[S("animal")].as<table>()); REQUIRE(tbl["animal"].as<table>());
CHECK(tbl[S("animal")].as<table>()->size() == 1_sz); CHECK(tbl["animal"].as<table>()->size() == 1_sz);
REQUIRE(tbl[S("animal")][S("type")].as<table>()); REQUIRE(tbl["animal"]["type"].as<table>());
CHECK(tbl[S("animal")][S("type")].as<table>()->size() == 1_sz); CHECK(tbl["animal"]["type"].as<table>()->size() == 1_sz);
CHECK(tbl[S("animal")][S("type")][S("name")] == S("pug"sv)); CHECK(tbl["animal"]["type"]["name"] == "pug"sv);
REQUIRE(tbl[S("product")].as<table>()); REQUIRE(tbl["product"].as<table>());
CHECK(tbl[S("product")].as<table>()->size() == 1_sz); CHECK(tbl["product"].as<table>()->size() == 1_sz);
REQUIRE(tbl[S("product")][S("type")].as<table>()); REQUIRE(tbl["product"]["type"].as<table>());
CHECK(tbl[S("product")][S("type")].as<table>()->size() == 1_sz); CHECK(tbl["product"]["type"].as<table>()->size() == 1_sz);
CHECK(tbl[S("product")][S("type")][S("name")] == S("Nail"sv)); CHECK(tbl["product"]["type"]["name"] == "Nail"sv);
} }
); );
@ -232,15 +232,15 @@ test = { val1 = "foo", val2 = [
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
REQUIRE(tbl[S("test")].as<table>()); REQUIRE(tbl["test"].as<table>());
CHECK(tbl[S("test")].as<table>()->size() == 3_sz); CHECK(tbl["test"].as<table>()->size() == 3_sz);
CHECK(tbl[S("test")][S("val1")] == S("foo"sv)); CHECK(tbl["test"]["val1"] == "foo"sv);
REQUIRE(tbl[S("test")][S("val2")].as<array>()); REQUIRE(tbl["test"]["val2"].as<array>());
CHECK(tbl[S("test")][S("val2")].as<array>()->size() == 3_sz); CHECK(tbl["test"]["val2"].as<array>()->size() == 3_sz);
CHECK(tbl[S("test")][S("val2")][0] == 1); CHECK(tbl["test"]["val2"][0] == 1);
CHECK(tbl[S("test")][S("val2")][1] == 2); CHECK(tbl["test"]["val2"][1] == 2);
CHECK(tbl[S("test")][S("val2")][2] == 3); CHECK(tbl["test"]["val2"][2] == 3);
CHECK(tbl[S("test")][S("val3")] == S("bar"sv)); CHECK(tbl["test"]["val3"] == "bar"sv);
} }
); );
@ -257,10 +257,10 @@ name = {
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
REQUIRE(tbl[S("name")].as<table>()); REQUIRE(tbl["name"].as<table>());
CHECK(tbl[S("name")].as<table>()->size() == 2_sz); CHECK(tbl["name"].as<table>()->size() == 2_sz);
CHECK(tbl[S("name")][S("first")] == S("Tom"sv)); CHECK(tbl["name"]["first"] == "Tom"sv);
CHECK(tbl[S("name")][S("last")] == S("Preston-Werner"sv)); CHECK(tbl["name"]["last"] == "Preston-Werner"sv);
} }
); );
@ -326,70 +326,70 @@ color = "gray"
)"sv, )"sv,
[](table&& tbl) [](table&& tbl)
{ {
REQUIRE(tbl[S("points")].as<array>()); REQUIRE(tbl["points"].as<array>());
CHECK(tbl[S("points")].as<array>()->size() == 3_sz); CHECK(tbl["points"].as<array>()->size() == 3_sz);
CHECK(tbl[S("points")].as<array>()->is_homogeneous()); CHECK(tbl["points"].as<array>()->is_homogeneous());
CHECK(tbl[S("points")].as<array>()->is_array_of_tables()); CHECK(tbl["points"].as<array>()->is_array_of_tables());
CHECK(tbl[S("points")][0][S("x")] == 1); CHECK(tbl["points"][0]["x"] == 1);
CHECK(tbl[S("points")][0][S("y")] == 2); CHECK(tbl["points"][0]["y"] == 2);
CHECK(tbl[S("points")][0][S("z")] == 3); CHECK(tbl["points"][0]["z"] == 3);
CHECK(tbl[S("points")][1][S("x")] == 7); CHECK(tbl["points"][1]["x"] == 7);
CHECK(tbl[S("points")][1][S("y")] == 8); CHECK(tbl["points"][1]["y"] == 8);
CHECK(tbl[S("points")][1][S("z")] == 9); CHECK(tbl["points"][1]["z"] == 9);
CHECK(tbl[S("points")][2][S("x")] == 2); CHECK(tbl["points"][2]["x"] == 2);
CHECK(tbl[S("points")][2][S("y")] == 4); CHECK(tbl["points"][2]["y"] == 4);
CHECK(tbl[S("points")][2][S("z")] == 8); CHECK(tbl["points"][2]["z"] == 8);
REQUIRE(tbl[S("products")].as<array>()); REQUIRE(tbl["products"].as<array>());
CHECK(tbl[S("products")].as<array>()->size() == 3_sz); CHECK(tbl["products"].as<array>()->size() == 3_sz);
CHECK(tbl[S("products")].as<array>()->is_homogeneous()); CHECK(tbl["products"].as<array>()->is_homogeneous());
CHECK(tbl[S("products")].as<array>()->is_array_of_tables()); CHECK(tbl["products"].as<array>()->is_array_of_tables());
REQUIRE(tbl[S("products")][0].as<table>()); REQUIRE(tbl["products"][0].as<table>());
CHECK(tbl[S("products")][0].as<table>()->size() == 2_sz); CHECK(tbl["products"][0].as<table>()->size() == 2_sz);
CHECK(tbl[S("products")][0][S("name")] == S("Hammer"sv)); CHECK(tbl["products"][0]["name"] == "Hammer"sv);
CHECK(tbl[S("products")][0][S("sku")] == 738594937); CHECK(tbl["products"][0]["sku"] == 738594937);
REQUIRE(tbl[S("products")][1].as<table>()); REQUIRE(tbl["products"][1].as<table>());
CHECK(tbl[S("products")][1].as<table>()->size() == 0_sz); CHECK(tbl["products"][1].as<table>()->size() == 0_sz);
REQUIRE(tbl[S("products")][2].as<table>()); REQUIRE(tbl["products"][2].as<table>());
CHECK(tbl[S("products")][2].as<table>()->size() == 3_sz); CHECK(tbl["products"][2].as<table>()->size() == 3_sz);
CHECK(tbl[S("products")][2][S("name")] == S("Nail"sv)); CHECK(tbl["products"][2]["name"] == "Nail"sv);
CHECK(tbl[S("products")][2][S("sku")] == 284758393); CHECK(tbl["products"][2]["sku"] == 284758393);
CHECK(tbl[S("products")][2][S("color")] == S("gray"sv)); CHECK(tbl["products"][2]["color"] == "gray"sv);
REQUIRE(tbl[S("fruit")].as<array>()); REQUIRE(tbl["fruit"].as<array>());
CHECK(tbl[S("fruit")].as<array>()->size() == 2_sz); CHECK(tbl["fruit"].as<array>()->size() == 2_sz);
CHECK(tbl[S("fruit")].as<array>()->is_homogeneous()); CHECK(tbl["fruit"].as<array>()->is_homogeneous());
CHECK(tbl[S("fruit")].as<array>()->is_array_of_tables()); CHECK(tbl["fruit"].as<array>()->is_array_of_tables());
REQUIRE(tbl[S("fruit")][0].as<table>()); REQUIRE(tbl["fruit"][0].as<table>());
CHECK(tbl[S("fruit")][0].as<table>()->size() == 3_sz); CHECK(tbl["fruit"][0].as<table>()->size() == 3_sz);
CHECK(tbl[S("fruit")][0][S("name")] == S("apple"sv)); CHECK(tbl["fruit"][0]["name"] == "apple"sv);
REQUIRE(tbl[S("fruit")][0][S("physical")].as<table>()); REQUIRE(tbl["fruit"][0]["physical"].as<table>());
CHECK(tbl[S("fruit")][0][S("physical")].as<table>()->size() == 2_sz); CHECK(tbl["fruit"][0]["physical"].as<table>()->size() == 2_sz);
CHECK(tbl[S("fruit")][0][S("physical")][S("color")] == S("red"sv)); CHECK(tbl["fruit"][0]["physical"]["color"] == "red"sv);
CHECK(tbl[S("fruit")][0][S("physical")][S("shape")] == S("round"sv)); CHECK(tbl["fruit"][0]["physical"]["shape"] == "round"sv);
REQUIRE(tbl[S("fruit")][0][S("variety")].as<array>()); REQUIRE(tbl["fruit"][0]["variety"].as<array>());
CHECK(tbl[S("fruit")][0][S("variety")].as<array>()->size() == 2_sz); CHECK(tbl["fruit"][0]["variety"].as<array>()->size() == 2_sz);
CHECK(tbl[S("fruit")][0][S("variety")].as<array>()->is_homogeneous()); CHECK(tbl["fruit"][0]["variety"].as<array>()->is_homogeneous());
CHECK(tbl[S("fruit")][0][S("variety")].as<array>()->is_array_of_tables()); CHECK(tbl["fruit"][0]["variety"].as<array>()->is_array_of_tables());
CHECK(tbl[S("fruit")][0][S("variety")][0][S("name")] == S("red delicious"sv)); CHECK(tbl["fruit"][0]["variety"][0]["name"] == "red delicious"sv);
CHECK(tbl[S("fruit")][0][S("variety")][1][S("name")] == S("granny smith"sv)); CHECK(tbl["fruit"][0]["variety"][1]["name"] == "granny smith"sv);
REQUIRE(tbl[S("fruit")][1].as<table>()); REQUIRE(tbl["fruit"][1].as<table>());
CHECK(tbl[S("fruit")][1].as<table>()->size() == 2_sz); CHECK(tbl["fruit"][1].as<table>()->size() == 2_sz);
CHECK(tbl[S("fruit")][1][S("name")] == S("banana"sv)); CHECK(tbl["fruit"][1]["name"] == "banana"sv);
REQUIRE(tbl[S("fruit")][1][S("variety")].as<array>()); REQUIRE(tbl["fruit"][1]["variety"].as<array>());
CHECK(tbl[S("fruit")][1][S("variety")].as<array>()->size() == 1_sz); CHECK(tbl["fruit"][1]["variety"].as<array>()->size() == 1_sz);
CHECK(tbl[S("fruit")][1][S("variety")].as<array>()->is_homogeneous()); CHECK(tbl["fruit"][1]["variety"].as<array>()->is_homogeneous());
CHECK(tbl[S("fruit")][1][S("variety")].as<array>()->is_array_of_tables()); CHECK(tbl["fruit"][1]["variety"].as<array>()->is_array_of_tables());
CHECK(tbl[S("fruit")][1][S("variety")][0][S("name")] == S("plantain"sv)); CHECK(tbl["fruit"][1]["variety"][0]["name"] == "plantain"sv);
} }
); );

View File

@ -185,7 +185,7 @@ template bool parse_expected_value(std::string_view, uint32_t, std::string_view,
template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const bool&); template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const bool&);
template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const float&); template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const float&);
template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const double&); template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const double&);
template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const toml::string_view&); template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const std::string_view&);
namespace std namespace std
{ {

View File

@ -25,7 +25,6 @@ using namespace toml;
TOML_POP_WARNINGS TOML_POP_WARNINGS
#define FILE_LINE_ARGS std::string_view{ __FILE__ }, __LINE__ #define FILE_LINE_ARGS std::string_view{ __FILE__ }, __LINE__
#define S(str) TOML_STRING_PREFIX(str)
#define BOM_PREFIX "\xEF\xBB\xBF" #define BOM_PREFIX "\xEF\xBB\xBF"
#if TOML_EXCEPTIONS #if TOML_EXCEPTIONS
@ -112,7 +111,7 @@ bool parsing_should_fail(
std::string_view toml_str); std::string_view toml_str);
TOML_PUSH_WARNINGS TOML_PUSH_WARNINGS
TOML_DISABLE_FLOAT_WARNINGS TOML_DISABLE_ARITHMETIC_WARNINGS
template <typename T> template <typename T>
inline bool parse_expected_value( inline bool parse_expected_value(
@ -184,9 +183,14 @@ inline bool parse_expected_value(
[&](table&& tbl) [&](table&& tbl)
{ {
REQUIRE(tbl.size() == 1); REQUIRE(tbl.size() == 1);
auto nv = tbl[S("val"sv)]; auto nv = tbl["val"sv];
REQUIRE(nv); REQUIRE(nv);
REQUIRE(nv.is<value_type>());
REQUIRE(nv.as<value_type>()); REQUIRE(nv.as<value_type>());
REQUIRE(nv.type() == impl::node_type_of<T>);
REQUIRE(nv.node());
REQUIRE(nv.node()->is<value_type>());
REQUIRE(nv.node()->as<value_type>());
REQUIRE(nv.node()->type() == impl::node_type_of<T>); REQUIRE(nv.node()->type() == impl::node_type_of<T>);
// check the raw value // check the raw value
@ -199,8 +203,8 @@ inline bool parse_expected_value(
REQUIRE(nv.node()->ref<value_type>() == expected); REQUIRE(nv.node()->ref<value_type>() == expected);
// check the table relops // check the table relops
REQUIRE(tbl == table{ { { S("val"sv), expected } } }); REQUIRE(tbl == table{ { { "val"sv, expected } } });
REQUIRE(!(tbl != table{ { { S("val"sv), expected } } })); REQUIRE(!(tbl != table{ { { "val"sv, expected } } }));
// check the value relops // check the value relops
REQUIRE(*nv.as<value_type>() == expected); REQUIRE(*nv.as<value_type>() == expected);
@ -237,7 +241,7 @@ inline bool parse_expected_value(
{ {
std::string str; std::string str;
{ {
auto tbl = table{ { { S("val"sv), *val_parsed } } }; auto tbl = table{ { { "val"sv, *val_parsed } } };
std::ostringstream ss; std::ostringstream ss;
ss << tbl; ss << tbl;
str = std::move(ss).str(); str = std::move(ss).str();
@ -251,7 +255,7 @@ inline bool parse_expected_value(
[&](table&& tbl) [&](table&& tbl)
{ {
REQUIRE(tbl.size() == 1); REQUIRE(tbl.size() == 1);
auto nv = tbl[S("val"sv)]; auto nv = tbl["val"sv];
REQUIRE(nv); REQUIRE(nv);
REQUIRE(nv.as<value_type>()); REQUIRE(nv.as<value_type>());
REQUIRE(nv.node()->type() == impl::node_type_of<T>); REQUIRE(nv.node()->type() == impl::node_type_of<T>);
@ -279,7 +283,7 @@ extern template bool parse_expected_value(std::string_view, uint32_t, std::strin
extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const bool&); extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const bool&);
extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const float&); extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const float&);
extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const double&); extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const double&);
extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const toml::string_view&); extern template bool parse_expected_value(std::string_view, uint32_t, std::string_view, const std::string_view&);
namespace std namespace std
{ {
extern template class unique_ptr<const Catch::IExceptionTranslator>; extern template class unique_ptr<const Catch::IExceptionTranslator>;
@ -297,4 +301,4 @@ namespace Catch
} }
} }
TOML_POP_WARNINGS // TOML_DISABLE_FLOAT_WARNINGS TOML_POP_WARNINGS // TOML_DISABLE_ARITHMETIC_WARNINGS

View File

@ -7,13 +7,19 @@
#if TOML_WINDOWS_COMPAT #if TOML_WINDOWS_COMPAT
TOML_PUSH_WARNINGS
TOML_DISABLE_ALL_WARNINGS
#include <Windows.h>
TOML_POP_WARNINGS
TEST_CASE("windows compat") TEST_CASE("windows compat")
{ {
static constexpr auto toml_text = R"( static constexpr auto toml_text = R"(
[library] [library]
name = "toml++" name = "toml++"
authors = ["Mark Gillard <mark.gillard@outlook.com.au>"] authors = ["Mark Gillard <mark.gillard@outlook.com.au>"]
free = true
[dependencies] [dependencies]
cpp = 17 cpp = 17
)"sv; )"sv;
@ -31,13 +37,13 @@ TEST_CASE("windows compat")
CHECK(tbl.source().wide_path().value() == L"kek.toml"sv); CHECK(tbl.source().wide_path().value() == L"kek.toml"sv);
// direct lookups from tables // direct lookups from tables
REQUIRE(tbl.get(S("library")) != nullptr); REQUIRE(tbl.get("library") != nullptr);
CHECK(tbl.get(S("library")) == tbl.get(S("library"sv))); CHECK(tbl.get("library") == tbl.get("library"sv));
CHECK(tbl.get(S("library")) == tbl.get(S("library"s))); CHECK(tbl.get("library") == tbl.get("library"s));
CHECK(tbl.get(L"library") != nullptr); CHECK(tbl.get(L"library") != nullptr);
CHECK(tbl.get(L"library") == tbl.get(L"library"sv)); CHECK(tbl.get(L"library") == tbl.get(L"library"sv));
CHECK(tbl.get(L"library") == tbl.get(L"library"s)); CHECK(tbl.get(L"library") == tbl.get(L"library"s));
CHECK(tbl.get(L"library") == tbl.get(S("library"))); CHECK(tbl.get(L"library") == tbl.get("library"));
// node-view lookups // node-view lookups
CHECK(tbl[L"library"].node() != nullptr); CHECK(tbl[L"library"].node() != nullptr);
@ -51,23 +57,42 @@ TEST_CASE("windows compat")
CHECK(tbl[L"library"][L"name"].value_or(L"") == L"toml++"s); CHECK(tbl[L"library"][L"name"].value_or(L"") == L"toml++"s);
// node-view comparisons // node-view comparisons
CHECK(tbl[L"library"][L"name"] == S("toml++"sv)); CHECK(tbl[L"library"][L"name"] == "toml++"sv);
CHECK(tbl[L"library"][L"name"] == S("toml++"s)); CHECK(tbl[L"library"][L"name"] == "toml++"s);
CHECK(tbl[L"library"][L"name"] == S("toml++")); CHECK(tbl[L"library"][L"name"] == "toml++");
CHECK(tbl[L"library"][L"name"] == L"toml++"sv); CHECK(tbl[L"library"][L"name"] == L"toml++"sv);
CHECK(tbl[L"library"][L"name"] == L"toml++"s); CHECK(tbl[L"library"][L"name"] == L"toml++"s);
CHECK(tbl[L"library"][L"name"] == L"toml++"); CHECK(tbl[L"library"][L"name"] == L"toml++");
// table manipulation // table manipulation
tbl.insert(L"foo", L"bar"); tbl.insert(L"foo", L"bar");
REQUIRE(tbl.contains(S("foo"))); REQUIRE(tbl.contains("foo"));
REQUIRE(tbl.contains(L"foo")); REQUIRE(tbl.contains(L"foo"));
CHECK(tbl[S("foo")] == S("bar")); CHECK(tbl["foo"] == "bar");
tbl.insert_or_assign(L"foo", L"kek"); tbl.insert_or_assign(L"foo", L"kek");
CHECK(tbl[S("foo")] == S("kek")); CHECK(tbl["foo"] == "kek");
tbl.erase(L"foo"); tbl.erase(L"foo");
REQUIRE(!tbl.contains(S("foo"))); REQUIRE(!tbl.contains("foo"));
REQUIRE(!tbl.contains(L"foo")); REQUIRE(!tbl.contains(L"foo"));
// windows types
CHECK(tbl[L"library"][L"free"].value<BOOL>() == 1);
CHECK(tbl[L"dependencies"][L"cpp"].value<BOOL>() == 17);
CHECK(tbl[L"dependencies"][L"cpp"].value<SHORT>() == 17);
CHECK(tbl[L"dependencies"][L"cpp"].value<INT>() == 17);
CHECK(tbl[L"dependencies"][L"cpp"].value<LONG>() == 17);
CHECK(tbl[L"dependencies"][L"cpp"].value<INT_PTR>() == 17);
CHECK(tbl[L"dependencies"][L"cpp"].value<LONG_PTR>() == 17);
CHECK(tbl[L"dependencies"][L"cpp"].value<USHORT>() == 17u);
CHECK(tbl[L"dependencies"][L"cpp"].value<UINT>() == 17u);
CHECK(tbl[L"dependencies"][L"cpp"].value<ULONG>() == 17u);
CHECK(tbl[L"dependencies"][L"cpp"].value<UINT_PTR>() == 17u);
CHECK(tbl[L"dependencies"][L"cpp"].value<ULONG_PTR>() == 17u);
CHECK(tbl[L"dependencies"][L"cpp"].value<WORD>() == 17u);
CHECK(tbl[L"dependencies"][L"cpp"].value<DWORD>() == 17u);
CHECK(tbl[L"dependencies"][L"cpp"].value<DWORD32>() == 17u);
CHECK(tbl[L"dependencies"][L"cpp"].value<DWORD64>() == 17u);
CHECK(tbl[L"dependencies"][L"cpp"].value<DWORDLONG>() == 17u);
} }
#endif // TOML_WINDOWS_COMPAT #endif // TOML_WINDOWS_COMPAT

2187
toml.hpp

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
@ -24,19 +16,6 @@
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>

View File

@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
@ -24,19 +16,6 @@
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>

View File

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{54532B93-A2F9-49AC-886E-767A6D78E2F2}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{3E4018CE-CCA2-48E6-B11E-732A1B59C672}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,112 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{F094F967-42B5-4AD7-AB44-EA044CD9837E}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{EAC419E9-0C72-4625-B2B9-E879F697021A}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,112 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{9ADB61D3-FDFA-4A9C-A34F-663007BB70F6}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,112 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{E888E99C-734D-44C4-B917-0AC8D3E2F48F}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{89FF67C6-94C0-4C46-8411-7549A36584FB}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,112 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{F05F8C1B-7E23-4147-901E-AD91092E5752}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

99
vs/test_x64.vcxproj Normal file
View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{3227B3DB-D203-5485-98B4-0F3021AFB869}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Sync</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{B715E5E8-EC46-5ED6-87A7-C85CAB294888}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Sync</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{DFA3136B-CE2F-5E5F-80FC-D395F3D72180}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{913FC307-267A-5D14-B00A-7721371AD4E2}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Sync</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{F301F5EB-C33D-5BF2-BAAF-531F28AB3A49}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{B51CFAB1-00F6-5EC0-B6E5-625D40631518}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

99
vs/test_x64_unrel.vcxproj Normal file
View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{902B7939-6FD3-5819-97A6-E23AE3675834}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Sync</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{3C57D63F-BD2A-5D8D-A2DF-8A94799343F7}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

99
vs/test_x86.vcxproj Normal file
View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{8E878D65-5FB5-5E31-B389-A83E040C49EA}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Sync</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{150FA82E-0E9F-4449-82A6-811BFFE6B5FE}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{1ED2F590-1DE8-457D-97BD-38ECF0955F7F}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,112 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{BE980D05-770C-4420-B59B-EAD7A63468D2}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{A4F27C6F-601D-45C0-9F81-7C100BD93B9A}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,112 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{0CAD095A-C9F2-49FC-9C9F-4508498BE488}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,112 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{54DD1412-20C0-4700-96D7-3FD445E70996}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{3B05742A-6512-4B11-8842-A1B9D1465B1F}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,112 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{0BBEE569-536D-452C-808C-61843FECCC7E}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>TOML_CHAR_8_STRINGS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions Condition="'%(PrecompiledHeader)'=='Use'">USING_PCH=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{55D063AA-8120-5F31-9A9B-9EAAB910FBCE}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Sync</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{EB4C03FC-1CDE-5062-81DE-5948B382F85A}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{955F593A-6BFC-57A3-9A34-5FE2F3F37ACA}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Sync</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{0C46DDD5-781E-51B8-8057-1C82FFE1D96F}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{F48A5075-A26E-58D1-930B-8DBE88598338}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

99
vs/test_x86_unrel.vcxproj Normal file
View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{61286863-AD9B-5805-8478-EA339E5F4005}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Sync</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{DE1290DF-8EBF-5AD1-A07B-305C705892CE}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_UNRELEASED_FEATURES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>..\tests\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\tests\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\tests\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\tests\conformance_iarna_valid.cpp" />
<ClCompile Include="..\tests\impl_catch2.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\manipulating_arrays.cpp" />
<ClCompile Include="..\tests\manipulating_tables.cpp" />
<ClCompile Include="..\tests\manipulating_parse_result.cpp" />
<ClCompile Include="..\tests\manipulating_values.cpp" />
<ClCompile Include="..\tests\parsing_arrays.cpp" />
<ClCompile Include="..\tests\parsing_booleans.cpp" />
<ClCompile Include="..\tests\parsing_comments.cpp" />
<ClCompile Include="..\tests\parsing_dates_and_times.cpp" />
<ClCompile Include="..\tests\parsing_floats.cpp" />
<ClCompile Include="..\tests\parsing_integers.cpp" />
<ClCompile Include="..\tests\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\tests\parsing_spec_example.cpp" />
<ClCompile Include="..\tests\parsing_strings.cpp" />
<ClCompile Include="..\tests\parsing_tables.cpp" />
<ClCompile Include="..\tests\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\tests\unicode.cpp" />
<ClCompile Include="..\tests\unicode_generated.cpp" />
<ClCompile Include="..\tests\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\tests\catch2.h" />
<ClInclude Include="..\tests\evil_macros.h" />
<ClInclude Include="..\tests\settings.h" />
<ClInclude Include="..\tests\tests.h" />
<ClInclude Include="..\tests\tloptional.h" />
<ClInclude Include="..\tests\unicode.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\tests\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="::toml::date"> <Type Name="::toml::v2::date">
<DisplayString>{(int)year}-{(int)month}-{(int)day}</DisplayString> <DisplayString>{(int)year}-{(int)month}-{(int)day}</DisplayString>
<Expand> <Expand>
<Item Name="year" ExcludeView="simple">year</Item> <Item Name="year" ExcludeView="simple">year</Item>
@ -10,7 +10,7 @@
</Expand> </Expand>
</Type> </Type>
<Type Name="::toml::time"> <Type Name="::toml::v2::time">
<DisplayString>{(int)hour}:{(int)minute}:{second + (nanosecond / 1000000000.0)}</DisplayString> <DisplayString>{(int)hour}:{(int)minute}:{second + (nanosecond / 1000000000.0)}</DisplayString>
<Expand> <Expand>
<Item Name="hour" ExcludeView="simple">hour</Item> <Item Name="hour" ExcludeView="simple">hour</Item>
@ -20,7 +20,7 @@
</Expand> </Expand>
</Type> </Type>
<Type Name="::toml::time_offset"> <Type Name="::toml::v2::time_offset">
<DisplayString Condition="hours &gt;= 0 &amp;&amp; minutes &gt;= 0">{(int)hours}:{(int)minutes}</DisplayString> <DisplayString Condition="hours &gt;= 0 &amp;&amp; minutes &gt;= 0">{(int)hours}:{(int)minutes}</DisplayString>
<DisplayString Condition="hours &lt; 0 &amp;&amp; minutes &gt;= 0">-{-((int)hours)}:{(int)minutes}</DisplayString> <DisplayString Condition="hours &lt; 0 &amp;&amp; minutes &gt;= 0">-{-((int)hours)}:{(int)minutes}</DisplayString>
<DisplayString Condition="hours &lt; 0 &amp;&amp; minutes &lt; 0">-{-((int)hours)}:{-((int)minutes)}</DisplayString> <DisplayString Condition="hours &lt; 0 &amp;&amp; minutes &lt; 0">-{-((int)hours)}:{-((int)minutes)}</DisplayString>
@ -31,14 +31,14 @@
</Expand> </Expand>
</Type> </Type>
<Type Name="::toml::value&lt;*&gt;"> <Type Name="::toml::v2::value&lt;*&gt;">
<DisplayString>{{ {val_} }}</DisplayString> <DisplayString>{{ {val_} }}</DisplayString>
<Expand> <Expand>
<Item Name="val_" ExcludeView="simple">val_</Item> <Item Name="val_" ExcludeView="simple">val_</Item>
</Expand> </Expand>
</Type> </Type>
<Type Name="::toml::source_position"> <Type Name="::toml::v2::source_position">
<DisplayString>line {line}, column {column}</DisplayString> <DisplayString>line {line}, column {column}</DisplayString>
<Expand> <Expand>
<Item Name="line" ExcludeView="simple">line</Item> <Item Name="line" ExcludeView="simple">line</Item>
@ -46,7 +46,7 @@
</Expand> </Expand>
</Type> </Type>
<Type Name="::toml::impl::utf8_codepoint"> <Type Name="::toml::v2::impl::utf8_codepoint">
<DisplayString>{&amp;bytes,s8} ({position})</DisplayString> <DisplayString>{&amp;bytes,s8} ({position})</DisplayString>
</Type> </Type>

View File

@ -6,250 +6,160 @@ MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "toml++", "toml++.vcxproj", "{0E287B5A-1168-43FD-B067-F6BE8E182A57}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "toml++", "toml++.vcxproj", "{0E287B5A-1168-43FD-B067-F6BE8E182A57}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}"
EndProject ProjectSection(SolutionItems) = preProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_char", "test_char.vcxproj", "{54532B93-A2F9-49AC-886E-767A6D78E2F2}" test_x64_cpplatest.vcxproj = test_x64_cpplatest.vcxproj
EndProject EndProjectSection
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_char_noexcept", "test_char_noexcept.vcxproj", "{E888E99C-734D-44C4-B917-0AC8D3E2F48F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_char8", "test_char8.vcxproj", "{3E4018CE-CCA2-48E6-B11E-732A1B59C672}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_char8_noexcept", "test_char8_noexcept.vcxproj", "{F094F967-42B5-4AD7-AB44-EA044CD9837E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_char_strict", "test_char_strict.vcxproj", "{89FF67C6-94C0-4C46-8411-7549A36584FB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_char_strict_noexcept", "test_char_strict_noexcept.vcxproj", "{F05F8C1B-7E23-4147-901E-AD91092E5752}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_char8_strict", "test_char8_strict.vcxproj", "{EAC419E9-0C72-4625-B2B9-E879F697021A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_char8_strict_noexcept", "test_char8_strict_noexcept.vcxproj", "{9ADB61D3-FDFA-4A9C-A34F-663007BB70F6}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{412816A5-9D22-4A30-BCDF-ABFB54BB3735}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{412816A5-9D22-4A30-BCDF-ABFB54BB3735}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "toml_to_json_transcoder", "toml_to_json_transcoder.vcxproj", "{BE34AA99-BEE6-4B50-B237-217E7C88FCB5}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "toml_to_json_transcoder", "toml_to_json_transcoder.vcxproj", "{BE34AA99-BEE6-4B50-B237-217E7C88FCB5}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_char", "test_x86_char.vcxproj", "{150FA82E-0E9F-4449-82A6-811BFFE6B5FE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_char_noexcept", "test_x86_char_noexcept.vcxproj", "{54DD1412-20C0-4700-96D7-3FD445E70996}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_char8", "test_x86_char8.vcxproj", "{1ED2F590-1DE8-457D-97BD-38ECF0955F7F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_char8_noexcept", "test_x86_char8_noexcept.vcxproj", "{BE980D05-770C-4420-B59B-EAD7A63468D2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_char_strict", "test_x86_char_strict.vcxproj", "{3B05742A-6512-4B11-8842-A1B9D1465B1F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_char_strict_noexcept", "test_x86_char_strict_noexcept.vcxproj", "{0BBEE569-536D-452C-808C-61843FECCC7E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_char8_strict", "test_x86_char8_strict.vcxproj", "{A4F27C6F-601D-45C0-9F81-7C100BD93B9A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_char8_strict_noexcept", "test_x86_char8_strict_noexcept.vcxproj", "{0CAD095A-C9F2-49FC-9C9F-4508498BE488}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simple_parser", "simple_parser.vcxproj", "{259FCEE5-3442-4076-9547-2BA793ECA1CB}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simple_parser", "simple_parser.vcxproj", "{259FCEE5-3442-4076-9547-2BA793ECA1CB}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "toml_generator", "toml_generator.vcxproj", "{23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "toml_generator", "toml_generator.vcxproj", "{23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "error_printer", "error_printer.vcxproj", "{DAB4634D-8145-4860-AE45-5198E76FF324}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "error_printer", "error_printer.vcxproj", "{DAB4634D-8145-4860-AE45-5198E76FF324}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x64", "test_x64.vcxproj", "{3227B3DB-D203-5485-98B4-0F3021AFB869}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x64_noexcept", "test_x64_noexcept.vcxproj", "{B51CFAB1-00F6-5EC0-B6E5-625D40631518}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x64_unrel", "test_x64_unrel.vcxproj", "{902B7939-6FD3-5819-97A6-E23AE3675834}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x64_unrel_noexcept", "test_x64_unrel_noexcept.vcxproj", "{3C57D63F-BD2A-5D8D-A2DF-8A94799343F7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86", "test_x86.vcxproj", "{8E878D65-5FB5-5E31-B389-A83E040C49EA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_noexcept", "test_x86_noexcept.vcxproj", "{F48A5075-A26E-58D1-930B-8DBE88598338}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_unrel", "test_x86_unrel.vcxproj", "{61286863-AD9B-5805-8478-EA339E5F4005}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_unrel_noexcept", "test_x86_unrel_noexcept.vcxproj", "{DE1290DF-8EBF-5AD1-A07B-305C705892CE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x64_cpplatest_noexcept", "test_x64_cpplatest_noexcept.vcxproj", "{DFA3136B-CE2F-5E5F-80FC-D395F3D72180}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x64_cpplatest_unrel", "test_x64_cpplatest_unrel.vcxproj", "{913FC307-267A-5D14-B00A-7721371AD4E2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x64_cpplatest_unrel_noexcept", "test_x64_cpplatest_unrel_noexcept.vcxproj", "{F301F5EB-C33D-5BF2-BAAF-531F28AB3A49}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_cpplatest", "test_x86_cpplatest.vcxproj", "{55D063AA-8120-5F31-9A9B-9EAAB910FBCE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_cpplatest_noexcept", "test_x86_cpplatest_noexcept.vcxproj", "{EB4C03FC-1CDE-5062-81DE-5948B382F85A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_cpplatest_unrel", "test_x86_cpplatest_unrel.vcxproj", "{955F593A-6BFC-57A3-9A34-5FE2F3F37ACA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_x86_cpplatest_unrel_noexcept", "test_x86_cpplatest_unrel_noexcept.vcxproj", "{0C46DDD5-781E-51B8-8057-1C82FFE1D96F}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64 Release|x64 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0E287B5A-1168-43FD-B067-F6BE8E182A57}.Debug|Win32.ActiveCfg = Debug|Win32
{0E287B5A-1168-43FD-B067-F6BE8E182A57}.Debug|Win32.Build.0 = Debug|Win32
{0E287B5A-1168-43FD-B067-F6BE8E182A57}.Debug|x64.ActiveCfg = Debug|x64 {0E287B5A-1168-43FD-B067-F6BE8E182A57}.Debug|x64.ActiveCfg = Debug|x64
{0E287B5A-1168-43FD-B067-F6BE8E182A57}.Debug|x64.Build.0 = Debug|x64 {0E287B5A-1168-43FD-B067-F6BE8E182A57}.Debug|x64.Build.0 = Debug|x64
{0E287B5A-1168-43FD-B067-F6BE8E182A57}.Release|Win32.ActiveCfg = Release|Win32
{0E287B5A-1168-43FD-B067-F6BE8E182A57}.Release|Win32.Build.0 = Release|Win32
{0E287B5A-1168-43FD-B067-F6BE8E182A57}.Release|x64.ActiveCfg = Release|x64 {0E287B5A-1168-43FD-B067-F6BE8E182A57}.Release|x64.ActiveCfg = Release|x64
{0E287B5A-1168-43FD-B067-F6BE8E182A57}.Release|x64.Build.0 = Release|x64 {0E287B5A-1168-43FD-B067-F6BE8E182A57}.Release|x64.Build.0 = Release|x64
{54532B93-A2F9-49AC-886E-767A6D78E2F2}.Debug|Win32.ActiveCfg = Debug|x64
{54532B93-A2F9-49AC-886E-767A6D78E2F2}.Debug|Win32.Build.0 = Debug|x64
{54532B93-A2F9-49AC-886E-767A6D78E2F2}.Debug|x64.ActiveCfg = Debug|x64
{54532B93-A2F9-49AC-886E-767A6D78E2F2}.Debug|x64.Build.0 = Debug|x64
{54532B93-A2F9-49AC-886E-767A6D78E2F2}.Release|Win32.ActiveCfg = Release|x64
{54532B93-A2F9-49AC-886E-767A6D78E2F2}.Release|Win32.Build.0 = Release|x64
{54532B93-A2F9-49AC-886E-767A6D78E2F2}.Release|x64.ActiveCfg = Release|x64
{54532B93-A2F9-49AC-886E-767A6D78E2F2}.Release|x64.Build.0 = Release|x64
{E888E99C-734D-44C4-B917-0AC8D3E2F48F}.Debug|Win32.ActiveCfg = Debug|x64
{E888E99C-734D-44C4-B917-0AC8D3E2F48F}.Debug|Win32.Build.0 = Debug|x64
{E888E99C-734D-44C4-B917-0AC8D3E2F48F}.Debug|x64.ActiveCfg = Debug|x64
{E888E99C-734D-44C4-B917-0AC8D3E2F48F}.Debug|x64.Build.0 = Debug|x64
{E888E99C-734D-44C4-B917-0AC8D3E2F48F}.Release|Win32.ActiveCfg = Release|x64
{E888E99C-734D-44C4-B917-0AC8D3E2F48F}.Release|Win32.Build.0 = Release|x64
{E888E99C-734D-44C4-B917-0AC8D3E2F48F}.Release|x64.ActiveCfg = Release|x64
{E888E99C-734D-44C4-B917-0AC8D3E2F48F}.Release|x64.Build.0 = Release|x64
{3E4018CE-CCA2-48E6-B11E-732A1B59C672}.Debug|Win32.ActiveCfg = Debug|x64
{3E4018CE-CCA2-48E6-B11E-732A1B59C672}.Debug|Win32.Build.0 = Debug|x64
{3E4018CE-CCA2-48E6-B11E-732A1B59C672}.Debug|x64.ActiveCfg = Debug|x64
{3E4018CE-CCA2-48E6-B11E-732A1B59C672}.Debug|x64.Build.0 = Debug|x64
{3E4018CE-CCA2-48E6-B11E-732A1B59C672}.Release|Win32.ActiveCfg = Release|x64
{3E4018CE-CCA2-48E6-B11E-732A1B59C672}.Release|Win32.Build.0 = Release|x64
{3E4018CE-CCA2-48E6-B11E-732A1B59C672}.Release|x64.ActiveCfg = Release|x64
{3E4018CE-CCA2-48E6-B11E-732A1B59C672}.Release|x64.Build.0 = Release|x64
{F094F967-42B5-4AD7-AB44-EA044CD9837E}.Debug|Win32.ActiveCfg = Debug|x64
{F094F967-42B5-4AD7-AB44-EA044CD9837E}.Debug|Win32.Build.0 = Debug|x64
{F094F967-42B5-4AD7-AB44-EA044CD9837E}.Debug|x64.ActiveCfg = Debug|x64
{F094F967-42B5-4AD7-AB44-EA044CD9837E}.Debug|x64.Build.0 = Debug|x64
{F094F967-42B5-4AD7-AB44-EA044CD9837E}.Release|Win32.ActiveCfg = Release|x64
{F094F967-42B5-4AD7-AB44-EA044CD9837E}.Release|Win32.Build.0 = Release|x64
{F094F967-42B5-4AD7-AB44-EA044CD9837E}.Release|x64.ActiveCfg = Release|x64
{F094F967-42B5-4AD7-AB44-EA044CD9837E}.Release|x64.Build.0 = Release|x64
{89FF67C6-94C0-4C46-8411-7549A36584FB}.Debug|Win32.ActiveCfg = Debug|x64
{89FF67C6-94C0-4C46-8411-7549A36584FB}.Debug|Win32.Build.0 = Debug|x64
{89FF67C6-94C0-4C46-8411-7549A36584FB}.Debug|x64.ActiveCfg = Debug|x64
{89FF67C6-94C0-4C46-8411-7549A36584FB}.Debug|x64.Build.0 = Debug|x64
{89FF67C6-94C0-4C46-8411-7549A36584FB}.Release|Win32.ActiveCfg = Release|x64
{89FF67C6-94C0-4C46-8411-7549A36584FB}.Release|Win32.Build.0 = Release|x64
{89FF67C6-94C0-4C46-8411-7549A36584FB}.Release|x64.ActiveCfg = Release|x64
{89FF67C6-94C0-4C46-8411-7549A36584FB}.Release|x64.Build.0 = Release|x64
{F05F8C1B-7E23-4147-901E-AD91092E5752}.Debug|Win32.ActiveCfg = Debug|x64
{F05F8C1B-7E23-4147-901E-AD91092E5752}.Debug|Win32.Build.0 = Debug|x64
{F05F8C1B-7E23-4147-901E-AD91092E5752}.Debug|x64.ActiveCfg = Debug|x64
{F05F8C1B-7E23-4147-901E-AD91092E5752}.Debug|x64.Build.0 = Debug|x64
{F05F8C1B-7E23-4147-901E-AD91092E5752}.Release|Win32.ActiveCfg = Release|x64
{F05F8C1B-7E23-4147-901E-AD91092E5752}.Release|Win32.Build.0 = Release|x64
{F05F8C1B-7E23-4147-901E-AD91092E5752}.Release|x64.ActiveCfg = Release|x64
{F05F8C1B-7E23-4147-901E-AD91092E5752}.Release|x64.Build.0 = Release|x64
{EAC419E9-0C72-4625-B2B9-E879F697021A}.Debug|Win32.ActiveCfg = Debug|x64
{EAC419E9-0C72-4625-B2B9-E879F697021A}.Debug|Win32.Build.0 = Debug|x64
{EAC419E9-0C72-4625-B2B9-E879F697021A}.Debug|x64.ActiveCfg = Debug|x64
{EAC419E9-0C72-4625-B2B9-E879F697021A}.Debug|x64.Build.0 = Debug|x64
{EAC419E9-0C72-4625-B2B9-E879F697021A}.Release|Win32.ActiveCfg = Release|x64
{EAC419E9-0C72-4625-B2B9-E879F697021A}.Release|Win32.Build.0 = Release|x64
{EAC419E9-0C72-4625-B2B9-E879F697021A}.Release|x64.ActiveCfg = Release|x64
{EAC419E9-0C72-4625-B2B9-E879F697021A}.Release|x64.Build.0 = Release|x64
{9ADB61D3-FDFA-4A9C-A34F-663007BB70F6}.Debug|Win32.ActiveCfg = Debug|x64
{9ADB61D3-FDFA-4A9C-A34F-663007BB70F6}.Debug|Win32.Build.0 = Debug|x64
{9ADB61D3-FDFA-4A9C-A34F-663007BB70F6}.Debug|x64.ActiveCfg = Debug|x64
{9ADB61D3-FDFA-4A9C-A34F-663007BB70F6}.Debug|x64.Build.0 = Debug|x64
{9ADB61D3-FDFA-4A9C-A34F-663007BB70F6}.Release|Win32.ActiveCfg = Release|x64
{9ADB61D3-FDFA-4A9C-A34F-663007BB70F6}.Release|Win32.Build.0 = Release|x64
{9ADB61D3-FDFA-4A9C-A34F-663007BB70F6}.Release|x64.ActiveCfg = Release|x64
{9ADB61D3-FDFA-4A9C-A34F-663007BB70F6}.Release|x64.Build.0 = Release|x64
{BE34AA99-BEE6-4B50-B237-217E7C88FCB5}.Debug|Win32.ActiveCfg = Debug|Win32
{BE34AA99-BEE6-4B50-B237-217E7C88FCB5}.Debug|Win32.Build.0 = Debug|Win32
{BE34AA99-BEE6-4B50-B237-217E7C88FCB5}.Debug|x64.ActiveCfg = Debug|x64 {BE34AA99-BEE6-4B50-B237-217E7C88FCB5}.Debug|x64.ActiveCfg = Debug|x64
{BE34AA99-BEE6-4B50-B237-217E7C88FCB5}.Debug|x64.Build.0 = Debug|x64 {BE34AA99-BEE6-4B50-B237-217E7C88FCB5}.Debug|x64.Build.0 = Debug|x64
{BE34AA99-BEE6-4B50-B237-217E7C88FCB5}.Release|Win32.ActiveCfg = Release|Win32
{BE34AA99-BEE6-4B50-B237-217E7C88FCB5}.Release|Win32.Build.0 = Release|Win32
{BE34AA99-BEE6-4B50-B237-217E7C88FCB5}.Release|x64.ActiveCfg = Release|x64 {BE34AA99-BEE6-4B50-B237-217E7C88FCB5}.Release|x64.ActiveCfg = Release|x64
{BE34AA99-BEE6-4B50-B237-217E7C88FCB5}.Release|x64.Build.0 = Release|x64 {BE34AA99-BEE6-4B50-B237-217E7C88FCB5}.Release|x64.Build.0 = Release|x64
{150FA82E-0E9F-4449-82A6-811BFFE6B5FE}.Debug|Win32.ActiveCfg = Debug|Win32
{150FA82E-0E9F-4449-82A6-811BFFE6B5FE}.Debug|Win32.Build.0 = Debug|Win32
{150FA82E-0E9F-4449-82A6-811BFFE6B5FE}.Debug|x64.ActiveCfg = Debug|Win32
{150FA82E-0E9F-4449-82A6-811BFFE6B5FE}.Debug|x64.Build.0 = Debug|Win32
{150FA82E-0E9F-4449-82A6-811BFFE6B5FE}.Release|Win32.ActiveCfg = Release|Win32
{150FA82E-0E9F-4449-82A6-811BFFE6B5FE}.Release|Win32.Build.0 = Release|Win32
{150FA82E-0E9F-4449-82A6-811BFFE6B5FE}.Release|x64.ActiveCfg = Release|Win32
{150FA82E-0E9F-4449-82A6-811BFFE6B5FE}.Release|x64.Build.0 = Release|Win32
{54DD1412-20C0-4700-96D7-3FD445E70996}.Debug|Win32.ActiveCfg = Debug|Win32
{54DD1412-20C0-4700-96D7-3FD445E70996}.Debug|Win32.Build.0 = Debug|Win32
{54DD1412-20C0-4700-96D7-3FD445E70996}.Debug|x64.ActiveCfg = Debug|Win32
{54DD1412-20C0-4700-96D7-3FD445E70996}.Debug|x64.Build.0 = Debug|Win32
{54DD1412-20C0-4700-96D7-3FD445E70996}.Release|Win32.ActiveCfg = Release|Win32
{54DD1412-20C0-4700-96D7-3FD445E70996}.Release|Win32.Build.0 = Release|Win32
{54DD1412-20C0-4700-96D7-3FD445E70996}.Release|x64.ActiveCfg = Release|Win32
{54DD1412-20C0-4700-96D7-3FD445E70996}.Release|x64.Build.0 = Release|Win32
{1ED2F590-1DE8-457D-97BD-38ECF0955F7F}.Debug|Win32.ActiveCfg = Debug|Win32
{1ED2F590-1DE8-457D-97BD-38ECF0955F7F}.Debug|Win32.Build.0 = Debug|Win32
{1ED2F590-1DE8-457D-97BD-38ECF0955F7F}.Debug|x64.ActiveCfg = Debug|Win32
{1ED2F590-1DE8-457D-97BD-38ECF0955F7F}.Debug|x64.Build.0 = Debug|Win32
{1ED2F590-1DE8-457D-97BD-38ECF0955F7F}.Release|Win32.ActiveCfg = Release|Win32
{1ED2F590-1DE8-457D-97BD-38ECF0955F7F}.Release|Win32.Build.0 = Release|Win32
{1ED2F590-1DE8-457D-97BD-38ECF0955F7F}.Release|x64.ActiveCfg = Release|Win32
{1ED2F590-1DE8-457D-97BD-38ECF0955F7F}.Release|x64.Build.0 = Release|Win32
{BE980D05-770C-4420-B59B-EAD7A63468D2}.Debug|Win32.ActiveCfg = Debug|Win32
{BE980D05-770C-4420-B59B-EAD7A63468D2}.Debug|Win32.Build.0 = Debug|Win32
{BE980D05-770C-4420-B59B-EAD7A63468D2}.Debug|x64.ActiveCfg = Debug|Win32
{BE980D05-770C-4420-B59B-EAD7A63468D2}.Debug|x64.Build.0 = Debug|Win32
{BE980D05-770C-4420-B59B-EAD7A63468D2}.Release|Win32.ActiveCfg = Release|Win32
{BE980D05-770C-4420-B59B-EAD7A63468D2}.Release|Win32.Build.0 = Release|Win32
{BE980D05-770C-4420-B59B-EAD7A63468D2}.Release|x64.ActiveCfg = Release|Win32
{BE980D05-770C-4420-B59B-EAD7A63468D2}.Release|x64.Build.0 = Release|Win32
{3B05742A-6512-4B11-8842-A1B9D1465B1F}.Debug|Win32.ActiveCfg = Debug|Win32
{3B05742A-6512-4B11-8842-A1B9D1465B1F}.Debug|Win32.Build.0 = Debug|Win32
{3B05742A-6512-4B11-8842-A1B9D1465B1F}.Debug|x64.ActiveCfg = Debug|Win32
{3B05742A-6512-4B11-8842-A1B9D1465B1F}.Debug|x64.Build.0 = Debug|Win32
{3B05742A-6512-4B11-8842-A1B9D1465B1F}.Release|Win32.ActiveCfg = Release|Win32
{3B05742A-6512-4B11-8842-A1B9D1465B1F}.Release|Win32.Build.0 = Release|Win32
{3B05742A-6512-4B11-8842-A1B9D1465B1F}.Release|x64.ActiveCfg = Release|Win32
{3B05742A-6512-4B11-8842-A1B9D1465B1F}.Release|x64.Build.0 = Release|Win32
{0BBEE569-536D-452C-808C-61843FECCC7E}.Debug|Win32.ActiveCfg = Debug|Win32
{0BBEE569-536D-452C-808C-61843FECCC7E}.Debug|Win32.Build.0 = Debug|Win32
{0BBEE569-536D-452C-808C-61843FECCC7E}.Debug|x64.ActiveCfg = Debug|Win32
{0BBEE569-536D-452C-808C-61843FECCC7E}.Debug|x64.Build.0 = Debug|Win32
{0BBEE569-536D-452C-808C-61843FECCC7E}.Release|Win32.ActiveCfg = Release|Win32
{0BBEE569-536D-452C-808C-61843FECCC7E}.Release|Win32.Build.0 = Release|Win32
{0BBEE569-536D-452C-808C-61843FECCC7E}.Release|x64.ActiveCfg = Release|Win32
{0BBEE569-536D-452C-808C-61843FECCC7E}.Release|x64.Build.0 = Release|Win32
{A4F27C6F-601D-45C0-9F81-7C100BD93B9A}.Debug|Win32.ActiveCfg = Debug|Win32
{A4F27C6F-601D-45C0-9F81-7C100BD93B9A}.Debug|Win32.Build.0 = Debug|Win32
{A4F27C6F-601D-45C0-9F81-7C100BD93B9A}.Debug|x64.ActiveCfg = Debug|Win32
{A4F27C6F-601D-45C0-9F81-7C100BD93B9A}.Debug|x64.Build.0 = Debug|Win32
{A4F27C6F-601D-45C0-9F81-7C100BD93B9A}.Release|Win32.ActiveCfg = Release|Win32
{A4F27C6F-601D-45C0-9F81-7C100BD93B9A}.Release|Win32.Build.0 = Release|Win32
{A4F27C6F-601D-45C0-9F81-7C100BD93B9A}.Release|x64.ActiveCfg = Release|Win32
{A4F27C6F-601D-45C0-9F81-7C100BD93B9A}.Release|x64.Build.0 = Release|Win32
{0CAD095A-C9F2-49FC-9C9F-4508498BE488}.Debug|Win32.ActiveCfg = Debug|Win32
{0CAD095A-C9F2-49FC-9C9F-4508498BE488}.Debug|Win32.Build.0 = Debug|Win32
{0CAD095A-C9F2-49FC-9C9F-4508498BE488}.Debug|x64.ActiveCfg = Debug|Win32
{0CAD095A-C9F2-49FC-9C9F-4508498BE488}.Debug|x64.Build.0 = Debug|Win32
{0CAD095A-C9F2-49FC-9C9F-4508498BE488}.Release|Win32.ActiveCfg = Release|Win32
{0CAD095A-C9F2-49FC-9C9F-4508498BE488}.Release|Win32.Build.0 = Release|Win32
{0CAD095A-C9F2-49FC-9C9F-4508498BE488}.Release|x64.ActiveCfg = Release|Win32
{0CAD095A-C9F2-49FC-9C9F-4508498BE488}.Release|x64.Build.0 = Release|Win32
{259FCEE5-3442-4076-9547-2BA793ECA1CB}.Debug|Win32.ActiveCfg = Debug|Win32
{259FCEE5-3442-4076-9547-2BA793ECA1CB}.Debug|Win32.Build.0 = Debug|Win32
{259FCEE5-3442-4076-9547-2BA793ECA1CB}.Debug|x64.ActiveCfg = Debug|x64 {259FCEE5-3442-4076-9547-2BA793ECA1CB}.Debug|x64.ActiveCfg = Debug|x64
{259FCEE5-3442-4076-9547-2BA793ECA1CB}.Debug|x64.Build.0 = Debug|x64 {259FCEE5-3442-4076-9547-2BA793ECA1CB}.Debug|x64.Build.0 = Debug|x64
{259FCEE5-3442-4076-9547-2BA793ECA1CB}.Release|Win32.ActiveCfg = Release|Win32
{259FCEE5-3442-4076-9547-2BA793ECA1CB}.Release|Win32.Build.0 = Release|Win32
{259FCEE5-3442-4076-9547-2BA793ECA1CB}.Release|x64.ActiveCfg = Release|x64 {259FCEE5-3442-4076-9547-2BA793ECA1CB}.Release|x64.ActiveCfg = Release|x64
{259FCEE5-3442-4076-9547-2BA793ECA1CB}.Release|x64.Build.0 = Release|x64 {259FCEE5-3442-4076-9547-2BA793ECA1CB}.Release|x64.Build.0 = Release|x64
{23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}.Debug|Win32.ActiveCfg = Debug|Win32
{23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}.Debug|Win32.Build.0 = Debug|Win32
{23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}.Debug|x64.ActiveCfg = Debug|x64 {23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}.Debug|x64.ActiveCfg = Debug|x64
{23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}.Debug|x64.Build.0 = Debug|x64 {23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}.Debug|x64.Build.0 = Debug|x64
{23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}.Release|Win32.ActiveCfg = Release|Win32
{23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}.Release|Win32.Build.0 = Release|Win32
{23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}.Release|x64.ActiveCfg = Release|x64 {23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}.Release|x64.ActiveCfg = Release|x64
{23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}.Release|x64.Build.0 = Release|x64 {23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2}.Release|x64.Build.0 = Release|x64
{DAB4634D-8145-4860-AE45-5198E76FF324}.Debug|Win32.ActiveCfg = Debug|Win32
{DAB4634D-8145-4860-AE45-5198E76FF324}.Debug|Win32.Build.0 = Debug|Win32
{DAB4634D-8145-4860-AE45-5198E76FF324}.Debug|x64.ActiveCfg = Debug|x64 {DAB4634D-8145-4860-AE45-5198E76FF324}.Debug|x64.ActiveCfg = Debug|x64
{DAB4634D-8145-4860-AE45-5198E76FF324}.Debug|x64.Build.0 = Debug|x64 {DAB4634D-8145-4860-AE45-5198E76FF324}.Debug|x64.Build.0 = Debug|x64
{DAB4634D-8145-4860-AE45-5198E76FF324}.Release|Win32.ActiveCfg = Release|Win32
{DAB4634D-8145-4860-AE45-5198E76FF324}.Release|Win32.Build.0 = Release|Win32
{DAB4634D-8145-4860-AE45-5198E76FF324}.Release|x64.ActiveCfg = Release|x64 {DAB4634D-8145-4860-AE45-5198E76FF324}.Release|x64.ActiveCfg = Release|x64
{DAB4634D-8145-4860-AE45-5198E76FF324}.Release|x64.Build.0 = Release|x64 {DAB4634D-8145-4860-AE45-5198E76FF324}.Release|x64.Build.0 = Release|x64
{3227B3DB-D203-5485-98B4-0F3021AFB869}.Debug|x64.ActiveCfg = Debug|x64
{3227B3DB-D203-5485-98B4-0F3021AFB869}.Debug|x64.Build.0 = Debug|x64
{3227B3DB-D203-5485-98B4-0F3021AFB869}.Release|x64.ActiveCfg = Release|x64
{3227B3DB-D203-5485-98B4-0F3021AFB869}.Release|x64.Build.0 = Release|x64
{B51CFAB1-00F6-5EC0-B6E5-625D40631518}.Debug|x64.ActiveCfg = Debug|x64
{B51CFAB1-00F6-5EC0-B6E5-625D40631518}.Debug|x64.Build.0 = Debug|x64
{B51CFAB1-00F6-5EC0-B6E5-625D40631518}.Release|x64.ActiveCfg = Release|x64
{B51CFAB1-00F6-5EC0-B6E5-625D40631518}.Release|x64.Build.0 = Release|x64
{902B7939-6FD3-5819-97A6-E23AE3675834}.Debug|x64.ActiveCfg = Debug|x64
{902B7939-6FD3-5819-97A6-E23AE3675834}.Debug|x64.Build.0 = Debug|x64
{902B7939-6FD3-5819-97A6-E23AE3675834}.Release|x64.ActiveCfg = Release|x64
{902B7939-6FD3-5819-97A6-E23AE3675834}.Release|x64.Build.0 = Release|x64
{3C57D63F-BD2A-5D8D-A2DF-8A94799343F7}.Debug|x64.ActiveCfg = Debug|x64
{3C57D63F-BD2A-5D8D-A2DF-8A94799343F7}.Debug|x64.Build.0 = Debug|x64
{3C57D63F-BD2A-5D8D-A2DF-8A94799343F7}.Release|x64.ActiveCfg = Release|x64
{3C57D63F-BD2A-5D8D-A2DF-8A94799343F7}.Release|x64.Build.0 = Release|x64
{8E878D65-5FB5-5E31-B389-A83E040C49EA}.Debug|x64.ActiveCfg = Debug|Win32
{8E878D65-5FB5-5E31-B389-A83E040C49EA}.Debug|x64.Build.0 = Debug|Win32
{8E878D65-5FB5-5E31-B389-A83E040C49EA}.Release|x64.ActiveCfg = Release|Win32
{8E878D65-5FB5-5E31-B389-A83E040C49EA}.Release|x64.Build.0 = Release|Win32
{F48A5075-A26E-58D1-930B-8DBE88598338}.Debug|x64.ActiveCfg = Debug|Win32
{F48A5075-A26E-58D1-930B-8DBE88598338}.Debug|x64.Build.0 = Debug|Win32
{F48A5075-A26E-58D1-930B-8DBE88598338}.Release|x64.ActiveCfg = Release|Win32
{F48A5075-A26E-58D1-930B-8DBE88598338}.Release|x64.Build.0 = Release|Win32
{61286863-AD9B-5805-8478-EA339E5F4005}.Debug|x64.ActiveCfg = Debug|Win32
{61286863-AD9B-5805-8478-EA339E5F4005}.Debug|x64.Build.0 = Debug|Win32
{61286863-AD9B-5805-8478-EA339E5F4005}.Release|x64.ActiveCfg = Release|Win32
{61286863-AD9B-5805-8478-EA339E5F4005}.Release|x64.Build.0 = Release|Win32
{DE1290DF-8EBF-5AD1-A07B-305C705892CE}.Debug|x64.ActiveCfg = Debug|Win32
{DE1290DF-8EBF-5AD1-A07B-305C705892CE}.Debug|x64.Build.0 = Debug|Win32
{DE1290DF-8EBF-5AD1-A07B-305C705892CE}.Release|x64.ActiveCfg = Release|Win32
{DE1290DF-8EBF-5AD1-A07B-305C705892CE}.Release|x64.Build.0 = Release|Win32
{DFA3136B-CE2F-5E5F-80FC-D395F3D72180}.Debug|x64.ActiveCfg = Debug|x64
{DFA3136B-CE2F-5E5F-80FC-D395F3D72180}.Debug|x64.Build.0 = Debug|x64
{DFA3136B-CE2F-5E5F-80FC-D395F3D72180}.Release|x64.ActiveCfg = Release|x64
{DFA3136B-CE2F-5E5F-80FC-D395F3D72180}.Release|x64.Build.0 = Release|x64
{913FC307-267A-5D14-B00A-7721371AD4E2}.Debug|x64.ActiveCfg = Debug|x64
{913FC307-267A-5D14-B00A-7721371AD4E2}.Debug|x64.Build.0 = Debug|x64
{913FC307-267A-5D14-B00A-7721371AD4E2}.Release|x64.ActiveCfg = Release|x64
{913FC307-267A-5D14-B00A-7721371AD4E2}.Release|x64.Build.0 = Release|x64
{F301F5EB-C33D-5BF2-BAAF-531F28AB3A49}.Debug|x64.ActiveCfg = Debug|x64
{F301F5EB-C33D-5BF2-BAAF-531F28AB3A49}.Debug|x64.Build.0 = Debug|x64
{F301F5EB-C33D-5BF2-BAAF-531F28AB3A49}.Release|x64.ActiveCfg = Release|x64
{F301F5EB-C33D-5BF2-BAAF-531F28AB3A49}.Release|x64.Build.0 = Release|x64
{55D063AA-8120-5F31-9A9B-9EAAB910FBCE}.Debug|x64.ActiveCfg = Debug|Win32
{55D063AA-8120-5F31-9A9B-9EAAB910FBCE}.Debug|x64.Build.0 = Debug|Win32
{55D063AA-8120-5F31-9A9B-9EAAB910FBCE}.Release|x64.ActiveCfg = Release|Win32
{55D063AA-8120-5F31-9A9B-9EAAB910FBCE}.Release|x64.Build.0 = Release|Win32
{EB4C03FC-1CDE-5062-81DE-5948B382F85A}.Debug|x64.ActiveCfg = Debug|Win32
{EB4C03FC-1CDE-5062-81DE-5948B382F85A}.Debug|x64.Build.0 = Debug|Win32
{EB4C03FC-1CDE-5062-81DE-5948B382F85A}.Release|x64.ActiveCfg = Release|Win32
{EB4C03FC-1CDE-5062-81DE-5948B382F85A}.Release|x64.Build.0 = Release|Win32
{955F593A-6BFC-57A3-9A34-5FE2F3F37ACA}.Debug|x64.ActiveCfg = Debug|Win32
{955F593A-6BFC-57A3-9A34-5FE2F3F37ACA}.Debug|x64.Build.0 = Debug|Win32
{955F593A-6BFC-57A3-9A34-5FE2F3F37ACA}.Release|x64.ActiveCfg = Release|Win32
{955F593A-6BFC-57A3-9A34-5FE2F3F37ACA}.Release|x64.Build.0 = Release|Win32
{0C46DDD5-781E-51B8-8057-1C82FFE1D96F}.Debug|x64.ActiveCfg = Debug|Win32
{0C46DDD5-781E-51B8-8057-1C82FFE1D96F}.Debug|x64.Build.0 = Debug|Win32
{0C46DDD5-781E-51B8-8057-1C82FFE1D96F}.Release|x64.ActiveCfg = Release|Win32
{0C46DDD5-781E-51B8-8057-1C82FFE1D96F}.Release|x64.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{54532B93-A2F9-49AC-886E-767A6D78E2F2} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{E888E99C-734D-44C4-B917-0AC8D3E2F48F} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{3E4018CE-CCA2-48E6-B11E-732A1B59C672} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{F094F967-42B5-4AD7-AB44-EA044CD9837E} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{89FF67C6-94C0-4C46-8411-7549A36584FB} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{F05F8C1B-7E23-4147-901E-AD91092E5752} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{EAC419E9-0C72-4625-B2B9-E879F697021A} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{9ADB61D3-FDFA-4A9C-A34F-663007BB70F6} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{BE34AA99-BEE6-4B50-B237-217E7C88FCB5} = {412816A5-9D22-4A30-BCDF-ABFB54BB3735} {BE34AA99-BEE6-4B50-B237-217E7C88FCB5} = {412816A5-9D22-4A30-BCDF-ABFB54BB3735}
{150FA82E-0E9F-4449-82A6-811BFFE6B5FE} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{54DD1412-20C0-4700-96D7-3FD445E70996} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{1ED2F590-1DE8-457D-97BD-38ECF0955F7F} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{BE980D05-770C-4420-B59B-EAD7A63468D2} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{3B05742A-6512-4B11-8842-A1B9D1465B1F} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{0BBEE569-536D-452C-808C-61843FECCC7E} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{A4F27C6F-601D-45C0-9F81-7C100BD93B9A} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{0CAD095A-C9F2-49FC-9C9F-4508498BE488} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{259FCEE5-3442-4076-9547-2BA793ECA1CB} = {412816A5-9D22-4A30-BCDF-ABFB54BB3735} {259FCEE5-3442-4076-9547-2BA793ECA1CB} = {412816A5-9D22-4A30-BCDF-ABFB54BB3735}
{23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2} = {412816A5-9D22-4A30-BCDF-ABFB54BB3735} {23CE3B73-FEE7-436C-9B4E-3DFB202EE9A2} = {412816A5-9D22-4A30-BCDF-ABFB54BB3735}
{DAB4634D-8145-4860-AE45-5198E76FF324} = {412816A5-9D22-4A30-BCDF-ABFB54BB3735} {DAB4634D-8145-4860-AE45-5198E76FF324} = {412816A5-9D22-4A30-BCDF-ABFB54BB3735}
{3227B3DB-D203-5485-98B4-0F3021AFB869} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{B51CFAB1-00F6-5EC0-B6E5-625D40631518} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{902B7939-6FD3-5819-97A6-E23AE3675834} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{3C57D63F-BD2A-5D8D-A2DF-8A94799343F7} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{8E878D65-5FB5-5E31-B389-A83E040C49EA} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{F48A5075-A26E-58D1-930B-8DBE88598338} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{61286863-AD9B-5805-8478-EA339E5F4005} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{DE1290DF-8EBF-5AD1-A07B-305C705892CE} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{DFA3136B-CE2F-5E5F-80FC-D395F3D72180} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{913FC307-267A-5D14-B00A-7721371AD4E2} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{F301F5EB-C33D-5BF2-BAAF-531F28AB3A49} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{55D063AA-8120-5F31-9A9B-9EAAB910FBCE} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{EB4C03FC-1CDE-5062-81DE-5948B382F85A} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{955F593A-6BFC-57A3-9A34-5FE2F3F37ACA} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
{0C46DDD5-781E-51B8-8057-1C82FFE1D96F} = {4E25CF88-D7D8-4A9C-A52E-0D78281E82EC}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0926DDCC-88CD-4839-A82D-D9B99E02A0B1} SolutionGuid = {0926DDCC-88CD-4839-A82D-D9B99E02A0B1}

View File

@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
@ -24,19 +16,6 @@
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType> <ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
@ -79,10 +58,10 @@
<ClInclude Include="..\include\toml++\toml_table.h" /> <ClInclude Include="..\include\toml++\toml_table.h" />
<ClInclude Include="..\include\toml++\toml_utf8.h" /> <ClInclude Include="..\include\toml++\toml_utf8.h" />
<ClInclude Include="..\include\toml++\toml_utf8_streams.h" /> <ClInclude Include="..\include\toml++\toml_utf8_streams.h" />
<ClInclude Include="..\include\toml++\toml_utf8_streams.hpp" />
<ClInclude Include="..\include\toml++\toml_value.h" /> <ClInclude Include="..\include\toml++\toml_value.h" />
<ClInclude Include="..\include\toml++\toml_instantiations.hpp" /> <ClInclude Include="..\include\toml++\toml_instantiations.hpp" />
<ClInclude Include="..\include\toml++\toml_version.h" /> <ClInclude Include="..\include\toml++\toml_version.h" />
<ClInclude Include="..\tests\settings.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\.editorconfig" /> <None Include="..\.editorconfig" />
@ -100,9 +79,13 @@
<None Include="..\python\generate_documentation.py" /> <None Include="..\python\generate_documentation.py" />
<None Include="..\python\generate_single_header.py" /> <None Include="..\python\generate_single_header.py" />
<None Include="..\python\generate_unicode_functions.py" /> <None Include="..\python\generate_unicode_functions.py" />
<None Include="..\python\generate_windows_test_targets.py" />
<None Include="..\python\utils.py" /> <None Include="..\python\utils.py" />
<None Include="..\README.md" /> <None Include="..\README.md" />
<None Include="toml++.props" /> <None Include="toml++.props" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project> </Project>

View File

@ -79,7 +79,7 @@
<ClInclude Include="..\include\toml++\toml_json_formatter.hpp"> <ClInclude Include="..\include\toml++\toml_json_formatter.hpp">
<Filter>include</Filter> <Filter>include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\tests\settings.h"> <ClInclude Include="..\include\toml++\toml_utf8_streams.hpp">
<Filter>include</Filter> <Filter>include</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
@ -124,6 +124,9 @@
</None> </None>
<None Include="..\.gitattributes" /> <None Include="..\.gitattributes" />
<None Include="..\.gitignore" /> <None Include="..\.gitignore" />
<None Include="..\python\generate_windows_test_targets.py">
<Filter>python</Filter>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Filter Include="include"> <Filter Include="include">
@ -136,4 +139,7 @@
<UniqueIdentifier>{5ed0949f-6855-4664-ad86-2b38ceeb400b}</UniqueIdentifier> <UniqueIdentifier>{5ed0949f-6855-4664-ad86-2b38ceeb400b}</UniqueIdentifier>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />
</ItemGroup>
</Project> </Project>

View File

@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
@ -25,19 +17,6 @@
<ProjectName>toml_generator</ProjectName> <ProjectName>toml_generator</ProjectName>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>

View File

@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
@ -25,19 +17,6 @@
<ProjectName>toml_to_json_transcoder</ProjectName> <ProjectName>toml_to_json_transcoder</ProjectName>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>