mirror of
https://github.com/marzer/tomlplusplus.git
synced 2024-09-04 14:09:11 +00:00
fixed incorrect clang+GCC flag in meson build script
also: - renamed `_impl.h` files to `*.inl` - simplified warning + namespace management boilerplate - applied clang-format to examples - bumped minimum required meson version to `0.54.0`
This commit is contained in:
parent
337aa82017
commit
7da912c45e
@ -16,8 +16,7 @@ using namespace std::string_view_literals;
|
||||
|
||||
namespace
|
||||
{
|
||||
inline constexpr auto invalid_parses = std::array
|
||||
{
|
||||
inline constexpr auto invalid_parses = std::array{
|
||||
"########## comments"sv,
|
||||
"# bar\rkek"sv,
|
||||
"# bar\bkek"sv,
|
||||
|
@ -14,8 +14,7 @@ using namespace std::string_view_literals;
|
||||
|
||||
namespace
|
||||
{
|
||||
inline constexpr auto words = std::array
|
||||
{
|
||||
inline constexpr auto words = std::array{
|
||||
"acceptable"sv, "contain"sv, "ghost"sv, "mark"sv, "respect"sv, "taboo"sv,
|
||||
"actually"sv, "cream"sv, "gleaming"sv, "meaty"sv, "rest"sv, "tacky"sv,
|
||||
"addition"sv, "creature"sv, "glorious"sv, "memory"sv, "rice"sv, "tank"sv,
|
||||
@ -53,38 +52,30 @@ namespace
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
[[nodiscard]]
|
||||
static T rand(T excl_max) noexcept
|
||||
[[nodiscard]] static T rand(T excl_max) noexcept
|
||||
{
|
||||
return static_cast<T>(static_cast<T>(std::rand()) % excl_max);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
[[nodiscard]]
|
||||
static T rand(T incl_min, T excl_max) noexcept
|
||||
[[nodiscard]] static T rand(T incl_min, T excl_max) noexcept
|
||||
{
|
||||
return static_cast<T>(incl_min + rand(excl_max - incl_min));
|
||||
}
|
||||
|
||||
static auto rand_date() noexcept
|
||||
{
|
||||
return toml::date
|
||||
{
|
||||
rand(uint16_t{ 1900 }, uint16_t{ 2021 }),
|
||||
return toml::date{ rand(uint16_t{ 1900 }, uint16_t{ 2021 }),
|
||||
rand(uint8_t{ 1 }, uint8_t{ 13 }),
|
||||
rand(uint8_t{ 1 }, uint8_t{ 29 })
|
||||
};
|
||||
rand(uint8_t{ 1 }, uint8_t{ 29 }) };
|
||||
}
|
||||
|
||||
static auto rand_time() noexcept
|
||||
{
|
||||
return toml::time
|
||||
{
|
||||
rand(uint8_t{ 24 }),
|
||||
return toml::time{ rand(uint8_t{ 24 }),
|
||||
rand(uint8_t{ 60 }),
|
||||
rand(uint8_t{ 60 }),
|
||||
rand(100) > 80 ? rand(1000000000u) : 0u
|
||||
};
|
||||
rand(100) > 80 ? rand(1000000000u) : 0u };
|
||||
}
|
||||
|
||||
static auto rand_string(size_t word_count, char sep = ' ') noexcept
|
||||
@ -142,10 +133,8 @@ int main(int argc, char** argv)
|
||||
{
|
||||
auto& table = tree.back()->ref<toml::table>();
|
||||
|
||||
const auto it = table.insert_or_assign(
|
||||
rand_string(rand<size_t>(1u, 4u), '-'),
|
||||
std::forward<value_ref>(val)
|
||||
);
|
||||
const auto it =
|
||||
table.insert_or_assign(rand_string(rand<size_t>(1u, 4u), '-'), std::forward<value_ref>(val));
|
||||
|
||||
new_node = &it.first->second;
|
||||
}
|
||||
@ -188,35 +177,24 @@ int main(int argc, char** argv)
|
||||
add(toml::array{});
|
||||
break;
|
||||
|
||||
case toml::node_type::string:
|
||||
add(rand_string(rand<size_t>(8u)));
|
||||
break;
|
||||
case toml::node_type::string: add(rand_string(rand<size_t>(8u))); break;
|
||||
|
||||
case toml::node_type::integer:
|
||||
add(rand());
|
||||
break;
|
||||
case toml::node_type::integer: add(rand()); break;
|
||||
|
||||
case toml::node_type::floating_point:
|
||||
add(rand(10001u) / 10000.0);
|
||||
break;
|
||||
case toml::node_type::floating_point: add(rand(10001u) / 10000.0); break;
|
||||
|
||||
case toml::node_type::boolean:
|
||||
add(!rand(2u));
|
||||
break;
|
||||
case toml::node_type::boolean: add(!rand(2u)); break;
|
||||
|
||||
case toml::node_type::date:
|
||||
add(rand_date());
|
||||
break;
|
||||
case toml::node_type::date: add(rand_date()); break;
|
||||
|
||||
case toml::node_type::time:
|
||||
add(rand_time());
|
||||
break;
|
||||
case toml::node_type::time: add(rand_time()); break;
|
||||
|
||||
case toml::node_type::date_time:
|
||||
add(rand(100) >= 75
|
||||
? toml::date_time{ rand_date(), rand_time() }
|
||||
: toml::date_time{ rand_date(), rand_time(), toml::time_offset{ rand<int8_t>(-11, 12), rand<int8_t>(-45, +46) } }
|
||||
);
|
||||
: toml::date_time{ rand_date(),
|
||||
rand_time(),
|
||||
toml::time_offset{ rand<int8_t>(-11, 12), rand<int8_t>(-45, +46) } });
|
||||
break;
|
||||
}
|
||||
if (container_min_values <= 0 && tree.size() >= 2u && rand(100) >= 85)
|
||||
|
@ -19,7 +19,6 @@ int main(int argc, char** argv)
|
||||
toml::table table;
|
||||
try
|
||||
{
|
||||
|
||||
// read from a file if a path argument is given
|
||||
if (argc > 1)
|
||||
table = toml::parse_file(argv[1]);
|
||||
|
@ -3,7 +3,6 @@
|
||||
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
/// \cond
|
||||
|
||||
//# {{
|
||||
#include "preprocessor.h"
|
||||
@ -17,16 +16,10 @@
|
||||
|
||||
TOML_ANON_NAMESPACE_START
|
||||
{
|
||||
#if !TOML_HEADER_ONLY
|
||||
using namespace toml;
|
||||
#endif
|
||||
|
||||
template <typename T, typename U>
|
||||
TOML_INTERNAL_LINKAGE
|
||||
bool array_is_homogeneous(T & elements, node_type ntype, U & first_nonmatch) noexcept
|
||||
{
|
||||
using namespace toml;
|
||||
|
||||
if (elements.empty())
|
||||
{
|
||||
first_nonmatch = {};
|
||||
@ -246,4 +239,3 @@ TOML_NAMESPACE_START
|
||||
TOML_NAMESPACE_END;
|
||||
|
||||
#include "header_end.h"
|
||||
/// \endcond
|
@ -3,7 +3,6 @@
|
||||
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
/// \cond
|
||||
|
||||
//# {{
|
||||
#include "preprocessor.h"
|
||||
@ -19,6 +18,7 @@
|
||||
#include "table.h"
|
||||
#include "array.h"
|
||||
#include "header_start.h"
|
||||
TOML_DISABLE_ARITHMETIC_WARNINGS;
|
||||
|
||||
TOML_NAMESPACE_START
|
||||
{
|
||||
@ -451,4 +451,3 @@ TOML_NAMESPACE_START
|
||||
TOML_NAMESPACE_END;
|
||||
|
||||
#include "header_end.h"
|
||||
/// \endcond
|
@ -3,7 +3,6 @@
|
||||
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
/// \cond
|
||||
|
||||
//# {{
|
||||
#include "preprocessor.h"
|
||||
@ -230,4 +229,3 @@ TOML_IMPL_NAMESPACE_START
|
||||
TOML_IMPL_NAMESPACE_END;
|
||||
|
||||
#include "header_end.h"
|
||||
/// \endcond
|
@ -3,7 +3,6 @@
|
||||
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
/// \cond
|
||||
|
||||
//# {{
|
||||
#include "preprocessor.h"
|
||||
@ -109,4 +108,3 @@ TOML_NAMESPACE_START
|
||||
TOML_NAMESPACE_END;
|
||||
|
||||
#include "header_end.h"
|
||||
/// \endcond
|
@ -3,7 +3,6 @@
|
||||
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
/// \cond
|
||||
|
||||
//# {{
|
||||
#include "preprocessor.h"
|
||||
@ -56,4 +55,3 @@ TOML_NAMESPACE_START
|
||||
TOML_NAMESPACE_END;
|
||||
|
||||
#include "header_end.h"
|
||||
/// \endcond
|
@ -8,6 +8,7 @@
|
||||
#include "node.h"
|
||||
#include "std_vector.h"
|
||||
#include "header_start.h"
|
||||
TOML_DISABLE_ARITHMETIC_WARNINGS;
|
||||
|
||||
TOML_NAMESPACE_START
|
||||
{
|
||||
|
@ -3,7 +3,6 @@
|
||||
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
/// \cond
|
||||
|
||||
//# {{
|
||||
#include "preprocessor.h"
|
||||
@ -75,4 +74,3 @@ TOML_NAMESPACE_END;
|
||||
|
||||
#include "header_end.h"
|
||||
#endif // TOML_EXTERN_TEMPLATES
|
||||
/// \endcond
|
@ -11,7 +11,6 @@
|
||||
#include "source_region.h"
|
||||
#include "print_to_stream.h"
|
||||
#include "header_start.h"
|
||||
TOML_DISABLE_INIT_WARNINGS;
|
||||
|
||||
#if defined(DOXYGEN) || !TOML_EXCEPTIONS
|
||||
#define TOML_PARSE_ERROR_BASE
|
||||
|
@ -3,7 +3,6 @@
|
||||
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
/// \cond
|
||||
|
||||
#include "preprocessor.h"
|
||||
//# {{
|
||||
@ -43,10 +42,6 @@ TOML_ENABLE_WARNINGS;
|
||||
|
||||
TOML_ANON_NAMESPACE_START
|
||||
{
|
||||
#if !TOML_HEADER_ONLY
|
||||
using namespace toml;
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
class utf8_byte_stream;
|
||||
|
||||
@ -186,13 +181,6 @@ TOML_ANON_NAMESPACE_START
|
||||
return bytes[3] ? std::string_view{ bytes, 4_sz } : std::string_view{ bytes };
|
||||
}
|
||||
|
||||
TOML_NODISCARD
|
||||
TOML_ATTR(pure)
|
||||
constexpr operator char32_t&() noexcept
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
TOML_NODISCARD
|
||||
TOML_ATTR(pure)
|
||||
constexpr operator const char32_t&() const noexcept
|
||||
@ -3665,4 +3653,3 @@ TOML_NAMESPACE_END;
|
||||
|
||||
#include "header_end.h"
|
||||
#endif // TOML_PARSER
|
||||
/// \endcond
|
@ -66,25 +66,18 @@
|
||||
_Pragma("clang diagnostic ignored \"-Wswitch\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_INIT_WARNINGS \
|
||||
_Pragma("clang diagnostic ignored \"-Wmissing-field-initializers\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_ARITHMETIC_WARNINGS \
|
||||
_Pragma("clang diagnostic ignored \"-Wfloat-equal\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wdouble-promotion\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wchar-subscripts\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wshift-sign-overflow\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_SHADOW_WARNINGS \
|
||||
_Pragma("clang diagnostic ignored \"-Wshadow\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wshadow-field\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_SPAM_WARNINGS \
|
||||
_Pragma("clang diagnostic ignored \"-Wweak-vtables\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wweak-template-vtables\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wdouble-promotion\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wchar-subscripts\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wmissing-field-initializers\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wpadded\"") \
|
||||
static_assert(true)
|
||||
|
||||
@ -281,20 +274,9 @@
|
||||
_Pragma("GCC diagnostic ignored \"-Wswitch-default\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_INIT_WARNINGS \
|
||||
_Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wuninitialized\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_ARITHMETIC_WARNINGS \
|
||||
_Pragma("GCC diagnostic ignored \"-Wfloat-equal\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wsign-conversion\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wchar-subscripts\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_SHADOW_WARNINGS \
|
||||
_Pragma("GCC diagnostic ignored \"-Wshadow\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_SPAM_WARNINGS \
|
||||
@ -303,6 +285,10 @@
|
||||
_Pragma("GCC diagnostic ignored \"-Wcomment\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wtype-limits\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wuseless-cast\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wchar-subscripts\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wsubobject-linkage\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=pure\"") \
|
||||
static_assert(true)
|
||||
@ -317,9 +303,7 @@
|
||||
_Pragma("GCC diagnostic ignored \"-Wextra\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
|
||||
TOML_DISABLE_SWITCH_WARNINGS; \
|
||||
TOML_DISABLE_INIT_WARNINGS; \
|
||||
TOML_DISABLE_ARITHMETIC_WARNINGS; \
|
||||
TOML_DISABLE_SHADOW_WARNINGS; \
|
||||
TOML_DISABLE_SPAM_WARNINGS; \
|
||||
static_assert(true)
|
||||
|
||||
@ -504,18 +488,12 @@
|
||||
#ifndef TOML_DISABLE_SWITCH_WARNINGS
|
||||
#define TOML_DISABLE_SWITCH_WARNINGS static_assert(true)
|
||||
#endif
|
||||
#ifndef TOML_DISABLE_INIT_WARNINGS
|
||||
#define TOML_DISABLE_INIT_WARNINGS static_assert(true)
|
||||
#endif
|
||||
#ifndef TOML_DISABLE_SPAM_WARNINGS
|
||||
#define TOML_DISABLE_SPAM_WARNINGS static_assert(true)
|
||||
#endif
|
||||
#ifndef TOML_DISABLE_ARITHMETIC_WARNINGS
|
||||
#define TOML_DISABLE_ARITHMETIC_WARNINGS static_assert(true)
|
||||
#endif
|
||||
#ifndef TOML_DISABLE_SHADOW_WARNINGS
|
||||
#define TOML_DISABLE_SHADOW_WARNINGS static_assert(true)
|
||||
#endif
|
||||
#ifndef TOML_POP_WARNINGS
|
||||
#define TOML_POP_WARNINGS static_assert(true)
|
||||
#endif
|
||||
@ -774,17 +752,15 @@
|
||||
#define TOML_IMPL_NAMESPACE_START TOML_NAMESPACE_START { namespace impl
|
||||
#define TOML_IMPL_NAMESPACE_END } TOML_NAMESPACE_END
|
||||
#if TOML_HEADER_ONLY
|
||||
#define TOML_ANON_NAMESPACE_START TOML_IMPL_NAMESPACE_START
|
||||
#define TOML_ANON_NAMESPACE_START static_assert(TOML_IMPLEMENTATION); TOML_IMPL_NAMESPACE_START
|
||||
#define TOML_ANON_NAMESPACE_END TOML_IMPL_NAMESPACE_END
|
||||
#define TOML_ANON_NAMESPACE TOML_NAMESPACE::impl
|
||||
#define TOML_USING_ANON_NAMESPACE using namespace TOML_ANON_NAMESPACE
|
||||
#define TOML_EXTERNAL_LINKAGE inline
|
||||
#define TOML_INTERNAL_LINKAGE inline
|
||||
#else
|
||||
#define TOML_ANON_NAMESPACE_START namespace
|
||||
#define TOML_ANON_NAMESPACE_START static_assert(TOML_IMPLEMENTATION); using namespace toml; namespace
|
||||
#define TOML_ANON_NAMESPACE_END static_assert(true)
|
||||
#define TOML_ANON_NAMESPACE
|
||||
#define TOML_USING_ANON_NAMESPACE static_cast<void>(0)
|
||||
#define TOML_EXTERNAL_LINKAGE
|
||||
#define TOML_INTERNAL_LINKAGE static
|
||||
#endif
|
||||
|
@ -3,7 +3,6 @@
|
||||
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
/// \cond
|
||||
|
||||
//# {{
|
||||
#include "preprocessor.h"
|
||||
@ -35,10 +34,6 @@ TOML_ENABLE_WARNINGS;
|
||||
|
||||
TOML_ANON_NAMESPACE_START
|
||||
{
|
||||
#if !TOML_HEADER_ONLY
|
||||
using namespace toml;
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
inline constexpr size_t charconv_buffer_length = 0;
|
||||
|
||||
@ -76,8 +71,6 @@ TOML_ANON_NAMESPACE_START
|
||||
TOML_INTERNAL_LINKAGE
|
||||
void print_integer_to_stream(std::ostream & stream, T val, value_flags format = {})
|
||||
{
|
||||
using namespace toml;
|
||||
|
||||
if (!val)
|
||||
{
|
||||
stream.put('0');
|
||||
@ -138,7 +131,7 @@ TOML_ANON_NAMESPACE_START
|
||||
ss << std::uppercase << std::setbase(base);
|
||||
ss << static_cast<cast_type>(val);
|
||||
const auto str = std::move(ss).str();
|
||||
impl::print_to_stream(str, stream);
|
||||
impl::print_to_stream(stream, str);
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -148,8 +141,6 @@ TOML_ANON_NAMESPACE_START
|
||||
TOML_INTERNAL_LINKAGE
|
||||
void print_floating_point_to_stream(std::ostream & stream, T val, value_flags format = {})
|
||||
{
|
||||
using namespace toml;
|
||||
|
||||
switch (impl::fpclassify(val))
|
||||
{
|
||||
case impl::fp_class::neg_inf: impl::print_to_stream(stream, "-inf"sv); break;
|
||||
@ -204,8 +195,6 @@ TOML_ANON_NAMESPACE_START
|
||||
TOML_INTERNAL_LINKAGE
|
||||
void print_integer_leftpad_zeros(std::ostream & stream, T val, size_t min_digits)
|
||||
{
|
||||
using namespace toml;
|
||||
|
||||
#if TOML_INT_CHARCONV
|
||||
|
||||
char buf[charconv_buffer_length<T>];
|
||||
@ -471,4 +460,3 @@ TOML_IMPL_NAMESPACE_START
|
||||
TOML_IMPL_NAMESPACE_END;
|
||||
|
||||
#include "header_end.h"
|
||||
/// \endcond
|
@ -3,7 +3,6 @@
|
||||
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
/// \cond
|
||||
|
||||
//# {{
|
||||
#include "preprocessor.h"
|
||||
@ -99,4 +98,3 @@ TOML_IMPL_NAMESPACE_END;
|
||||
|
||||
#include "header_end.h"
|
||||
#endif // TOML_WINDOWS_COMPAT
|
||||
/// \endcond
|
@ -3,7 +3,6 @@
|
||||
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
/// \cond
|
||||
|
||||
//# {{
|
||||
#include "preprocessor.h"
|
||||
@ -18,16 +17,10 @@
|
||||
|
||||
TOML_ANON_NAMESPACE_START
|
||||
{
|
||||
#if !TOML_HEADER_ONLY
|
||||
using namespace toml;
|
||||
#endif
|
||||
|
||||
template <typename T, typename U>
|
||||
TOML_INTERNAL_LINKAGE
|
||||
bool table_is_homogeneous(T & map, node_type ntype, U & first_nonmatch) noexcept
|
||||
{
|
||||
using namespace toml;
|
||||
|
||||
if (map.empty())
|
||||
{
|
||||
first_nonmatch = {};
|
||||
@ -174,4 +167,3 @@ TOML_NAMESPACE_START
|
||||
TOML_NAMESPACE_END;
|
||||
|
||||
#include "header_end.h"
|
||||
/// \endcond
|
@ -7,6 +7,7 @@
|
||||
#include "node.h"
|
||||
#include "print_to_stream.h"
|
||||
#include "header_start.h"
|
||||
TOML_DISABLE_ARITHMETIC_WARNINGS;
|
||||
|
||||
/// \cond
|
||||
// clang-format off
|
||||
|
@ -3,7 +3,6 @@
|
||||
//# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
|
||||
// SPDX-License-Identifier: MIT
|
||||
#pragma once
|
||||
/// \cond
|
||||
|
||||
//# {{
|
||||
#include "preprocessor.h"
|
||||
@ -78,4 +77,3 @@ TOML_NAMESPACE_END;
|
||||
|
||||
#include "header_end.h"
|
||||
#endif // TOML_EXTERN_TEMPLATES
|
||||
/// \endcond
|
@ -12,12 +12,12 @@
|
||||
|
||||
#include "impl/preprocessor.h"
|
||||
|
||||
//# {{
|
||||
TOML_PUSH_WARNINGS;
|
||||
#if TOML_MSVC
|
||||
#pragma warning(disable : 5031) // #pragma warning(pop): likely mismatch
|
||||
#pragma warning(disable : 5031) // #pragma warning(pop): likely mismatch (false-positive)
|
||||
#elif TOML_CLANG && !TOML_HEADER_ONLY && TOML_IMPLEMENTATION
|
||||
#pragma clang diagnostic ignored "-Wheader-hygiene" // false-positive
|
||||
#endif
|
||||
//# }}
|
||||
|
||||
#include "impl/std_new.h"
|
||||
#include "impl/std_string.h"
|
||||
@ -41,22 +41,22 @@ TOML_PUSH_WARNINGS;
|
||||
#include "impl/json_formatter.h"
|
||||
|
||||
#if TOML_IMPLEMENTATION
|
||||
#include "impl/std_string_impl.h"
|
||||
#include "impl/print_to_stream_impl.h"
|
||||
#include "impl/node_impl.h"
|
||||
#include "impl/node_view_impl.h"
|
||||
#include "impl/value_impl.h"
|
||||
#include "impl/array_impl.h"
|
||||
#include "impl/table_impl.h"
|
||||
#include "impl/parser_impl.h"
|
||||
#include "impl/formatter_impl.h"
|
||||
#include "impl/default_formatter_impl.h"
|
||||
#include "impl/json_formatter_impl.h"
|
||||
|
||||
#include "impl/std_string.inl"
|
||||
#include "impl/print_to_stream.inl"
|
||||
#include "impl/node.inl"
|
||||
#include "impl/node_view.inl"
|
||||
#include "impl/value.inl"
|
||||
#include "impl/array.inl"
|
||||
#include "impl/table.inl"
|
||||
#include "impl/parser.inl"
|
||||
#include "impl/formatter.inl"
|
||||
#include "impl/default_formatter.inl"
|
||||
#include "impl/json_formatter.inl"
|
||||
|
||||
#endif // TOML_IMPLEMENTATION
|
||||
|
||||
//# {{
|
||||
TOML_POP_WARNINGS;
|
||||
//# }}
|
||||
|
||||
// macro hygiene
|
||||
#if TOML_UNDEF_MACROS
|
||||
@ -83,8 +83,6 @@ TOML_POP_WARNINGS;
|
||||
#undef TOML_CPP
|
||||
#undef TOML_DISABLE_ARITHMETIC_WARNINGS
|
||||
#undef TOML_DISABLE_CODE_ANALYSIS_WARNINGS
|
||||
#undef TOML_DISABLE_INIT_WARNINGS
|
||||
#undef TOML_DISABLE_SHADOW_WARNINGS
|
||||
#undef TOML_DISABLE_SPAM_WARNINGS
|
||||
#undef TOML_DISABLE_SUGGEST_WARNINGS
|
||||
#undef TOML_DISABLE_SWITCH_WARNINGS
|
||||
@ -156,7 +154,6 @@ TOML_POP_WARNINGS;
|
||||
#undef TOML_UINT128
|
||||
#undef TOML_UNLIKELY
|
||||
#undef TOML_UNREACHABLE
|
||||
#undef TOML_USING_ANON_NAMESPACE
|
||||
#endif
|
||||
|
||||
#endif // TOMLPLUSPLUS_H
|
||||
|
@ -2,7 +2,7 @@ project(
|
||||
'tomlplusplus',
|
||||
'cpp',
|
||||
version: '3.0.0',
|
||||
meson_version: '>=0.53.0',
|
||||
meson_version: '>=0.54.0',
|
||||
license: 'MIT',
|
||||
default_options: [ # https://mesonbuild.com/Builtin-options.html
|
||||
# core options
|
||||
@ -62,7 +62,7 @@ if is_gcc or is_clang
|
||||
add_project_arguments(
|
||||
'-march=native',
|
||||
'-fvisibility=hidden',
|
||||
'-fvisility-inlines-hidden',
|
||||
'-fvisibility-inlines-hidden',
|
||||
language: 'cpp'
|
||||
)
|
||||
if is_release
|
||||
@ -508,9 +508,7 @@ tomlplusplus_dep = declare_dependency(
|
||||
version: meson.project_version(),
|
||||
)
|
||||
|
||||
if meson.version().version_compare('>=0.54.0')
|
||||
meson.override_dependency('tomlplusplus', tomlplusplus_dep)
|
||||
endif
|
||||
|
||||
if not is_subproject
|
||||
import('pkgconfig').generate(
|
||||
|
@ -4,7 +4,6 @@ test_sources = [
|
||||
'conformance_iarna_invalid.cpp',
|
||||
'conformance_iarna_valid.cpp',
|
||||
'impl_toml.cpp',
|
||||
'impl_catch2.cpp',
|
||||
'tests.cpp',
|
||||
'parsing_floats.cpp',
|
||||
'parsing_arrays.cpp',
|
||||
@ -16,6 +15,7 @@ test_sources = [
|
||||
'parsing_spec_example.cpp',
|
||||
'parsing_strings.cpp',
|
||||
'parsing_tables.cpp',
|
||||
'main.cpp',
|
||||
'manipulating_arrays.cpp',
|
||||
'manipulating_tables.cpp',
|
||||
'manipulating_values.cpp',
|
||||
|
@ -4,8 +4,7 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.h"
|
||||
|
||||
TOML_DISABLE_INIT_WARNINGS;
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
|
||||
TEST_CASE("parsing - dates and times")
|
||||
{
|
||||
@ -42,8 +41,7 @@ TEST_CASE("parsing - dates and times")
|
||||
CHECK(tbl["lt1"] == lt1);
|
||||
static constexpr auto lt2 = toml::time{ 0, 32, 0, 999999000u };
|
||||
CHECK(tbl["lt2"] == lt2);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// value tests
|
||||
parse_expected_value(FILE_LINE_ARGS, "1987-03-16"sv, date{ 1987, 3, 16 });
|
||||
@ -141,7 +139,6 @@ TEST_CASE("parsing - dates and times")
|
||||
parsing_should_fail(FILE_LINE_ARGS, "1987-03-16T10:20Z"sv);
|
||||
parsing_should_fail(FILE_LINE_ARGS, "1987-03-16 10:20Z"sv);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// eof tests
|
||||
|
@ -4,9 +4,7 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#include "tests.h"
|
||||
|
||||
TOML_PUSH_WARNINGS;
|
||||
TOML_DISABLE_INIT_WARNINGS;
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
|
||||
TEST_CASE("parsing - TOML spec example")
|
||||
{
|
||||
@ -46,8 +44,7 @@ TEST_CASE("parsing - TOML spec example")
|
||||
]
|
||||
)"sv;
|
||||
|
||||
parsing_should_succeed(
|
||||
FILE_LINE_ARGS,
|
||||
parsing_should_succeed(FILE_LINE_ARGS,
|
||||
toml_text,
|
||||
[](table&& tbl)
|
||||
{
|
||||
@ -91,8 +88,5 @@ TEST_CASE("parsing - TOML spec example")
|
||||
CHECK(tbl["clients"]["hosts"].as<array>()->size() == 2);
|
||||
CHECK(tbl["clients"]["hosts"][0] == "alpha"sv);
|
||||
CHECK(tbl["clients"]["hosts"][1] == "omega"sv);
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
TOML_POP_WARNINGS;
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -76,10 +76,10 @@
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
@ -36,29 +36,29 @@
|
||||
<Import Project="$(ProjectDir)\toml++.props" />
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\toml++\impl\array.h" />
|
||||
<ClInclude Include="include\toml++\impl\array_impl.h" />
|
||||
<ClInclude Include="include\toml++\impl\array.inl" />
|
||||
<ClInclude Include="include\toml++\impl\date_time.h" />
|
||||
<ClInclude Include="include\toml++\impl\default_formatter.h" />
|
||||
<ClInclude Include="include\toml++\impl\default_formatter_impl.h" />
|
||||
<ClInclude Include="include\toml++\impl\default_formatter.inl" />
|
||||
<ClInclude Include="include\toml++\impl\formatter.h" />
|
||||
<ClInclude Include="include\toml++\impl\formatter_impl.h" />
|
||||
<ClInclude Include="include\toml++\impl\formatter.inl" />
|
||||
<ClInclude Include="include\toml++\impl\forward_declarations.h" />
|
||||
<ClInclude Include="include\toml++\impl\header_end.h" />
|
||||
<ClInclude Include="include\toml++\impl\header_start.h" />
|
||||
<ClInclude Include="include\toml++\impl\json_formatter.h" />
|
||||
<ClInclude Include="include\toml++\impl\json_formatter_impl.h" />
|
||||
<ClInclude Include="include\toml++\impl\json_formatter.inl" />
|
||||
<ClInclude Include="include\toml++\impl\make_node.h" />
|
||||
<ClInclude Include="include\toml++\impl\node.h" />
|
||||
<ClInclude Include="include\toml++\impl\node_impl.h" />
|
||||
<ClInclude Include="include\toml++\impl\node.inl" />
|
||||
<ClInclude Include="include\toml++\impl\node_view.h" />
|
||||
<ClInclude Include="include\toml++\impl\node_view_impl.h" />
|
||||
<ClInclude Include="include\toml++\impl\node_view.inl" />
|
||||
<ClInclude Include="include\toml++\impl\parse_error.h" />
|
||||
<ClInclude Include="include\toml++\impl\parse_result.h" />
|
||||
<ClInclude Include="include\toml++\impl\parser.h" />
|
||||
<ClInclude Include="include\toml++\impl\parser_impl.h" />
|
||||
<ClInclude Include="include\toml++\impl\parser.inl" />
|
||||
<ClInclude Include="include\toml++\impl\preprocessor.h" />
|
||||
<ClInclude Include="include\toml++\impl\print_to_stream.h" />
|
||||
<ClInclude Include="include\toml++\impl\print_to_stream_impl.h" />
|
||||
<ClInclude Include="include\toml++\impl\print_to_stream.inl" />
|
||||
<ClInclude Include="include\toml++\impl\source_region.h" />
|
||||
<ClInclude Include="include\toml++\impl\std_except.h" />
|
||||
<ClInclude Include="include\toml++\impl\std_map.h" />
|
||||
@ -67,12 +67,12 @@
|
||||
<ClInclude Include="include\toml++\impl\std_string.h" />
|
||||
<ClInclude Include="include\toml++\impl\std_vector.h" />
|
||||
<ClInclude Include="include\toml++\impl\table.h" />
|
||||
<ClInclude Include="include\toml++\impl\table_impl.h" />
|
||||
<ClInclude Include="include\toml++\impl\table.inl" />
|
||||
<ClInclude Include="include\toml++\impl\utf8.h" />
|
||||
<ClInclude Include="include\toml++\impl\value.h" />
|
||||
<ClInclude Include="include\toml++\impl\value_impl.h" />
|
||||
<ClInclude Include="include\toml++\impl\value.inl" />
|
||||
<ClInclude Include="include\toml++\impl\version.h" />
|
||||
<ClInclude Include="include\toml++\impl\std_string_impl.h" />
|
||||
<ClInclude Include="include\toml++\impl\std_string.inl" />
|
||||
<ClInclude Include="include\toml++\toml.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -97,6 +97,7 @@
|
||||
<None Include="meson.build" />
|
||||
<None Include="toml++.props" />
|
||||
<None Include="tools\ci_single_header_check.py" />
|
||||
<None Include="tools\clang_format.bat" />
|
||||
<None Include="tools\generate_conformance_tests.py" />
|
||||
<None Include="tools\generate_single_header.py" />
|
||||
<None Include="tools\generate_windows_test_targets.py" />
|
||||
|
@ -7,7 +7,7 @@
|
||||
<ClInclude Include="include\toml++\impl\array.h">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\array_impl.h">
|
||||
<ClInclude Include="include\toml++\impl\array.inl">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\date_time.h">
|
||||
@ -16,7 +16,7 @@
|
||||
<ClInclude Include="include\toml++\impl\default_formatter.h">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\default_formatter_impl.h">
|
||||
<ClInclude Include="include\toml++\impl\default_formatter.inl">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\formatter.h">
|
||||
@ -25,13 +25,13 @@
|
||||
<ClInclude Include="include\toml++\impl\json_formatter.h">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\json_formatter_impl.h">
|
||||
<ClInclude Include="include\toml++\impl\json_formatter.inl">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\node.h">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\node_impl.h">
|
||||
<ClInclude Include="include\toml++\impl\node.inl">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\node_view.h">
|
||||
@ -46,7 +46,7 @@
|
||||
<ClInclude Include="include\toml++\impl\parser.h">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\parser_impl.h">
|
||||
<ClInclude Include="include\toml++\impl\parser.inl">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\preprocessor.h">
|
||||
@ -58,7 +58,7 @@
|
||||
<ClInclude Include="include\toml++\impl\table.h">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\table_impl.h">
|
||||
<ClInclude Include="include\toml++\impl\table.inl">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\utf8.h">
|
||||
@ -103,19 +103,19 @@
|
||||
<ClInclude Include="include\toml++\impl\std_new.h">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\std_string_impl.h">
|
||||
<ClInclude Include="include\toml++\impl\std_string.inl">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\print_to_stream_impl.h">
|
||||
<ClInclude Include="include\toml++\impl\print_to_stream.inl">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\formatter_impl.h">
|
||||
<ClInclude Include="include\toml++\impl\formatter.inl">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\node_view_impl.h">
|
||||
<ClInclude Include="include\toml++\impl\node_view.inl">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\toml++\impl\value_impl.h">
|
||||
<ClInclude Include="include\toml++\impl\value.inl">
|
||||
<Filter>include\impl</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
@ -171,6 +171,9 @@
|
||||
</None>
|
||||
<None Include=".clang-format" />
|
||||
<None Include=".editorconfig" />
|
||||
<None Include="tools\clang_format.bat">
|
||||
<Filter>tools</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include=".circleci">
|
||||
|
116
toml.hpp
116
toml.hpp
@ -102,25 +102,18 @@
|
||||
_Pragma("clang diagnostic ignored \"-Wswitch\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_INIT_WARNINGS \
|
||||
_Pragma("clang diagnostic ignored \"-Wmissing-field-initializers\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_ARITHMETIC_WARNINGS \
|
||||
_Pragma("clang diagnostic ignored \"-Wfloat-equal\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wdouble-promotion\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wchar-subscripts\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wshift-sign-overflow\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_SHADOW_WARNINGS \
|
||||
_Pragma("clang diagnostic ignored \"-Wshadow\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wshadow-field\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_SPAM_WARNINGS \
|
||||
_Pragma("clang diagnostic ignored \"-Wweak-vtables\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wweak-template-vtables\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wdouble-promotion\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wchar-subscripts\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wmissing-field-initializers\"") \
|
||||
_Pragma("clang diagnostic ignored \"-Wpadded\"") \
|
||||
static_assert(true)
|
||||
|
||||
@ -305,20 +298,9 @@
|
||||
_Pragma("GCC diagnostic ignored \"-Wswitch-default\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_INIT_WARNINGS \
|
||||
_Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wuninitialized\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_ARITHMETIC_WARNINGS \
|
||||
_Pragma("GCC diagnostic ignored \"-Wfloat-equal\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wsign-conversion\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wchar-subscripts\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_SHADOW_WARNINGS \
|
||||
_Pragma("GCC diagnostic ignored \"-Wshadow\"") \
|
||||
static_assert(true)
|
||||
|
||||
#define TOML_DISABLE_SPAM_WARNINGS \
|
||||
@ -327,6 +309,10 @@
|
||||
_Pragma("GCC diagnostic ignored \"-Wcomment\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wtype-limits\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wuseless-cast\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wchar-subscripts\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wsubobject-linkage\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wsuggest-attribute=pure\"") \
|
||||
static_assert(true)
|
||||
@ -341,9 +327,7 @@
|
||||
_Pragma("GCC diagnostic ignored \"-Wextra\"") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
|
||||
TOML_DISABLE_SWITCH_WARNINGS; \
|
||||
TOML_DISABLE_INIT_WARNINGS; \
|
||||
TOML_DISABLE_ARITHMETIC_WARNINGS; \
|
||||
TOML_DISABLE_SHADOW_WARNINGS; \
|
||||
TOML_DISABLE_SPAM_WARNINGS; \
|
||||
static_assert(true)
|
||||
|
||||
@ -519,18 +503,12 @@
|
||||
#ifndef TOML_DISABLE_SWITCH_WARNINGS
|
||||
#define TOML_DISABLE_SWITCH_WARNINGS static_assert(true)
|
||||
#endif
|
||||
#ifndef TOML_DISABLE_INIT_WARNINGS
|
||||
#define TOML_DISABLE_INIT_WARNINGS static_assert(true)
|
||||
#endif
|
||||
#ifndef TOML_DISABLE_SPAM_WARNINGS
|
||||
#define TOML_DISABLE_SPAM_WARNINGS static_assert(true)
|
||||
#endif
|
||||
#ifndef TOML_DISABLE_ARITHMETIC_WARNINGS
|
||||
#define TOML_DISABLE_ARITHMETIC_WARNINGS static_assert(true)
|
||||
#endif
|
||||
#ifndef TOML_DISABLE_SHADOW_WARNINGS
|
||||
#define TOML_DISABLE_SHADOW_WARNINGS static_assert(true)
|
||||
#endif
|
||||
#ifndef TOML_POP_WARNINGS
|
||||
#define TOML_POP_WARNINGS static_assert(true)
|
||||
#endif
|
||||
@ -782,17 +760,15 @@
|
||||
#define TOML_IMPL_NAMESPACE_START TOML_NAMESPACE_START { namespace impl
|
||||
#define TOML_IMPL_NAMESPACE_END } TOML_NAMESPACE_END
|
||||
#if TOML_HEADER_ONLY
|
||||
#define TOML_ANON_NAMESPACE_START TOML_IMPL_NAMESPACE_START
|
||||
#define TOML_ANON_NAMESPACE_START static_assert(TOML_IMPLEMENTATION); TOML_IMPL_NAMESPACE_START
|
||||
#define TOML_ANON_NAMESPACE_END TOML_IMPL_NAMESPACE_END
|
||||
#define TOML_ANON_NAMESPACE TOML_NAMESPACE::impl
|
||||
#define TOML_USING_ANON_NAMESPACE using namespace TOML_ANON_NAMESPACE
|
||||
#define TOML_EXTERNAL_LINKAGE inline
|
||||
#define TOML_INTERNAL_LINKAGE inline
|
||||
#else
|
||||
#define TOML_ANON_NAMESPACE_START namespace
|
||||
#define TOML_ANON_NAMESPACE_START static_assert(TOML_IMPLEMENTATION); using namespace toml; namespace
|
||||
#define TOML_ANON_NAMESPACE_END static_assert(true)
|
||||
#define TOML_ANON_NAMESPACE
|
||||
#define TOML_USING_ANON_NAMESPACE static_cast<void>(0)
|
||||
#define TOML_EXTERNAL_LINKAGE
|
||||
#define TOML_INTERNAL_LINKAGE static
|
||||
#endif
|
||||
@ -861,6 +837,13 @@ TOML_ENABLE_WARNINGS;
|
||||
|
||||
// clang-format on
|
||||
|
||||
TOML_PUSH_WARNINGS;
|
||||
#if TOML_MSVC
|
||||
#pragma warning(disable : 5031) // #pragma warning(pop): likely mismatch (false-positive)
|
||||
#elif TOML_CLANG && !TOML_HEADER_ONLY && TOML_IMPLEMENTATION
|
||||
#pragma clang diagnostic ignored "-Wheader-hygiene" // false-positive
|
||||
#endif
|
||||
|
||||
//******** impl/std_new.h ********************************************************************************************
|
||||
|
||||
TOML_DISABLE_WARNINGS;
|
||||
@ -2864,6 +2847,7 @@ TOML_ENABLE_WARNINGS;
|
||||
TOML_PUSH_WARNINGS;
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
TOML_DISABLE_SWITCH_WARNINGS;
|
||||
TOML_DISABLE_ARITHMETIC_WARNINGS;
|
||||
|
||||
TOML_NAMESPACE_START
|
||||
{
|
||||
@ -3371,6 +3355,7 @@ TOML_POP_WARNINGS;
|
||||
TOML_PUSH_WARNINGS;
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
TOML_DISABLE_SWITCH_WARNINGS;
|
||||
TOML_DISABLE_ARITHMETIC_WARNINGS;
|
||||
|
||||
// clang-format off
|
||||
|
||||
@ -6891,8 +6876,6 @@ TOML_PUSH_WARNINGS;
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
TOML_DISABLE_SWITCH_WARNINGS;
|
||||
|
||||
TOML_DISABLE_INIT_WARNINGS;
|
||||
|
||||
#if defined(DOXYGEN) || !TOML_EXCEPTIONS
|
||||
#define TOML_PARSE_ERROR_BASE
|
||||
#else
|
||||
@ -7680,7 +7663,7 @@ TOML_POP_WARNINGS;
|
||||
|
||||
#if TOML_IMPLEMENTATION
|
||||
|
||||
//******** impl/std_string_impl.h ************************************************************************************
|
||||
//******** impl/std_string.inl ***************************************************************************************
|
||||
|
||||
#if TOML_WINDOWS_COMPAT
|
||||
|
||||
@ -7773,7 +7756,7 @@ TOML_POP_WARNINGS;
|
||||
|
||||
#endif // TOML_WINDOWS_COMPAT
|
||||
|
||||
//******** impl/print_to_stream_impl.h *******************************************************************************
|
||||
//******** impl/print_to_stream.inl **********************************************************************************
|
||||
|
||||
TOML_DISABLE_WARNINGS;
|
||||
#include <ostream>
|
||||
@ -7794,10 +7777,6 @@ TOML_DISABLE_SWITCH_WARNINGS;
|
||||
|
||||
TOML_ANON_NAMESPACE_START
|
||||
{
|
||||
#if !TOML_HEADER_ONLY
|
||||
using namespace toml;
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
inline constexpr size_t charconv_buffer_length = 0;
|
||||
|
||||
@ -7835,8 +7814,6 @@ TOML_ANON_NAMESPACE_START
|
||||
TOML_INTERNAL_LINKAGE
|
||||
void print_integer_to_stream(std::ostream & stream, T val, value_flags format = {})
|
||||
{
|
||||
using namespace toml;
|
||||
|
||||
if (!val)
|
||||
{
|
||||
stream.put('0');
|
||||
@ -7897,7 +7874,7 @@ TOML_ANON_NAMESPACE_START
|
||||
ss << std::uppercase << std::setbase(base);
|
||||
ss << static_cast<cast_type>(val);
|
||||
const auto str = std::move(ss).str();
|
||||
impl::print_to_stream(str, stream);
|
||||
impl::print_to_stream(stream, str);
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -7907,8 +7884,6 @@ TOML_ANON_NAMESPACE_START
|
||||
TOML_INTERNAL_LINKAGE
|
||||
void print_floating_point_to_stream(std::ostream & stream, T val, value_flags format = {})
|
||||
{
|
||||
using namespace toml;
|
||||
|
||||
switch (impl::fpclassify(val))
|
||||
{
|
||||
case impl::fp_class::neg_inf: impl::print_to_stream(stream, "-inf"sv); break;
|
||||
@ -7963,8 +7938,6 @@ TOML_ANON_NAMESPACE_START
|
||||
TOML_INTERNAL_LINKAGE
|
||||
void print_integer_leftpad_zeros(std::ostream & stream, T val, size_t min_digits)
|
||||
{
|
||||
using namespace toml;
|
||||
|
||||
#if TOML_INT_CHARCONV
|
||||
|
||||
char buf[charconv_buffer_length<T>];
|
||||
@ -8231,7 +8204,7 @@ TOML_IMPL_NAMESPACE_END;
|
||||
|
||||
TOML_POP_WARNINGS;
|
||||
|
||||
//******** impl/node_impl.h ******************************************************************************************
|
||||
//******** impl/node.inl *********************************************************************************************
|
||||
|
||||
TOML_PUSH_WARNINGS;
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
@ -8278,7 +8251,7 @@ TOML_NAMESPACE_END;
|
||||
|
||||
TOML_POP_WARNINGS;
|
||||
|
||||
//******** impl/node_view_impl.h *************************************************************************************
|
||||
//******** impl/node_view.inl ****************************************************************************************
|
||||
|
||||
#if TOML_EXTERN_TEMPLATES
|
||||
|
||||
@ -8346,7 +8319,7 @@ TOML_POP_WARNINGS;
|
||||
|
||||
#endif // TOML_EXTERN_TEMPLATES
|
||||
|
||||
//******** impl/value_impl.h *****************************************************************************************
|
||||
//******** impl/value.inl ********************************************************************************************
|
||||
|
||||
#if TOML_EXTERN_TEMPLATES
|
||||
|
||||
@ -8417,7 +8390,7 @@ TOML_POP_WARNINGS;
|
||||
|
||||
#endif // TOML_EXTERN_TEMPLATES
|
||||
|
||||
//******** impl/array_impl.h *****************************************************************************************
|
||||
//******** impl/array.inl ********************************************************************************************
|
||||
|
||||
TOML_PUSH_WARNINGS;
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
@ -8425,16 +8398,10 @@ TOML_DISABLE_SWITCH_WARNINGS;
|
||||
|
||||
TOML_ANON_NAMESPACE_START
|
||||
{
|
||||
#if !TOML_HEADER_ONLY
|
||||
using namespace toml;
|
||||
#endif
|
||||
|
||||
template <typename T, typename U>
|
||||
TOML_INTERNAL_LINKAGE
|
||||
bool array_is_homogeneous(T & elements, node_type ntype, U & first_nonmatch) noexcept
|
||||
{
|
||||
using namespace toml;
|
||||
|
||||
if (elements.empty())
|
||||
{
|
||||
first_nonmatch = {};
|
||||
@ -8655,7 +8622,7 @@ TOML_NAMESPACE_END;
|
||||
|
||||
TOML_POP_WARNINGS;
|
||||
|
||||
//******** impl/table_impl.h *****************************************************************************************
|
||||
//******** impl/table.inl ********************************************************************************************
|
||||
|
||||
TOML_PUSH_WARNINGS;
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
@ -8663,16 +8630,10 @@ TOML_DISABLE_SWITCH_WARNINGS;
|
||||
|
||||
TOML_ANON_NAMESPACE_START
|
||||
{
|
||||
#if !TOML_HEADER_ONLY
|
||||
using namespace toml;
|
||||
#endif
|
||||
|
||||
template <typename T, typename U>
|
||||
TOML_INTERNAL_LINKAGE
|
||||
bool table_is_homogeneous(T & map, node_type ntype, U & first_nonmatch) noexcept
|
||||
{
|
||||
using namespace toml;
|
||||
|
||||
if (map.empty())
|
||||
{
|
||||
first_nonmatch = {};
|
||||
@ -8820,7 +8781,7 @@ TOML_NAMESPACE_END;
|
||||
|
||||
TOML_POP_WARNINGS;
|
||||
|
||||
//******** impl/parser_impl.h ****************************************************************************************
|
||||
//******** impl/parser.inl *******************************************************************************************
|
||||
|
||||
#if TOML_PARSER
|
||||
|
||||
@ -8844,10 +8805,6 @@ TOML_DISABLE_SWITCH_WARNINGS;
|
||||
|
||||
TOML_ANON_NAMESPACE_START
|
||||
{
|
||||
#if !TOML_HEADER_ONLY
|
||||
using namespace toml;
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
class utf8_byte_stream;
|
||||
|
||||
@ -8987,13 +8944,6 @@ TOML_ANON_NAMESPACE_START
|
||||
return bytes[3] ? std::string_view{ bytes, 4_sz } : std::string_view{ bytes };
|
||||
}
|
||||
|
||||
TOML_NODISCARD
|
||||
TOML_ATTR(pure)
|
||||
constexpr operator char32_t&() noexcept
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
TOML_NODISCARD
|
||||
TOML_ATTR(pure)
|
||||
constexpr operator const char32_t&() const noexcept
|
||||
@ -12459,7 +12409,7 @@ TOML_POP_WARNINGS;
|
||||
|
||||
#endif // TOML_PARSER
|
||||
|
||||
//******** impl/formatter_impl.h *************************************************************************************
|
||||
//******** impl/formatter.inl ****************************************************************************************
|
||||
|
||||
TOML_PUSH_WARNINGS;
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
@ -12675,11 +12625,12 @@ TOML_IMPL_NAMESPACE_END;
|
||||
|
||||
TOML_POP_WARNINGS;
|
||||
|
||||
//******** impl/default_formatter_impl.h *****************************************************************************
|
||||
//******** impl/default_formatter.inl ********************************************************************************
|
||||
|
||||
TOML_PUSH_WARNINGS;
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
TOML_DISABLE_SWITCH_WARNINGS;
|
||||
TOML_DISABLE_ARITHMETIC_WARNINGS;
|
||||
|
||||
TOML_NAMESPACE_START
|
||||
{
|
||||
@ -13113,7 +13064,7 @@ TOML_NAMESPACE_END;
|
||||
|
||||
TOML_POP_WARNINGS;
|
||||
|
||||
//******** impl/json_formatter_impl.h ********************************************************************************
|
||||
//******** impl/json_formatter.inl ***********************************************************************************
|
||||
|
||||
TOML_PUSH_WARNINGS;
|
||||
TOML_DISABLE_SPAM_WARNINGS;
|
||||
@ -13213,6 +13164,8 @@ TOML_POP_WARNINGS;
|
||||
|
||||
#endif // TOML_IMPLEMENTATION
|
||||
|
||||
TOML_POP_WARNINGS;
|
||||
|
||||
// macro hygiene
|
||||
#if TOML_UNDEF_MACROS
|
||||
#undef TOML_ABI_NAMESPACE_BOOL
|
||||
@ -13238,8 +13191,6 @@ TOML_POP_WARNINGS;
|
||||
#undef TOML_CPP
|
||||
#undef TOML_DISABLE_ARITHMETIC_WARNINGS
|
||||
#undef TOML_DISABLE_CODE_ANALYSIS_WARNINGS
|
||||
#undef TOML_DISABLE_INIT_WARNINGS
|
||||
#undef TOML_DISABLE_SHADOW_WARNINGS
|
||||
#undef TOML_DISABLE_SPAM_WARNINGS
|
||||
#undef TOML_DISABLE_SUGGEST_WARNINGS
|
||||
#undef TOML_DISABLE_SWITCH_WARNINGS
|
||||
@ -13311,7 +13262,6 @@ TOML_POP_WARNINGS;
|
||||
#undef TOML_UINT128
|
||||
#undef TOML_UNLIKELY
|
||||
#undef TOML_UNREACHABLE
|
||||
#undef TOML_USING_ANON_NAMESPACE
|
||||
#endif
|
||||
|
||||
#endif // TOMLPLUSPLUS_H
|
||||
|
33
tools/clang_format.bat
Normal file
33
tools/clang_format.bat
Normal file
@ -0,0 +1,33 @@
|
||||
@ECHO off
|
||||
SETLOCAL enableextensions enabledelayedexpansion
|
||||
PUSHD .
|
||||
CD /d "%~dp0\.."
|
||||
|
||||
REM --------------------------------------------------------------------------------------
|
||||
REM Runs clang format on all the non-test C++ files in the project
|
||||
REM --------------------------------------------------------------------------------------
|
||||
|
||||
CALL :RunClangFormatOnDirectories ^
|
||||
include\toml++ ^
|
||||
include\toml++\impl ^
|
||||
examples
|
||||
|
||||
GOTO FINISH
|
||||
|
||||
:RunClangFormatOnDirectories
|
||||
(
|
||||
FOR %%i IN (%*) DO (
|
||||
IF EXIST "%%~i" (
|
||||
ECHO Formatting files in "%%~i"
|
||||
clang-format --style=file -i "%%~i\*.cpp" >nul 2>&1
|
||||
clang-format --style=file -i "%%~i\*.h" >nul 2>&1
|
||||
clang-format --style=file -i "%%~i\*.inl" >nul 2>&1
|
||||
)
|
||||
)
|
||||
EXIT /B
|
||||
)
|
||||
|
||||
:FINISH
|
||||
POPD
|
||||
@ENDLOCAL
|
||||
EXIT /B 0
|
@ -15,7 +15,7 @@ from io import StringIO
|
||||
|
||||
class Preprocessor:
|
||||
|
||||
__re_includes = re.compile(r'^\s*#\s*include\s+"(.+?)"', re.I | re.M)
|
||||
__re_includes = re.compile(r'^\s*#\s*include\s+"(.+?)".*?$', re.I | re.M)
|
||||
__multiples_allowed = [
|
||||
r'impl/header_start.h',
|
||||
r'impl/header_end.h'
|
||||
@ -57,7 +57,7 @@ class Preprocessor:
|
||||
|
||||
if self.__current_level == 1:
|
||||
header = utils.make_divider(relative_path, 10, pattern = r'*')
|
||||
text = f'{header}\n\n{text}'
|
||||
text = f'\n\n{header}\n\n{text}'
|
||||
|
||||
self.__directory_stack.pop()
|
||||
return '\n\n' + text + '\n\n'
|
||||
@ -102,6 +102,9 @@ def main():
|
||||
toml_h = re.sub(r'([^@][({,])\n\n', r'\1\n', toml_h)
|
||||
# blank lines preceeding closing brackets
|
||||
toml_h = re.sub(r'\n\n([ \t]*[})])', r'\n\1', toml_h)
|
||||
# blank lines between consecutive TOML_DISABLE_XXXXX_WARNINGS statements
|
||||
toml_h = re.sub('(TOML_(?:PUSH|DISABLE_[A-Z_]+?)WARNINGS;)\n[ \t\n]*\n(TOML_DISABLE_[A-Z_]+?WARNINGS;)', r'\1\n\2', toml_h)
|
||||
# ensure only one trailing newline
|
||||
toml_h = toml_h.strip() + '\n'
|
||||
|
||||
# change TOML_LIB_SINGLE_HEADER to 1
|
||||
|
@ -119,10 +119,10 @@ def main():
|
||||
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
|
||||
<ClCompile Include="..\conformance_iarna_valid.cpp" />
|
||||
<ClCompile Include="..\impl_catch2.cpp">
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\impl_toml.cpp">
|
||||
<ClCompile Include="..\main.cpp">
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\manipulating_arrays.cpp" />
|
||||
|
Loading…
Reference in New Issue
Block a user