From 04fb08dcf4bf9832455208db527180ca5ef3bf45 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Thu, 16 Jul 2026 20:22:22 +0800 Subject: [PATCH 01/18] fix: silence unused-value warnings in fold expressions Co-authored-by: Codex Co-authored-by: Claude Code --- include/rfl/internal/field_index_by_name.hpp | 8 ++++---- include/rfl/internal/field_index_from_ptm.hpp | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/rfl/internal/field_index_by_name.hpp b/include/rfl/internal/field_index_by_name.hpp index 52609b517..c3948d3e6 100644 --- a/include/rfl/internal/field_index_by_name.hpp +++ b/include/rfl/internal/field_index_by_name.hpp @@ -24,10 +24,10 @@ consteval std::string_view field_name_at() { template consteval std::size_t field_index_by_name_impl(std::index_sequence) { std::size_t result = static_cast(-1); - ((field_name_at() == Name.string_view() - ? (result = Is, true) - : false) || - ...); + (void)(((field_name_at() == Name.string_view() + ? (result = Is, true) + : false) || + ...)); return result; } diff --git a/include/rfl/internal/field_index_from_ptm.hpp b/include/rfl/internal/field_index_from_ptm.hpp index 22a7366ae..5377d5817 100644 --- a/include/rfl/internal/field_index_from_ptm.hpp +++ b/include/rfl/internal/field_index_from_ptm.hpp @@ -42,11 +42,11 @@ consteval std::size_t field_index_from_ptm_impl(std::index_sequence) { T obj{}; const void* target = static_cast(&(obj.*FieldPtr)); std::size_t result = static_cast(-1); - ((static_cast(get_ith_field_ptr(Is)>(obj)) == - target - ? (result = Is, true) - : false) || - ...); + (void)(((static_cast( + get_ith_field_ptr(Is)>(obj)) == target + ? (result = Is, true) + : false) || + ...)); return result; #else const void* target = From 557bb3154b07e16b800f64de92f01fcc11af6806 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Thu, 16 Jul 2026 20:22:45 +0800 Subject: [PATCH 02/18] fix: deprecate std::get overloads for rfl::Tuple Co-authored-by: Codex Co-authored-by: Claude Code --- docs/rfl_tuple.md | 4 +++- include/rfl/Tuple.hpp | 2 ++ .../rfl/internal/copy_flattened_tuple_to_named_tuple.hpp | 2 +- include/rfl/internal/move_from_tuple.hpp | 6 +++--- include/rfl/internal/wrap_in_fields.hpp | 2 +- tests/json/test_apply.cpp | 2 +- tests/json/test_view.cpp | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/rfl_tuple.md b/docs/rfl_tuple.md index 3b785d03b..1566b82eb 100644 --- a/docs/rfl_tuple.md +++ b/docs/rfl_tuple.md @@ -13,4 +13,6 @@ functions. You can use the functions `rfl::get`, `rfl::make_tuple`, `rfl::tuple_element_t`, `rfl::tuple_size_v`, `rfl::tuple_cat` or `rfl::apply` to create or access the tuple and they work the same way as their equivalents in the standard library. -In fact, `std::get` will also work on `rfl::Tuple`. + +The legacy `std::get` overload for `rfl::Tuple` is deprecated. Use `rfl::get` +instead. diff --git a/include/rfl/Tuple.hpp b/include/rfl/Tuple.hpp index c08a4c03e..2e037a31e 100644 --- a/include/rfl/Tuple.hpp +++ b/include/rfl/Tuple.hpp @@ -343,6 +343,7 @@ namespace std { /// @param _tup The Tuple to access. /// @return Reference to the element at the specified index. template +[[deprecated("Use rfl::get instead.")]] constexpr auto& get(rfl::Tuple& _tup) { return _tup.template get<_index>(); } @@ -353,6 +354,7 @@ constexpr auto& get(rfl::Tuple& _tup) { /// @param _tup The Tuple to access. /// @return Const reference to the element at the specified index. template +[[deprecated("Use rfl::get instead.")]] constexpr const auto& get(const rfl::Tuple& _tup) { return _tup.template get<_index>(); } diff --git a/include/rfl/internal/copy_flattened_tuple_to_named_tuple.hpp b/include/rfl/internal/copy_flattened_tuple_to_named_tuple.hpp index 543f1e18e..c7f588b66 100644 --- a/include/rfl/internal/copy_flattened_tuple_to_named_tuple.hpp +++ b/include/rfl/internal/copy_flattened_tuple_to_named_tuple.hpp @@ -16,7 +16,7 @@ auto copy_one_element(const auto& _flattened_tuple) { const auto name_literal = FieldNames::template name_of<_i>(); return rfl::make_field< lit_name_v>>( - std::get<_i>(_flattened_tuple)); + rfl::get<_i>(_flattened_tuple)); } template diff --git a/include/rfl/internal/move_from_tuple.hpp b/include/rfl/internal/move_from_tuple.hpp index 0905a5671..1d22cb4bb 100644 --- a/include/rfl/internal/move_from_tuple.hpp +++ b/include/rfl/internal/move_from_tuple.hpp @@ -56,7 +56,7 @@ auto unflatten_ptr_tuple(PtrTupleType& _t, Args... _args) { } else { return unflatten_ptr_tuple( - _t, _args..., std::get<_j>(_t)); + _t, _args..., rfl::get<_j>(_t)); } } } @@ -71,7 +71,7 @@ auto move_from_pointers(Pointers& _ptrs, Args&&... _args) { if constexpr (std::is_pointer_v) { return move_from_pointers(_ptrs, std::move(_args)..., - std::move(*std::get(_ptrs))); + std::move(*rfl::get(_ptrs))); } else { using PtrTupleType = ptr_tuple_t>; @@ -80,7 +80,7 @@ auto move_from_pointers(Pointers& _ptrs, Args&&... _args) { tuple_element_t>::Type>; return move_from_pointers(_ptrs, std::move(_args)..., - move_from_pointers(std::get(_ptrs))); + move_from_pointers(rfl::get(_ptrs))); } } } diff --git a/include/rfl/internal/wrap_in_fields.hpp b/include/rfl/internal/wrap_in_fields.hpp index f536779d1..8c20c3b72 100644 --- a/include/rfl/internal/wrap_in_fields.hpp +++ b/include/rfl/internal/wrap_in_fields.hpp @@ -21,7 +21,7 @@ auto wrap_in_fields(auto&& _tuple, Fields&&... _fields) { if constexpr (i == size) { return rfl::make_tuple(std::move(_fields)...); } else { - auto value = std::move(std::get(_tuple)); + auto value = std::move(rfl::get(_tuple)); using Type = std::remove_cvref_t>; if constexpr (is_flatten_field_v) { // The problem here is that the FieldNames are already flattened, but this diff --git a/tests/json/test_apply.cpp b/tests/json/test_apply.cpp index 6777aa2d0..8ae1b2c55 100644 --- a/tests/json/test_apply.cpp +++ b/tests/json/test_apply.cpp @@ -20,7 +20,7 @@ TEST(json, test_apply) { const auto view = rfl::to_view(lisa); *view.get<0>() = "Maggie"; - *std::get<1>(view.values()) = "Simpson"; + *rfl::get<1>(view.values()) = "Simpson"; *view.get<"age">() = 0; view.apply([](const Field& field) { diff --git a/tests/json/test_view.cpp b/tests/json/test_view.cpp index eb25c8dc8..79c7e5f4b 100644 --- a/tests/json/test_view.cpp +++ b/tests/json/test_view.cpp @@ -19,7 +19,7 @@ TEST(json, test_view) { const auto view = rfl::to_view(lisa); *view.get<0>() = "Maggie"; - *std::get<1>(view.values()) = "Simpson"; + *rfl::get<1>(view.values()) = "Simpson"; *view.get<"age">() = 0; write_and_read(lisa, From 2f40febbb0c7c4bf399766033304c8fec2776b0f Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Thu, 16 Jul 2026 20:26:18 +0800 Subject: [PATCH 03/18] feat: make CLI an independent CMake option Co-authored-by: Codex Co-authored-by: Claude Code --- CMakeLists.txt | 1 + reflectcpp-config.cmake.in | 1 + tests/CMakeLists.txt | 3 +++ 3 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb1069ff6..1083a49c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ option(REFLECTCPP_INSTALL "Install reflect cpp" OFF) option(REFLECTCPP_ALL_FORMATS "Enable all supported formats" OFF) option(REFLECTCPP_JSON "Enable JSON support" ON) # enabled by default +option(REFLECTCPP_CLI "Enable CLI support" ON) option(REFLECTCPP_AVRO "Enable AVRO support" ${REFLECTCPP_ALL_FORMATS}) option(REFLECTCPP_BSON "Enable BSON support" ${REFLECTCPP_ALL_FORMATS}) option(REFLECTCPP_CAPNPROTO "Enable Cap’n Proto support" ${REFLECTCPP_ALL_FORMATS}) diff --git a/reflectcpp-config.cmake.in b/reflectcpp-config.cmake.in index a1ba06899..e25c4da9b 100644 --- a/reflectcpp-config.cmake.in +++ b/reflectcpp-config.cmake.in @@ -1,6 +1,7 @@ @PACKAGE_INIT@ set(REFLECTCPP_JSON @REFLECTCPP_JSON@) +set(REFLECTCPP_CLI @REFLECTCPP_CLI@) set(REFLECTCPP_BOOST_SERIALIZATION @REFLECTCPP_BOOST_SERIALIZATION@) set(REFLECTCPP_BSON @REFLECTCPP_BSON@) set(REFLECTCPP_CAPNPROTO @REFLECTCPP_CAPNPROTO@) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d68b3a0fa..11fa767f6 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -14,6 +14,9 @@ if (REFLECTCPP_JSON) add_subdirectory(generic) add_subdirectory(json) add_subdirectory(json_c_arrays_and_inheritance) +endif () + +if (REFLECTCPP_CLI) add_subdirectory(cli) endif () From 2a1143d05bf4aa569037bed4e81994c1b05ab732 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Thu, 16 Jul 2026 20:26:40 +0800 Subject: [PATCH 04/18] feat: make enum reflection range configurable via CMake Co-authored-by: Codex Co-authored-by: Claude Code --- CMakeLists.txt | 10 ++++++++++ docs/enums.md | 11 +++++++++++ tests/generic/CMakeLists.txt | 6 +++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1083a49c7..e393d7cd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,11 @@ option(REFLECTCPP_BUILD_BENCHMARKS "Build benchmarks" OFF) option(REFLECTCPP_BUILD_TESTS "Build tests" OFF) option(REFLECTCPP_CHECK_HEADERS "Make sure that all headers are self-contained" OFF) +set(REFLECTCPP_ENUM_RANGE_MIN "-256" CACHE STRING + "Minimum value scanned during enum reflection") +set(REFLECTCPP_ENUM_RANGE_MAX "256" CACHE STRING + "Maximum value scanned during enum reflection") + option(REFLECTCPP_USE_BUNDLED_DEPENDENCIES "Use the bundled dependencies" ON) option(REFLECTCPP_USE_STD_EXPECTED "Use std::expected instead of the built-in Result type (requires C++-23)" OFF) @@ -234,6 +239,11 @@ if(REFLECTCPP_USE_STD_EXPECTED) target_compile_definitions(reflectcpp PUBLIC REFLECTCPP_USE_STD_EXPECTED) endif() +target_compile_definitions(reflectcpp PRIVATE + RFL_ENUM_RANGE_MIN=${REFLECTCPP_ENUM_RANGE_MIN} + RFL_ENUM_RANGE_MAX=${REFLECTCPP_ENUM_RANGE_MAX} +) + set(REFLECT_CPP_SOURCES src/reflectcpp.cpp ) diff --git a/docs/enums.md b/docs/enums.md index b2280f0ac..81747bc2d 100644 --- a/docs/enums.md +++ b/docs/enums.md @@ -54,6 +54,17 @@ However, some limitations apply: #define RFL_ENUM_RANGE_MAX 128 #include ``` + + If you consume reflect-cpp as a C++ module (`import rfl;`), you cannot define these macros in your own + translation units, because the range is baked into the compiled module interface. Instead, set the + `REFLECTCPP_ENUM_RANGE_MIN` and `REFLECTCPP_ENUM_RANGE_MAX` CMake cache variables when configuring the library: + + ``` + cmake -DREFLECTCPP_ENUM_RANGE_MIN=-128 -DREFLECTCPP_ENUM_RANGE_MAX=128 ... + ``` + + Note that these CMake variables only affect the compiled module interface; they have no effect on header-only + consumers, who should use the `RFL_ENUM_RANGE_MIN`/`RFL_ENUM_RANGE_MAX` macros shown above. - You can specify a custom range for a specific enum by defining the specialization `rfl::config::enum_range` for the enum type : ```cpp diff --git a/tests/generic/CMakeLists.txt b/tests/generic/CMakeLists.txt index 59e1f17e2..1ae10defd 100644 --- a/tests/generic/CMakeLists.txt +++ b/tests/generic/CMakeLists.txt @@ -8,6 +8,11 @@ add_executable( ${SOURCES} ) +target_compile_definitions(reflect-cpp-generic-tests PRIVATE + REFLECTCPP_TEST_ENUM_RANGE_MIN=${REFLECTCPP_ENUM_RANGE_MIN} + REFLECTCPP_TEST_ENUM_RANGE_MAX=${REFLECTCPP_ENUM_RANGE_MAX} +) + target_include_directories(reflect-cpp-generic-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") target_link_libraries(reflect-cpp-generic-tests PRIVATE reflectcpp_tests_crt) @@ -38,4 +43,3 @@ add_library(generic-compile-fail-flatten-cross-type-move-assign OBJECT EXCLUDE_F compile_fail/flatten_cross_type_move_assign.cpp ) target_link_libraries(generic-compile-fail-flatten-cross-type-move-assign PRIVATE reflectcpp_tests_crt) - From 02d5ea4d84fb6e9b530976fb98d4f00f250c9266 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Thu, 16 Jul 2026 20:26:55 +0800 Subject: [PATCH 05/18] fix: support Avro linking with Clang on Windows Co-authored-by: Codex Co-authored-by: Claude Code --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e393d7cd6..6300df0a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,7 +292,7 @@ if (REFLECTCPP_AVRO OR REFLECTCPP_CHECK_HEADERS) find_package(jansson CONFIG REQUIRED) if (REFLECTCPP_USE_VCPKG) target_include_directories(reflectcpp SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") - if (MSVC) + if (WIN32) set(_AVRO_STATIC_LIB "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/avro${CMAKE_STATIC_LIBRARY_SUFFIX}") if(REFLECTCPP_BUILD_SHARED) message(STATUS "With whole archive ${_AVRO_STATIC_LIB}") From 16373743cecb942ba6ec99a6edbcdc1c06000746 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Thu, 16 Jul 2026 20:27:50 +0800 Subject: [PATCH 06/18] feat: add C++20 module interface units Co-authored-by: Codex Co-authored-by: Claude Code --- .gitattributes | 1 + CMakeLists.txt | 52 ++++++++- README.md | 36 ++++++ modules/rfl.avro.cppm | 17 +++ modules/rfl.boost_serialization.cppm | 14 +++ modules/rfl.bson.cppm | 16 +++ modules/rfl.c_arrays_and_inheritance.cppm | 22 ++++ modules/rfl.capnproto.cppm | 16 +++ modules/rfl.cbor.cppm | 14 +++ modules/rfl.cereal.cppm | 14 +++ modules/rfl.cli.cppm | 11 ++ modules/rfl.cppm | 128 ++++++++++++++++++++++ modules/rfl.csv.cppm | 15 +++ modules/rfl.flexbuf.cppm | 14 +++ modules/rfl.json.cppm | 18 +++ modules/rfl.msgpack.cppm | 14 +++ modules/rfl.parquet.cppm | 16 +++ modules/rfl.toml.cppm | 14 +++ modules/rfl.ubjson.cppm | 14 +++ modules/rfl.xml.cppm | 14 +++ modules/rfl.yaml.cppm | 15 +++ modules/rfl.yas.cppm | 14 +++ 22 files changed, 485 insertions(+), 4 deletions(-) create mode 100644 .gitattributes create mode 100644 modules/rfl.avro.cppm create mode 100644 modules/rfl.boost_serialization.cppm create mode 100644 modules/rfl.bson.cppm create mode 100644 modules/rfl.c_arrays_and_inheritance.cppm create mode 100644 modules/rfl.capnproto.cppm create mode 100644 modules/rfl.cbor.cppm create mode 100644 modules/rfl.cereal.cppm create mode 100644 modules/rfl.cli.cppm create mode 100644 modules/rfl.cppm create mode 100644 modules/rfl.csv.cppm create mode 100644 modules/rfl.flexbuf.cppm create mode 100644 modules/rfl.json.cppm create mode 100644 modules/rfl.msgpack.cppm create mode 100644 modules/rfl.parquet.cppm create mode 100644 modules/rfl.toml.cppm create mode 100644 modules/rfl.ubjson.cppm create mode 100644 modules/rfl.xml.cppm create mode 100644 modules/rfl.yaml.cppm create mode 100644 modules/rfl.yas.cppm diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..6313b56c5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/CMakeLists.txt b/CMakeLists.txt index 6300df0a4..65e154b5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.23) +cmake_minimum_required(VERSION 3.28) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -248,6 +248,17 @@ set(REFLECT_CPP_SOURCES src/reflectcpp.cpp ) +set(REFLECT_CPP_MODULES + modules/rfl.cppm +) + +if (REFLECTCPP_JSON OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES + modules/rfl.json.cppm + modules/rfl.c_arrays_and_inheritance.cppm + ) +endif () + target_include_directories( reflectcpp PUBLIC $ @@ -286,6 +297,7 @@ if (_REFLECTCPP_NEEDS_JSON_IMPL) endif () if (REFLECTCPP_AVRO OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.avro.cppm) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_avro.cpp ) @@ -319,6 +331,7 @@ if (REFLECTCPP_AVRO OR REFLECTCPP_CHECK_HEADERS) endif () if (REFLECTCPP_BSON OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.bson.cppm) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_bson.cpp ) @@ -329,6 +342,7 @@ if (REFLECTCPP_BSON OR REFLECTCPP_CHECK_HEADERS) endif () if (REFLECTCPP_CAPNPROTO OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.capnproto.cppm) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_capnproto.cpp ) @@ -344,6 +358,7 @@ if (REFLECTCPP_CAPNPROTO OR REFLECTCPP_CHECK_HEADERS) endif () if (REFLECTCPP_CBOR OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.cbor.cppm) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_cbor.cpp ) @@ -354,6 +369,7 @@ if (REFLECTCPP_CBOR OR REFLECTCPP_CHECK_HEADERS) endif () if (REFLECTCPP_CEREAL OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.cereal.cppm) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_cereal.cpp ) @@ -364,6 +380,7 @@ if (REFLECTCPP_CEREAL OR REFLECTCPP_CHECK_HEADERS) endif() if (REFLECTCPP_CSV OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.csv.cppm) if (NOT TARGET Arrow) find_package(Arrow CONFIG REQUIRED) endif() @@ -375,6 +392,7 @@ if (REFLECTCPP_CSV OR REFLECTCPP_CHECK_HEADERS) endif () if (REFLECTCPP_FLEXBUFFERS OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.flexbuf.cppm) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_flexbuf.cpp ) @@ -385,6 +403,7 @@ if (REFLECTCPP_FLEXBUFFERS OR REFLECTCPP_CHECK_HEADERS) endif () if (REFLECTCPP_MSGPACK OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.msgpack.cppm) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_msgpack.cpp ) @@ -395,6 +414,7 @@ if (REFLECTCPP_MSGPACK OR REFLECTCPP_CHECK_HEADERS) endif () if (REFLECTCPP_PARQUET OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.parquet.cppm) if (NOT TARGET Arrow) find_package(Arrow CONFIG REQUIRED) endif() @@ -410,6 +430,7 @@ if (REFLECTCPP_PARQUET OR REFLECTCPP_CHECK_HEADERS) endif () if (REFLECTCPP_TOML OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.toml.cppm) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_toml.cpp ) @@ -420,6 +441,7 @@ if (REFLECTCPP_TOML OR REFLECTCPP_CHECK_HEADERS) endif() if (REFLECTCPP_UBJSON OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.ubjson.cppm) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_ubjson.cpp ) @@ -430,6 +452,7 @@ if (REFLECTCPP_UBJSON OR REFLECTCPP_CHECK_HEADERS) endif () if (REFLECTCPP_XML OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.xml.cppm) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_xml.cpp ) @@ -440,6 +463,7 @@ if (REFLECTCPP_XML OR REFLECTCPP_CHECK_HEADERS) endif () if (REFLECTCPP_YAML OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.yaml.cppm) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_yaml.cpp ) @@ -450,6 +474,7 @@ if (REFLECTCPP_YAML OR REFLECTCPP_CHECK_HEADERS) endif () if (REFLECTCPP_BOOST_SERIALIZATION OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.boost_serialization.cppm) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_boost_serialization.cpp ) @@ -460,6 +485,7 @@ if (REFLECTCPP_BOOST_SERIALIZATION OR REFLECTCPP_CHECK_HEADERS) endif () if (REFLECTCPP_YAS OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.yas.cppm) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_yas.cpp ) @@ -467,8 +493,26 @@ if (REFLECTCPP_YAS OR REFLECTCPP_CHECK_HEADERS) target_include_directories(reflectcpp PRIVATE ${YAS_INCLUDE_DIRS}) endif () +if (REFLECTCPP_CLI OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.cli.cppm) +endif () + +set_source_files_properties( + ${REFLECT_CPP_MODULES} + PROPERTIES + LANGUAGE CXX + SKIP_PRECOMPILE_HEADERS ON +) + set_target_properties(reflectcpp PROPERTIES LINKER_LANGUAGE CXX) target_sources(reflectcpp PRIVATE ${REFLECT_CPP_SOURCES}) +target_sources(reflectcpp + PUBLIC + FILE_SET rfl_modules + TYPE CXX_MODULES + BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/modules + FILES ${REFLECT_CPP_MODULES} +) target_precompile_headers(reflectcpp PRIVATE [["rfl.hpp"]] ) if (REFLECTCPP_BUILD_TESTS) @@ -539,7 +583,7 @@ if (REFLECTCPP_INSTALL) DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/reflectcpp" ) - file(GLOB_RECURSE RFL_HEADERS RELATIVE ${CMAKE_CURRENT_LIST_DIR} "${CMAKE_CURRENT_LIST_DIR}/include/*" ) + file(GLOB_RECURSE RFL_HEADERS RELATIVE ${CMAKE_CURRENT_LIST_DIR} "${CMAKE_CURRENT_LIST_DIR}/include/*.h" "${CMAKE_CURRENT_LIST_DIR}/include/*.hpp") target_sources(reflectcpp PUBLIC @@ -552,7 +596,8 @@ if (REFLECTCPP_INSTALL) install( TARGETS reflectcpp EXPORT reflectcpp-exports - FILE_SET reflectcpp_headers DESTINATION ${INCLUDE_INSTALL_DIR} + FILE_SET reflectcpp_headers DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + FILE_SET rfl_modules DESTINATION ${CMAKE_INSTALL_DATADIR}/reflectcpp/modules ) install( @@ -597,4 +642,3 @@ include(CPack) if (ament_cmake_FOUND) ament_package() endif() - diff --git a/README.md b/README.md index 921bed8ce..8132ed318 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ reflect-cpp and sqlgen fill important gaps in C++ development. They reduce boile - [Serialization formats](#serialization-formats) - [Feature Overview](#feature-overview) - [Simple Example](#simple-example) + - [C++ modules](#c-modules) - [More Comprehensive Example](#more-comprehensive-example) - [Tabular data](#tabular-data) - [CLI argument parsing](#cli-argument-parsing) @@ -179,6 +180,41 @@ rfl::xml::read(xml_string); rfl::yas::read(yas_bytes); ``` +### C++ modules + +In addition to the classic header-based interface, reflect-cpp ships C++20 +named modules. If your toolchain supports modules, you can replace the +`#include` directives with `import`: + +```cpp +import rfl; +import rfl.json; // one submodule per serialization format, e.g. rfl.yaml, rfl.avro, ... + +struct Person { + std::string first_name; + std::string last_name; + int age; +}; + +const auto homer = + Person{.first_name = "Homer", .last_name = "Simpson", .age = 45}; + +const std::string json_string = rfl::json::write(homer); +auto homer2 = rfl::json::read(json_string).value(); +``` + +The public API is identical to the header-based interface; only the way you +bring the names into scope changes. Building the modules requires CMake `>= 3.28` +and a compiler with C++20 modules support. The module interface units live in +the [`modules/`](modules) directory and are enabled per format via the same +`REFLECTCPP_*` CMake options as the headers. + +> **Note:** When consuming reflect-cpp as a module, the enum reflection range is +> baked into the compiled module interface. Configure it with the +> `REFLECTCPP_ENUM_RANGE_MIN` / `REFLECTCPP_ENUM_RANGE_MAX` CMake variables rather +> than the `RFL_ENUM_RANGE_MIN` / `RFL_ENUM_RANGE_MAX` macros. See the +> [enums documentation](https://rfl.getml.com/enums) for details. + ### More Comprehensive Example ```cpp diff --git a/modules/rfl.avro.cppm b/modules/rfl.avro.cppm new file mode 100644 index 000000000..371237775 --- /dev/null +++ b/modules/rfl.avro.cppm @@ -0,0 +1,17 @@ +module; + +#include "rfl/avro.hpp" + +export module rfl.avro; + +export import rfl; + +export namespace rfl::avro { +using ::rfl::avro::Schema; +using ::rfl::avro::SchemaImpl; +using ::rfl::avro::load; +using ::rfl::avro::read; +using ::rfl::avro::save; +using ::rfl::avro::to_schema; +using ::rfl::avro::write; +} diff --git a/modules/rfl.boost_serialization.cppm b/modules/rfl.boost_serialization.cppm new file mode 100644 index 000000000..c3f85bba4 --- /dev/null +++ b/modules/rfl.boost_serialization.cppm @@ -0,0 +1,14 @@ +module; + +#include "rfl/boost_serialization.hpp" + +export module rfl.boost_serialization; + +export import rfl; + +export namespace rfl::boost_serialization { +using ::rfl::boost_serialization::load; +using ::rfl::boost_serialization::read; +using ::rfl::boost_serialization::save; +using ::rfl::boost_serialization::write; +} diff --git a/modules/rfl.bson.cppm b/modules/rfl.bson.cppm new file mode 100644 index 000000000..7c367c9f7 --- /dev/null +++ b/modules/rfl.bson.cppm @@ -0,0 +1,16 @@ +module; + +#include "rfl/bson.hpp" + +export module rfl.bson; + +export import rfl; + +export using ::bson_oid_t; + +export namespace rfl::bson { +using ::rfl::bson::load; +using ::rfl::bson::read; +using ::rfl::bson::save; +using ::rfl::bson::write; +} diff --git a/modules/rfl.c_arrays_and_inheritance.cppm b/modules/rfl.c_arrays_and_inheritance.cppm new file mode 100644 index 000000000..90e167a0d --- /dev/null +++ b/modules/rfl.c_arrays_and_inheritance.cppm @@ -0,0 +1,22 @@ +module; + +#define REFLECT_CPP_C_ARRAYS_OR_INHERITANCE +#include "rfl.hpp" +#include "rfl/json.hpp" +#include "rfl/num_fields.hpp" + +export module rfl.c_arrays_and_inheritance; + +export namespace rfl { +using ::rfl::make_field; +using ::rfl::named_tuple_t; +using ::rfl::num_fields; +using ::rfl::replace; +using ::rfl::to_view; +using ::rfl::tuple_element_t; +} + +export namespace rfl::json { +using ::rfl::json::read; +using ::rfl::json::write; +} diff --git a/modules/rfl.capnproto.cppm b/modules/rfl.capnproto.cppm new file mode 100644 index 000000000..97465f812 --- /dev/null +++ b/modules/rfl.capnproto.cppm @@ -0,0 +1,16 @@ +module; + +#include "rfl/capnproto.hpp" + +export module rfl.capnproto; + +export import rfl; + +export namespace rfl::capnproto { +using ::rfl::capnproto::Schema; +using ::rfl::capnproto::load; +using ::rfl::capnproto::read; +using ::rfl::capnproto::save; +using ::rfl::capnproto::to_schema; +using ::rfl::capnproto::write; +} diff --git a/modules/rfl.cbor.cppm b/modules/rfl.cbor.cppm new file mode 100644 index 000000000..28df82b06 --- /dev/null +++ b/modules/rfl.cbor.cppm @@ -0,0 +1,14 @@ +module; + +#include "rfl/cbor.hpp" + +export module rfl.cbor; + +export import rfl; + +export namespace rfl::cbor { +using ::rfl::cbor::load; +using ::rfl::cbor::read; +using ::rfl::cbor::save; +using ::rfl::cbor::write; +} diff --git a/modules/rfl.cereal.cppm b/modules/rfl.cereal.cppm new file mode 100644 index 000000000..ebb9125e7 --- /dev/null +++ b/modules/rfl.cereal.cppm @@ -0,0 +1,14 @@ +module; + +#include "rfl/cereal.hpp" + +export module rfl.cereal; + +export import rfl; + +export namespace rfl::cereal { +using ::rfl::cereal::load; +using ::rfl::cereal::read; +using ::rfl::cereal::save; +using ::rfl::cereal::write; +} diff --git a/modules/rfl.cli.cppm b/modules/rfl.cli.cppm new file mode 100644 index 000000000..4a8882b8c --- /dev/null +++ b/modules/rfl.cli.cppm @@ -0,0 +1,11 @@ +module; + +#include "rfl/cli.hpp" + +export module rfl.cli; + +export import rfl; + +export namespace rfl::cli { +using ::rfl::cli::read; +} diff --git a/modules/rfl.cppm b/modules/rfl.cppm new file mode 100644 index 000000000..85fd70158 --- /dev/null +++ b/modules/rfl.cppm @@ -0,0 +1,128 @@ +module; + +#include "rfl.hpp" +#include "rfl/Deprecated.hpp" +#include "rfl/num_fields.hpp" + +export module rfl; + +export namespace rfl { +using ::rfl::AddNamespacedTagsToVariants; +using ::rfl::AddStructName; +using ::rfl::AddTagsToVariants; +using ::rfl::AllOf; +using ::rfl::AllowRawPtrs; +using ::rfl::AlphaNumeric; +using ::rfl::AnyOf; +using ::rfl::Attribute; +using ::rfl::Binary; +using ::rfl::Box; +using ::rfl::Bytestring; +using ::rfl::CamelCaseToSnakeCase; +using ::rfl::Commented; +using ::rfl::CopyableBox; +using ::rfl::DefaultIfMissing; +using ::rfl::DefaultVal; +using ::rfl::Deprecated; +using ::rfl::Description; +using ::rfl::Email; +using ::rfl::EqualTo; +using ::rfl::Error; +using ::rfl::ExtraFields; +using ::rfl::Field; +using ::rfl::Flatten; +using ::rfl::Generic; +using ::rfl::Hex; +using ::rfl::Literal; +using ::rfl::Maximum; +using ::rfl::Minimum; +using ::rfl::NamedTuple; +using ::rfl::NoExtraFields; +using ::rfl::NoFieldNames; +using ::rfl::NoOptionals; +using ::rfl::Object; +using ::rfl::Oct; +using ::rfl::OneOf; +using ::rfl::PatternValidator; +using ::rfl::Positional; +using ::rfl::Processors; +using ::rfl::Ref; +using ::rfl::Reflector; +using ::rfl::Rename; +using ::rfl::Result; +using ::rfl::Short; +using ::rfl::Size; +using ::rfl::Skip; +using ::rfl::SnakeCaseToCamelCase; +using ::rfl::SnakeCaseToPascalCase; +using ::rfl::TaggedUnion; +using ::rfl::Timestamp; +using ::rfl::Tuple; +using ::rfl::UnderlyingEnums; +using ::rfl::UUIDv4; +using ::rfl::Validator; +using ::rfl::Variant; +using ::rfl::Vectorstring; +using ::rfl::as; +using ::rfl::enum_to_string; +using ::rfl::error; +using ::rfl::fields; +using ::rfl::from_generic; +using ::rfl::from_named_tuple; +using ::rfl::get; +using ::rfl::get_enum_range; +using ::rfl::get_enumerator_array; +using ::rfl::get_enumerators; +using ::rfl::get_if; +using ::rfl::get_underlying_enumerator_array; +using ::rfl::get_underlying_enumerators; +using ::rfl::holds_alternative; +using ::rfl::make_box; +using ::rfl::make_field; +using ::rfl::make_named_tuple; +using ::rfl::make_ref; +using ::rfl::named_tuple_t; +using ::rfl::num_fields; +using ::rfl::operator<=>; +using ::rfl::operator*; +using ::rfl::operator==; +using ::rfl::replace; +using ::rfl::string_to_enum; +using ::rfl::to_generic; +using ::rfl::to_named_tuple; +using ::rfl::to_view; +using ::rfl::tuple_element_t; +using ::rfl::visit; +} + +export namespace rfl::atomic { +using ::rfl::atomic::remove_atomic_t; +using ::rfl::atomic::set_atomic; +} + +export namespace rfl::concepts { +using ::rfl::concepts::BackInsertableByteContainer; +using ::rfl::concepts::ByteLike; +using ::rfl::concepts::ContiguousByteContainer; +using ::rfl::concepts::MutableContiguousByteContainer; +} + +export namespace rfl::config { +using ::rfl::config::enum_descriptions; +using ::rfl::config::enum_range; +} + +export namespace rfl::internal { +using ::rfl::internal::Skip; +using ::rfl::internal::StringLiteral; +using ::rfl::internal::has_default_val_v; +} + +export namespace rfl::internal::enums { +using ::rfl::internal::enums::range_defined; +} + +export namespace rfl::parsing { +using ::rfl::parsing::CustomParser; +using ::rfl::parsing::Parser; +} diff --git a/modules/rfl.csv.cppm b/modules/rfl.csv.cppm new file mode 100644 index 000000000..3d345d7c3 --- /dev/null +++ b/modules/rfl.csv.cppm @@ -0,0 +1,15 @@ +module; + +#include "rfl/csv.hpp" + +export module rfl.csv; + +export import rfl; + +export namespace rfl::csv { +using ::rfl::csv::Settings; +using ::rfl::csv::load; +using ::rfl::csv::read; +using ::rfl::csv::save; +using ::rfl::csv::write; +} diff --git a/modules/rfl.flexbuf.cppm b/modules/rfl.flexbuf.cppm new file mode 100644 index 000000000..45cff8956 --- /dev/null +++ b/modules/rfl.flexbuf.cppm @@ -0,0 +1,14 @@ +module; + +#include "rfl/flexbuf.hpp" + +export module rfl.flexbuf; + +export import rfl; + +export namespace rfl::flexbuf { +using ::rfl::flexbuf::load; +using ::rfl::flexbuf::read; +using ::rfl::flexbuf::save; +using ::rfl::flexbuf::write; +} diff --git a/modules/rfl.json.cppm b/modules/rfl.json.cppm new file mode 100644 index 000000000..75747b28a --- /dev/null +++ b/modules/rfl.json.cppm @@ -0,0 +1,18 @@ +module; + +#include "rfl/json.hpp" + +export module rfl.json; + +export import rfl; + +export namespace rfl::json { +using ::rfl::json::Parser; +using ::rfl::json::Reader; +using ::rfl::json::Writer; +using ::rfl::json::load; +using ::rfl::json::read; +using ::rfl::json::save; +using ::rfl::json::to_schema; +using ::rfl::json::write; +} diff --git a/modules/rfl.msgpack.cppm b/modules/rfl.msgpack.cppm new file mode 100644 index 000000000..481f28249 --- /dev/null +++ b/modules/rfl.msgpack.cppm @@ -0,0 +1,14 @@ +module; + +#include "rfl/msgpack.hpp" + +export module rfl.msgpack; + +export import rfl; + +export namespace rfl::msgpack { +using ::rfl::msgpack::load; +using ::rfl::msgpack::read; +using ::rfl::msgpack::save; +using ::rfl::msgpack::write; +} diff --git a/modules/rfl.parquet.cppm b/modules/rfl.parquet.cppm new file mode 100644 index 000000000..43b335898 --- /dev/null +++ b/modules/rfl.parquet.cppm @@ -0,0 +1,16 @@ +module; + +#include "rfl/parquet.hpp" + +export module rfl.parquet; + +export import rfl; + +export namespace rfl::parquet { +using ::rfl::parquet::Compression; +using ::rfl::parquet::Settings; +using ::rfl::parquet::load; +using ::rfl::parquet::read; +using ::rfl::parquet::save; +using ::rfl::parquet::write; +} diff --git a/modules/rfl.toml.cppm b/modules/rfl.toml.cppm new file mode 100644 index 000000000..52ac9995d --- /dev/null +++ b/modules/rfl.toml.cppm @@ -0,0 +1,14 @@ +module; + +#include "rfl/toml.hpp" + +export module rfl.toml; + +export import rfl; + +export namespace rfl::toml { +using ::rfl::toml::load; +using ::rfl::toml::read; +using ::rfl::toml::save; +using ::rfl::toml::write; +} diff --git a/modules/rfl.ubjson.cppm b/modules/rfl.ubjson.cppm new file mode 100644 index 000000000..448b313a5 --- /dev/null +++ b/modules/rfl.ubjson.cppm @@ -0,0 +1,14 @@ +module; + +#include "rfl/ubjson.hpp" + +export module rfl.ubjson; + +export import rfl; + +export namespace rfl::ubjson { +using ::rfl::ubjson::load; +using ::rfl::ubjson::read; +using ::rfl::ubjson::save; +using ::rfl::ubjson::write; +} diff --git a/modules/rfl.xml.cppm b/modules/rfl.xml.cppm new file mode 100644 index 000000000..4a859d7c1 --- /dev/null +++ b/modules/rfl.xml.cppm @@ -0,0 +1,14 @@ +module; + +#include "rfl/xml.hpp" + +export module rfl.xml; + +export import rfl; + +export namespace rfl::xml { +using ::rfl::xml::load; +using ::rfl::xml::read; +using ::rfl::xml::save; +using ::rfl::xml::write; +} diff --git a/modules/rfl.yaml.cppm b/modules/rfl.yaml.cppm new file mode 100644 index 000000000..fefdef8f7 --- /dev/null +++ b/modules/rfl.yaml.cppm @@ -0,0 +1,15 @@ +module; + +#include "rfl/yaml.hpp" + +export module rfl.yaml; + +export import rfl; + +export namespace rfl::yaml { +using ::rfl::yaml::Writer; +using ::rfl::yaml::load; +using ::rfl::yaml::read; +using ::rfl::yaml::save; +using ::rfl::yaml::write; +} diff --git a/modules/rfl.yas.cppm b/modules/rfl.yas.cppm new file mode 100644 index 000000000..1074e77d4 --- /dev/null +++ b/modules/rfl.yas.cppm @@ -0,0 +1,14 @@ +module; + +#include "rfl/yas.hpp" + +export module rfl.yas; + +export import rfl; + +export namespace rfl::yas { +using ::rfl::yas::load; +using ::rfl::yas::read; +using ::rfl::yas::save; +using ::rfl::yas::write; +} From 46637bbab0e3cce2c672bdb1ff005c026ba6e743 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Thu, 16 Jul 2026 20:28:04 +0800 Subject: [PATCH 07/18] test: migrate module-compatible tests to import Co-authored-by: Codex Co-authored-by: Claude Code --- tests/avro/CMakeLists.txt | 2 +- tests/avro/test_add_struct_name.cpp | 1 + tests/avro/test_array.cpp | 7 +++++-- tests/avro/test_box.cpp | 6 +++++- tests/avro/test_bytestring.cpp | 6 +++++- tests/avro/test_combined_processors.cpp | 1 + tests/avro/test_custom_class1.cpp | 4 +++- tests/avro/test_custom_class3.cpp | 4 +++- tests/avro/test_custom_class4.cpp | 4 +++- tests/avro/test_default_values.cpp | 4 +++- tests/avro/test_deque.cpp | 8 +++++++- tests/avro/test_enum.cpp | 6 ++++-- tests/avro/test_field_variant.cpp | 4 +++- tests/avro/test_field_variant_std.cpp | 6 +++++- tests/avro/test_flag_enum.cpp | 4 +++- tests/avro/test_flag_enum_with_int.cpp | 4 +++- tests/avro/test_flatten.cpp | 4 +++- tests/avro/test_flatten_anonymous.cpp | 4 +++- tests/avro/test_float_and_int.cpp | 1 + tests/avro/test_forward_list.cpp | 8 +++++++- tests/avro/test_literal.cpp | 6 ++++-- tests/avro/test_literal_map.cpp | 4 +++- tests/avro/test_map.cpp | 9 +++++++-- tests/avro/test_map2.cpp | 8 ++++++-- tests/avro/test_monster_example.cpp | 4 +++- tests/avro/test_optional_fields.cpp | 8 ++++++-- tests/avro/test_readme_example.cpp | 4 +++- tests/avro/test_readme_example2.cpp | 4 +++- tests/avro/test_readme_example3.cpp | 4 +++- tests/avro/test_ref.cpp | 6 +++++- tests/avro/test_regression_bugs.cpp | 6 +++--- tests/avro/test_rfl_tuple.cpp | 8 ++++++-- tests/avro/test_rfl_variant.cpp | 6 +++++- tests/avro/test_save_load.cpp | 5 +++-- tests/avro/test_set.cpp | 8 +++++++- tests/avro/test_shared_ptr.cpp | 8 ++++++-- tests/avro/test_size.cpp | 4 +++- tests/avro/test_snake_case_to_camel_case.cpp | 1 + tests/avro/test_snake_case_to_pascal_case.cpp | 1 + tests/avro/test_string_map.cpp | 6 ++++-- tests/avro/test_tagged_union.cpp | 4 +++- tests/avro/test_timestamp.cpp | 4 +++- tests/avro/test_tuple.cpp | 8 ++++++-- tests/avro/test_tutorial_example.cpp | 5 +++-- tests/avro/test_tutorial_example_automated_schema.cpp | 5 +++-- tests/avro/test_unique_ptr.cpp | 8 ++++++-- tests/avro/test_unique_ptr2.cpp | 7 ++++++- tests/avro/test_variant.cpp | 7 ++++++- tests/avro/test_wstring.cpp | 4 +++- tests/avro/write_and_read.hpp | 7 +++++-- tests/boost_serialization/CMakeLists.txt | 2 +- tests/boost_serialization/test_add_struct_name.cpp | 1 + tests/boost_serialization/test_array.cpp | 7 +++++-- tests/boost_serialization/test_box.cpp | 6 +++++- tests/boost_serialization/test_combined_processors.cpp | 1 + tests/boost_serialization/test_custom_class1.cpp | 4 +++- tests/boost_serialization/test_custom_class3.cpp | 4 +++- tests/boost_serialization/test_custom_class4.cpp | 4 +++- tests/boost_serialization/test_default_values.cpp | 4 +++- tests/boost_serialization/test_deque.cpp | 8 +++++++- tests/boost_serialization/test_enum.cpp | 4 +++- tests/boost_serialization/test_field_variant.cpp | 4 +++- tests/boost_serialization/test_flag_enum.cpp | 4 +++- tests/boost_serialization/test_flag_enum_with_int.cpp | 4 +++- tests/boost_serialization/test_flatten.cpp | 4 +++- tests/boost_serialization/test_flatten_anonymous.cpp | 4 +++- tests/boost_serialization/test_forward_list.cpp | 8 +++++++- tests/boost_serialization/test_generic.cpp | 5 +++-- tests/boost_serialization/test_literal.cpp | 4 +++- tests/boost_serialization/test_literal_map.cpp | 4 +++- tests/boost_serialization/test_map.cpp | 6 +++++- .../test_map_with_key_validation.cpp | 7 ++++++- tests/boost_serialization/test_monster_example.cpp | 4 +++- tests/boost_serialization/test_readme_example.cpp | 4 +++- tests/boost_serialization/test_readme_example2.cpp | 4 +++- tests/boost_serialization/test_ref.cpp | 6 +++++- tests/boost_serialization/test_save_load.cpp | 5 +++-- tests/boost_serialization/test_set.cpp | 8 +++++++- tests/boost_serialization/test_size.cpp | 4 +++- .../test_snake_case_to_camel_case.cpp | 1 + .../test_snake_case_to_pascal_case.cpp | 1 + tests/boost_serialization/test_string_map.cpp | 4 +++- tests/boost_serialization/test_tagged_union.cpp | 4 +++- tests/boost_serialization/test_timestamp.cpp | 4 +++- tests/boost_serialization/test_unique_ptr.cpp | 6 +++++- tests/boost_serialization/test_unique_ptr2.cpp | 7 ++++++- tests/boost_serialization/test_variant.cpp | 7 ++++++- tests/boost_serialization/write_and_read.hpp | 7 +++++-- tests/bson/CMakeLists.txt | 2 +- tests/bson/test_add_struct_name.cpp | 1 + tests/bson/test_array.cpp | 7 +++++-- tests/bson/test_box.cpp | 6 +++++- tests/bson/test_bytestring.cpp | 6 +++++- tests/bson/test_combined_processors.cpp | 1 + tests/bson/test_custom_class1.cpp | 4 +++- tests/bson/test_custom_class3.cpp | 4 +++- tests/bson/test_custom_class4.cpp | 4 +++- tests/bson/test_default_values.cpp | 4 +++- tests/bson/test_deque.cpp | 8 +++++++- tests/bson/test_enum.cpp | 4 +++- tests/bson/test_field_variant.cpp | 4 +++- tests/bson/test_flag_enum.cpp | 4 +++- tests/bson/test_flag_enum_with_int.cpp | 4 +++- tests/bson/test_flatten.cpp | 4 +++- tests/bson/test_flatten_anonymous.cpp | 4 +++- tests/bson/test_forward_list.cpp | 8 +++++++- tests/bson/test_literal.cpp | 4 +++- tests/bson/test_literal_map.cpp | 4 +++- tests/bson/test_map.cpp | 6 +++++- tests/bson/test_map_with_key_validation.cpp | 7 ++++++- tests/bson/test_monster_example.cpp | 4 +++- tests/bson/test_oid.cpp | 6 +++++- tests/bson/test_readme_example.cpp | 4 +++- tests/bson/test_readme_example2.cpp | 4 +++- tests/bson/test_ref.cpp | 6 +++++- tests/bson/test_regression_bugs.cpp | 5 +++-- tests/bson/test_save_load.cpp | 5 +++-- tests/bson/test_set.cpp | 8 +++++++- tests/bson/test_size.cpp | 4 +++- tests/bson/test_snake_case_to_camel_case.cpp | 1 + tests/bson/test_snake_case_to_pascal_case.cpp | 1 + tests/bson/test_string_map.cpp | 4 +++- tests/bson/test_tagged_union.cpp | 4 +++- tests/bson/test_timestamp.cpp | 4 +++- tests/bson/test_unique_ptr.cpp | 6 +++++- tests/bson/test_unique_ptr2.cpp | 7 ++++++- tests/bson/test_variant.cpp | 7 ++++++- tests/bson/test_vectorstring.cpp | 4 +++- tests/bson/test_wstring.cpp | 4 +++- tests/bson/write_and_read.hpp | 5 ++++- tests/capnproto/CMakeLists.txt | 2 +- .../compile_fail/capnproto_read_istream_schema.cpp | 5 +++-- tests/capnproto/test_add_struct_name.cpp | 1 + tests/capnproto/test_array.cpp | 7 +++++-- tests/capnproto/test_box.cpp | 6 +++++- tests/capnproto/test_bytestring.cpp | 6 +++++- tests/capnproto/test_custom_class1.cpp | 4 +++- tests/capnproto/test_custom_class3.cpp | 4 +++- tests/capnproto/test_custom_class4.cpp | 6 +++++- tests/capnproto/test_default_values.cpp | 4 +++- tests/capnproto/test_deque.cpp | 8 +++++++- tests/capnproto/test_enum.cpp | 6 ++++-- tests/capnproto/test_field_variant.cpp | 4 +++- tests/capnproto/test_field_variant_std.cpp | 6 +++++- tests/capnproto/test_flag_enum.cpp | 4 +++- tests/capnproto/test_flag_enum_with_int.cpp | 4 +++- tests/capnproto/test_flatten.cpp | 4 +++- tests/capnproto/test_flatten_anonymous.cpp | 4 +++- tests/capnproto/test_forward_list.cpp | 8 +++++++- tests/capnproto/test_literal.cpp | 6 ++++-- tests/capnproto/test_literal_map.cpp | 4 +++- tests/capnproto/test_map.cpp | 9 +++++++-- tests/capnproto/test_map2.cpp | 8 ++++++-- tests/capnproto/test_map_value_types.cpp | 6 +++++- tests/capnproto/test_monster_example.cpp | 4 +++- tests/capnproto/test_optional_fields.cpp | 8 ++++++-- tests/capnproto/test_optionals_in_vectors.cpp | 8 ++++++-- tests/capnproto/test_person.cpp | 5 +++-- tests/capnproto/test_readme_example.cpp | 4 +++- tests/capnproto/test_readme_example2.cpp | 4 +++- tests/capnproto/test_readme_example3.cpp | 4 +++- tests/capnproto/test_ref.cpp | 6 +++++- tests/capnproto/test_rfl_tuple.cpp | 8 ++++++-- tests/capnproto/test_rfl_variant.cpp | 6 +++++- tests/capnproto/test_save_load.cpp | 5 +++-- tests/capnproto/test_set.cpp | 8 +++++++- tests/capnproto/test_shared_ptr.cpp | 8 ++++++-- tests/capnproto/test_size.cpp | 4 +++- tests/capnproto/test_string_map.cpp | 6 ++++-- tests/capnproto/test_tagged_union.cpp | 4 +++- tests/capnproto/test_timestamp.cpp | 4 +++- tests/capnproto/test_tuple.cpp | 8 ++++++-- tests/capnproto/test_tutorial_example.cpp | 5 +++-- tests/capnproto/test_uint64.cpp | 4 +++- tests/capnproto/test_unique_ptr.cpp | 8 ++++++-- tests/capnproto/test_unique_ptr2.cpp | 7 ++++++- tests/capnproto/test_variant.cpp | 7 ++++++- tests/capnproto/test_variants_in_vectors.cpp | 8 ++++++-- tests/capnproto/test_wstring.cpp | 4 +++- tests/capnproto/write_and_read.hpp | 5 ++++- tests/cbor/CMakeLists.txt | 2 +- tests/cbor/test_add_struct_name.cpp | 1 + tests/cbor/test_array.cpp | 7 +++++-- tests/cbor/test_box.cpp | 6 +++++- tests/cbor/test_bytestring.cpp | 6 +++++- tests/cbor/test_combined_processors.cpp | 1 + tests/cbor/test_custom_class1.cpp | 4 +++- tests/cbor/test_custom_class3.cpp | 4 +++- tests/cbor/test_custom_class4.cpp | 4 +++- tests/cbor/test_default_values.cpp | 4 +++- tests/cbor/test_deque.cpp | 8 +++++++- tests/cbor/test_enum.cpp | 4 +++- tests/cbor/test_error_messages.cpp | 7 ++++--- tests/cbor/test_extra_fields.cpp | 4 +++- tests/cbor/test_field_variant.cpp | 4 +++- tests/cbor/test_flag_enum.cpp | 4 +++- tests/cbor/test_flag_enum_with_int.cpp | 4 +++- tests/cbor/test_flatten.cpp | 4 +++- tests/cbor/test_flatten_anonymous.cpp | 4 +++- tests/cbor/test_forward_list.cpp | 8 +++++++- tests/cbor/test_integers.cpp | 3 ++- tests/cbor/test_literal.cpp | 4 +++- tests/cbor/test_literal_map.cpp | 4 +++- tests/cbor/test_map.cpp | 6 +++++- tests/cbor/test_map_with_key_validation.cpp | 7 ++++++- tests/cbor/test_monster_example.cpp | 4 +++- tests/cbor/test_no_optionals.cpp | 7 +++++-- tests/cbor/test_optional_fields.cpp | 7 +++++-- tests/cbor/test_read_byte_containers.cpp | 9 +++++++-- tests/cbor/test_readme_example.cpp | 4 +++- tests/cbor/test_readme_example2.cpp | 4 +++- tests/cbor/test_ref.cpp | 6 +++++- tests/cbor/test_save_load.cpp | 5 +++-- tests/cbor/test_set.cpp | 8 +++++++- tests/cbor/test_size.cpp | 4 +++- tests/cbor/test_snake_case_to_camel_case.cpp | 1 + tests/cbor/test_snake_case_to_pascal_case.cpp | 1 + tests/cbor/test_string_map.cpp | 4 +++- tests/cbor/test_tagged_union.cpp | 4 +++- tests/cbor/test_tagged_union2.cpp | 4 +++- tests/cbor/test_timestamp.cpp | 4 +++- tests/cbor/test_unique_ptr.cpp | 6 +++++- tests/cbor/test_unique_ptr2.cpp | 7 ++++++- tests/cbor/test_variant.cpp | 7 ++++++- tests/cbor/test_variant_auto_tagging.cpp | 6 +++++- tests/cbor/test_vectorstring.cpp | 4 +++- tests/cbor/test_wstring.cpp | 4 +++- tests/cbor/write_and_read.hpp | 9 ++++++++- tests/cereal/CMakeLists.txt | 2 +- tests/cereal/test_add_struct_name.cpp | 1 + tests/cereal/test_array.cpp | 7 +++++-- tests/cereal/test_box.cpp | 7 +++++-- tests/cereal/test_bytestring.cpp | 6 +++++- tests/cereal/test_custom_class1.cpp | 4 +++- tests/cereal/test_custom_class3.cpp | 4 +++- tests/cereal/test_custom_class4.cpp | 6 +++++- tests/cereal/test_default_values.cpp | 4 +++- tests/cereal/test_deque.cpp | 8 +++++++- tests/cereal/test_enum.cpp | 5 +++-- tests/cereal/test_field_variant.cpp | 4 +++- tests/cereal/test_field_variant_std.cpp | 6 +++++- tests/cereal/test_flag_enum.cpp | 4 +++- tests/cereal/test_flag_enum_with_int.cpp | 4 +++- tests/cereal/test_flatten.cpp | 4 +++- tests/cereal/test_flatten_anonymous.cpp | 4 +++- tests/cereal/test_forward_list.cpp | 8 +++++++- tests/cereal/test_generic.cpp | 5 +++-- tests/cereal/test_literal.cpp | 6 ++++-- tests/cereal/test_literal_map.cpp | 4 +++- tests/cereal/test_map.cpp | 8 ++++++-- tests/cereal/test_map2.cpp | 8 ++++++-- tests/cereal/test_monster_example.cpp | 4 +++- tests/cereal/test_optional_fields.cpp | 7 +++++-- tests/cereal/test_optionals_in_vectors.cpp | 8 ++++++-- tests/cereal/test_person.cpp | 5 +++-- tests/cereal/test_readme_example.cpp | 5 +++-- tests/cereal/test_readme_example2.cpp | 4 +++- tests/cereal/test_readme_example3.cpp | 4 +++- tests/cereal/test_ref.cpp | 6 +++++- tests/cereal/test_rfl_tuple.cpp | 8 ++++++-- tests/cereal/test_rfl_variant.cpp | 6 +++++- tests/cereal/test_save_load.cpp | 5 +++-- tests/cereal/test_set.cpp | 8 +++++++- tests/cereal/test_shared_ptr.cpp | 8 ++++++-- tests/cereal/test_size.cpp | 4 +++- tests/cereal/test_string_map.cpp | 6 ++++-- tests/cereal/test_tagged_union.cpp | 5 +++-- tests/cereal/test_timestamp.cpp | 5 +++-- tests/cereal/test_tuple.cpp | 5 +++-- tests/cereal/test_unique_ptr.cpp | 7 +++++-- tests/cereal/test_unique_ptr2.cpp | 7 ++++++- tests/cereal/test_variant.cpp | 7 +++++-- tests/cereal/test_variants_in_vectors.cpp | 8 ++++++-- tests/cereal/test_wstring.cpp | 4 +++- tests/cereal/write_and_read.hpp | 5 ++++- tests/cli/CMakeLists.txt | 2 +- tests/cli/test_basic.cpp | 5 +++-- tests/cli/test_bool_short_positional.cpp | 5 +++-- tests/cli/test_enum.cpp | 5 +++-- tests/cli/test_errors.cpp | 5 +++-- tests/cli/test_flatten.cpp | 5 +++-- tests/cli/test_kebab_case.cpp | 5 +++-- tests/cli/test_nested.cpp | 5 +++-- tests/cli/test_optional.cpp | 5 +++-- tests/cli/test_positional.cpp | 7 +++++-- tests/cli/test_positional_and_short.cpp | 5 +++-- tests/cli/test_regression_bugs.cpp | 5 +++-- tests/cli/test_rename.cpp | 5 +++-- tests/cli/test_settings_macro.cpp | 4 ++++ tests/cli/test_short.cpp | 5 +++-- tests/cli/test_vector.cpp | 5 +++-- tests/csv/CMakeLists.txt | 2 +- tests/csv/test_boolean.cpp | 3 ++- tests/csv/test_box.cpp | 3 ++- tests/csv/test_bytestring.cpp | 5 ++++- tests/csv/test_camel_case.cpp | 3 ++- tests/csv/test_deque.cpp | 3 ++- tests/csv/test_enums.cpp | 3 ++- tests/csv/test_flatten.cpp | 3 ++- tests/csv/test_literal.cpp | 3 ++- tests/csv/test_optionals.cpp | 3 ++- tests/csv/test_readme_example.cpp | 3 ++- tests/csv/test_ref.cpp | 3 ++- tests/csv/test_save_load.cpp | 5 +++-- tests/csv/test_settings.cpp | 3 ++- tests/csv/test_shared_ptr.cpp | 3 ++- tests/csv/test_unique_ptr.cpp | 3 ++- tests/csv/write_and_read.hpp | 5 ++++- tests/flexbuffers/CMakeLists.txt | 2 +- tests/flexbuffers/test_add_struct_name.cpp | 1 + tests/flexbuffers/test_array.cpp | 7 +++++-- tests/flexbuffers/test_box.cpp | 6 +++++- tests/flexbuffers/test_bytestring.cpp | 6 +++++- tests/flexbuffers/test_combined_processors.cpp | 1 + tests/flexbuffers/test_custom_class1.cpp | 4 +++- tests/flexbuffers/test_custom_class3.cpp | 4 +++- tests/flexbuffers/test_custom_class4.cpp | 4 +++- tests/flexbuffers/test_default_values.cpp | 4 +++- tests/flexbuffers/test_deque.cpp | 8 +++++++- tests/flexbuffers/test_enum.cpp | 4 +++- tests/flexbuffers/test_field_variant.cpp | 4 +++- tests/flexbuffers/test_flag_enum.cpp | 4 +++- tests/flexbuffers/test_flag_enum_with_int.cpp | 4 +++- tests/flexbuffers/test_flatten.cpp | 4 +++- tests/flexbuffers/test_flatten_anonymous.cpp | 4 +++- tests/flexbuffers/test_forward_list.cpp | 8 +++++++- tests/flexbuffers/test_literal.cpp | 4 +++- tests/flexbuffers/test_literal_map.cpp | 4 +++- tests/flexbuffers/test_map.cpp | 6 +++++- tests/flexbuffers/test_map_with_key_validation.cpp | 7 ++++++- tests/flexbuffers/test_monster_example.cpp | 4 +++- tests/flexbuffers/test_readme_example.cpp | 4 +++- tests/flexbuffers/test_readme_example2.cpp | 4 +++- tests/flexbuffers/test_ref.cpp | 6 +++++- tests/flexbuffers/test_save_load.cpp | 5 +++-- tests/flexbuffers/test_set.cpp | 8 +++++++- tests/flexbuffers/test_size.cpp | 4 +++- tests/flexbuffers/test_snake_case_to_camel_case.cpp | 1 + tests/flexbuffers/test_snake_case_to_pascal_case.cpp | 1 + tests/flexbuffers/test_string_map.cpp | 4 +++- tests/flexbuffers/test_tagged_union.cpp | 4 +++- tests/flexbuffers/test_tagged_union2.cpp | 4 +++- tests/flexbuffers/test_timestamp.cpp | 4 +++- tests/flexbuffers/test_unique_ptr.cpp | 6 +++++- tests/flexbuffers/test_unique_ptr2.cpp | 7 ++++++- tests/flexbuffers/test_variant.cpp | 7 ++++++- tests/flexbuffers/test_wstring.cpp | 4 +++- tests/flexbuffers/write_and_read.hpp | 5 ++++- .../compile_fail/flatten_cross_type_move_assign.cpp | 6 +++++- tests/generic/test_array.cpp | 5 ++++- tests/generic/test_bad_access_error.cpp | 6 +++++- tests/generic/test_box.cpp | 5 ++++- tests/generic/test_byte_containers.cpp | 8 +++++++- tests/generic/test_custom_class1.cpp | 3 ++- tests/generic/test_custom_class3.cpp | 3 ++- tests/generic/test_custom_class4.cpp | 3 ++- tests/generic/test_default_values.cpp | 3 ++- tests/generic/test_deque.cpp | 7 ++++++- tests/generic/test_enum.cpp | 3 ++- tests/generic/test_enum_range.cpp | 9 ++++----- tests/generic/test_enum_range_min_max.cpp | 10 ++++------ tests/generic/test_enum_range_size.cpp | 5 +---- tests/generic/test_field.cpp | 5 ++++- tests/generic/test_field_variant.cpp | 3 ++- tests/generic/test_flag_enum.cpp | 3 ++- tests/generic/test_flag_enum_with_int.cpp | 3 ++- tests/generic/test_flatten.cpp | 5 ++++- tests/generic/test_flatten_anonymous.cpp | 3 ++- tests/generic/test_forward_list.cpp | 7 ++++++- tests/generic/test_generic.cpp | 3 ++- tests/generic/test_literal.cpp | 3 ++- tests/generic/test_literal_map.cpp | 3 ++- tests/generic/test_map.cpp | 5 ++++- tests/generic/test_map_with_key_validation.cpp | 6 +++++- tests/generic/test_monster_example.cpp | 3 ++- tests/generic/test_object.cpp | 3 ++- tests/generic/test_optional.cpp | 5 ++++- tests/generic/test_readme_example.cpp | 3 ++- tests/generic/test_readme_example2.cpp | 3 ++- tests/generic/test_ref.cpp | 5 ++++- tests/generic/test_result.cpp | 3 ++- tests/generic/test_set.cpp | 7 ++++++- tests/generic/test_size.cpp | 3 ++- tests/generic/test_skip.cpp | 5 ++++- tests/generic/test_string_map.cpp | 3 ++- tests/generic/test_tagged_union.cpp | 5 ++++- tests/generic/test_timestamp.cpp | 3 ++- tests/generic/test_tuple.cpp | 5 +++-- tests/generic/test_unique_ptr.cpp | 5 ++++- tests/generic/test_unique_ptr2.cpp | 6 +++++- tests/generic/test_variant.cpp | 6 +++++- tests/generic/test_wstring.cpp | 3 ++- tests/generic/write_and_read.hpp | 5 ++++- tests/json/CMakeLists.txt | 2 +- .../json/test_add_namespaced_tags_to_rfl_variants.cpp | 7 +++++-- tests/json/test_add_namespaced_tags_to_variants.cpp | 5 +++-- tests/json/test_add_struct_name.cpp | 5 +++-- tests/json/test_add_tags_to_rfl_variants.cpp | 5 +++-- tests/json/test_add_tags_to_variants.cpp | 5 +++-- tests/json/test_all_of.cpp | 5 +++-- tests/json/test_alphanumeric_map.cpp | 5 +++-- tests/json/test_alphanumeric_unordered_map.cpp | 5 +++-- tests/json/test_and_then.cpp | 5 +++-- tests/json/test_anonymous_fields.cpp | 5 +++-- tests/json/test_any_of.cpp | 5 +++-- tests/json/test_apply.cpp | 5 +++-- tests/json/test_apply_on_named_tuple.cpp | 5 +++-- tests/json/test_array.cpp | 7 +++++-- tests/json/test_array2.cpp | 3 ++- tests/json/test_as.cpp | 7 +++++-- tests/json/test_as2.cpp | 7 +++++-- tests/json/test_as_flatten.cpp | 7 +++++-- tests/json/test_atomic.cpp | 8 ++++++-- tests/json/test_atomic_array.cpp | 8 ++++++-- tests/json/test_atomic_box.cpp | 7 +++++-- tests/json/test_atomic_negative.cpp | 5 +++-- tests/json/test_atomic_ref.cpp | 7 +++++-- tests/json/test_atomic_shared_ptr.cpp | 8 ++++++-- tests/json/test_atomic_unique_ptr.cpp | 8 ++++++-- tests/json/test_binary.cpp | 5 +++-- tests/json/test_box.cpp | 7 +++++-- tests/json/test_box2.cpp | 8 ++++++-- tests/json/test_camel_case_to_snake_case_rename.cpp | 5 +++-- tests/json/test_chrono_duration.cpp | 5 +++-- tests/json/test_combined_processors.cpp | 5 +++-- tests/json/test_const_fields.cpp | 5 +++-- tests/json/test_custom_class1.cpp | 5 +++-- tests/json/test_custom_class2.cpp | 5 +++-- tests/json/test_custom_class3.cpp | 5 +++-- tests/json/test_custom_class4.cpp | 5 +++-- tests/json/test_custom_constructor.cpp | 7 +++++-- tests/json/test_custom_enum1.cpp | 5 +++-- tests/json/test_deep_nested.cpp | 5 +++-- tests/json/test_default_if_missing.cpp | 5 +++-- tests/json/test_default_if_missing_no_field_names.cpp | 5 +++-- tests/json/test_default_val.cpp | 5 +++-- tests/json/test_default_val_no_field_names.cpp | 5 +++-- tests/json/test_default_values.cpp | 5 +++-- tests/json/test_deque.cpp | 9 +++++++-- tests/json/test_duration.cpp | 5 +++-- tests/json/test_duration_conversion.cpp | 5 +++-- tests/json/test_duration_default.cpp | 6 +++--- tests/json/test_email.cpp | 5 +++-- tests/json/test_empty_object.cpp | 5 +++-- tests/json/test_enum1.cpp | 5 +++-- tests/json/test_enum2.cpp | 5 +++-- tests/json/test_enum3.cpp | 5 +++-- tests/json/test_enum4.cpp | 5 +++-- tests/json/test_enum5.cpp | 5 +++-- tests/json/test_enum6.cpp | 5 +++-- tests/json/test_enum7.cpp | 5 +++-- tests/json/test_enum8.cpp | 5 +++-- tests/json/test_enum_descriptions.cpp | 7 +++++-- tests/json/test_enum_error_messages.cpp | 7 +++++-- tests/json/test_enum_underlying.cpp | 3 ++- tests/json/test_error_messages.cpp | 5 +++-- tests/json/test_extra_fields.cpp | 5 +++-- tests/json/test_extra_fields_with_no_extra_fields.cpp | 5 +++-- tests/json/test_field_variant.cpp | 5 +++-- tests/json/test_field_variant_std.cpp | 7 +++++-- tests/json/test_filepath.cpp | 5 +++-- tests/json/test_flag_enum1.cpp | 5 +++-- tests/json/test_flag_enum2.cpp | 5 +++-- tests/json/test_flag_enum_with_int.cpp | 5 +++-- tests/json/test_flatten.cpp | 5 +++-- tests/json/test_flatten_anonymous.cpp | 5 +++-- tests/json/test_forward_list.cpp | 9 +++++++-- tests/json/test_generic.cpp | 5 +++-- tests/json/test_generic2.cpp | 5 +++-- tests/json/test_hex.cpp | 5 +++-- tests/json/test_inside_function.cpp | 5 +++-- tests/json/test_integers.cpp | 5 +++-- tests/json/test_json_schema.cpp | 5 +++-- tests/json/test_json_schema2.cpp | 5 +++-- tests/json/test_json_schema3.cpp | 5 +++-- tests/json/test_json_schema4.cpp | 5 +++-- tests/json/test_json_schema5.cpp | 5 +++-- tests/json/test_json_schema6.cpp | 5 +++-- tests/json/test_json_schema7.cpp | 5 +++-- tests/json/test_json_schema_deprecation.cpp | 5 +++-- tests/json/test_json_schema_size_validation.cpp | 5 +++-- tests/json/test_leak.cpp | 7 +++++-- tests/json/test_leak_arr.cpp | 8 ++++++-- tests/json/test_leak_rfl_tup.cpp | 7 +++++-- tests/json/test_leak_tup.cpp | 7 +++++-- tests/json/test_list.cpp | 9 +++++++-- tests/json/test_literal.cpp | 5 +++-- tests/json/test_literal_map.cpp | 5 +++-- tests/json/test_literal_unordered_map.cpp | 5 +++-- tests/json/test_many_fields.cpp | 5 +++-- tests/json/test_map.cpp | 8 ++++++-- tests/json/test_map_with_custom_less.cpp | 7 +++++-- tests/json/test_map_with_key_validation.cpp | 8 ++++++-- tests/json/test_meta_fields.cpp | 6 +++++- tests/json/test_monster_example.cpp | 7 +++++-- tests/json/test_movable.cpp | 7 ++++--- tests/json/test_move_replace.cpp | 7 +++++-- tests/json/test_multimap.cpp | 8 ++++++-- tests/json/test_multiset.cpp | 9 +++++++-- tests/json/test_named_tuple.cpp | 5 +++-- tests/json/test_no_extra_fields.cpp | 5 +++-- tests/json/test_no_extra_fields_with_default.cpp | 5 +++-- tests/json/test_no_optionals.cpp | 7 +++++-- tests/json/test_object.cpp | 3 ++- tests/json/test_oct.cpp | 5 +++-- tests/json/test_one_of.cpp | 5 +++-- tests/json/test_optional_fields.cpp | 7 +++++-- tests/json/test_pointer_fields.cpp | 7 +++++-- tests/json/test_positional_and_short.cpp | 5 +++-- tests/json/test_readme_example.cpp | 5 +++-- tests/json/test_ref.cpp | 7 +++++-- tests/json/test_reflector.cpp | 5 +++-- tests/json/test_reflector_read.cpp | 5 +++-- tests/json/test_reflector_schema.cpp | 5 +++-- tests/json/test_reflector_write.cpp | 5 +++-- tests/json/test_regression_bugs.cpp | 9 +++++++-- tests/json/test_replace.cpp | 7 +++++-- tests/json/test_replace2.cpp | 7 +++++-- tests/json/test_replace_flatten.cpp | 7 +++++-- tests/json/test_replace_flatten2.cpp | 7 +++++-- tests/json/test_replace_with_other_struct.cpp | 5 +++-- tests/json/test_replace_with_other_struct2.cpp | 5 +++-- tests/json/test_result.cpp | 5 +++-- tests/json/test_rfl_tagged_union_visit_move_only.cpp | 6 +++--- tests/json/test_rfl_tuple.cpp | 7 +++++-- tests/json/test_rfl_variant.cpp | 7 +++++-- tests/json/test_rfl_variant_emplace.cpp | 7 +++++-- tests/json/test_rfl_variant_get_if.cpp | 7 +++++-- tests/json/test_rfl_variant_holds_alternative.cpp | 7 +++++-- tests/json/test_rfl_variant_swap.cpp | 7 +++++-- tests/json/test_rfl_variant_visit.cpp | 7 +++++-- tests/json/test_rfl_variant_visit_in_place.cpp | 7 +++++-- tests/json/test_rfl_variant_visit_lvalues.cpp | 5 +++-- tests/json/test_rfl_variant_visit_move_only.cpp | 5 +++-- tests/json/test_save_load.cpp | 5 +++-- tests/json/test_segfault.cpp | 5 +++-- tests/json/test_set.cpp | 8 ++++++-- tests/json/test_shared_ptr.cpp | 7 +++++-- tests/json/test_size.cpp | 5 +++-- tests/json/test_skip.cpp | 5 +++-- tests/json/test_skip2.cpp | 5 +++-- tests/json/test_snake_case_to_camel_case.cpp | 5 +++-- tests/json/test_snake_case_to_camel_case_rename.cpp | 5 +++-- tests/json/test_snake_case_to_pascal_case.cpp | 5 +++-- tests/json/test_snake_case_to_pascal_case_rename.cpp | 5 +++-- tests/json/test_span.cpp | 5 +++-- tests/json/test_std_ref.cpp | 5 +++-- tests/json/test_string_map.cpp | 5 +++-- tests/json/test_string_unordered_map.cpp | 5 +++-- tests/json/test_string_view.cpp | 7 +++++-- tests/json/test_strip_field_names.cpp | 5 +++-- tests/json/test_tagged_union.cpp | 5 +++-- tests/json/test_tagged_union2.cpp | 5 +++-- tests/json/test_tagged_union3.cpp | 5 +++-- tests/json/test_tagged_union4.cpp | 5 +++-- tests/json/test_tagged_union5.cpp | 7 +++++-- tests/json/test_tagged_union_with_no_extra_fields.cpp | 5 +++-- tests/json/test_template.cpp | 5 +++-- tests/json/test_time_point.cpp | 5 +++-- tests/json/test_timestamp.cpp | 5 +++-- tests/json/test_transform.cpp | 5 +++-- tests/json/test_tuple.cpp | 7 +++++-- tests/json/test_underlying_enums.cpp | 5 +++-- tests/json/test_unique_ptr.cpp | 7 +++++-- tests/json/test_unique_ptr2.cpp | 8 ++++++-- tests/json/test_unnamed_namespace.cpp | 5 +++-- tests/json/test_unordered_map.cpp | 8 ++++++-- tests/json/test_unordered_map_with_custom_hash.cpp | 9 +++++++-- tests/json/test_unordered_multimap.cpp | 9 +++++++-- tests/json/test_unordered_multiset.cpp | 9 +++++++-- tests/json/test_unordered_set.cpp | 9 +++++++-- tests/json/test_uuid.cpp | 5 +++-- tests/json/test_validation_with_fields.cpp | 7 +++++-- tests/json/test_variant.cpp | 8 ++++++-- tests/json/test_view.cpp | 5 +++-- tests/json/test_wstring.cpp | 5 +++-- tests/json/write_and_read.hpp | 4 +++- tests/json_c_arrays_and_inheritance/CMakeLists.txt | 4 +--- .../json_c_arrays_and_inheritance/test_inheritance.cpp | 3 ++- .../test_inheritance2.cpp | 4 ++-- tests/json_c_arrays_and_inheritance/write_and_read.hpp | 4 +++- tests/msgpack/CMakeLists.txt | 2 +- tests/msgpack/test_add_struct_name.cpp | 1 + tests/msgpack/test_array.cpp | 7 +++++-- tests/msgpack/test_box.cpp | 6 +++++- tests/msgpack/test_bytestring.cpp | 6 +++++- tests/msgpack/test_combined_processors.cpp | 1 + tests/msgpack/test_custom_class1.cpp | 4 +++- tests/msgpack/test_custom_class3.cpp | 4 +++- tests/msgpack/test_custom_class4.cpp | 4 +++- tests/msgpack/test_default_values.cpp | 4 +++- tests/msgpack/test_deque.cpp | 8 +++++++- tests/msgpack/test_enum.cpp | 4 +++- tests/msgpack/test_extra_fields.cpp | 4 +++- tests/msgpack/test_field_variant.cpp | 4 +++- tests/msgpack/test_flag_enum.cpp | 4 +++- tests/msgpack/test_flag_enum_with_int.cpp | 4 +++- tests/msgpack/test_flatten.cpp | 4 +++- tests/msgpack/test_flatten_anonymous.cpp | 4 +++- tests/msgpack/test_forward_list.cpp | 8 +++++++- tests/msgpack/test_generic_float.cpp | 4 +++- tests/msgpack/test_literal.cpp | 4 +++- tests/msgpack/test_literal_map.cpp | 4 +++- tests/msgpack/test_map.cpp | 6 +++++- tests/msgpack/test_map_with_key_validation.cpp | 7 ++++++- tests/msgpack/test_monster_example.cpp | 4 +++- tests/msgpack/test_readme_example.cpp | 4 +++- tests/msgpack/test_readme_example2.cpp | 4 +++- tests/msgpack/test_ref.cpp | 6 +++++- tests/msgpack/test_regression_bugs.cpp | 5 +++-- tests/msgpack/test_save_load.cpp | 5 +++-- tests/msgpack/test_set.cpp | 8 +++++++- tests/msgpack/test_size.cpp | 4 +++- tests/msgpack/test_skip.cpp | 1 + tests/msgpack/test_snake_case_to_camel_case.cpp | 1 + tests/msgpack/test_snake_case_to_pascal_case.cpp | 1 + tests/msgpack/test_string_map.cpp | 4 +++- tests/msgpack/test_tagged_union.cpp | 4 +++- tests/msgpack/test_tagged_union2.cpp | 4 +++- tests/msgpack/test_timestamp.cpp | 4 +++- tests/msgpack/test_unique_ptr.cpp | 6 +++++- tests/msgpack/test_unique_ptr2.cpp | 7 ++++++- tests/msgpack/test_variant.cpp | 7 ++++++- tests/msgpack/test_vectorstring.cpp | 6 ++++-- tests/msgpack/test_wstring.cpp | 4 +++- tests/msgpack/write_and_read.hpp | 5 ++++- tests/parquet/CMakeLists.txt | 2 +- tests/parquet/test_boolean.cpp | 3 ++- tests/parquet/test_box.cpp | 3 ++- tests/parquet/test_bytestring.cpp | 5 ++++- tests/parquet/test_camel_case.cpp | 3 ++- tests/parquet/test_deque.cpp | 3 ++- tests/parquet/test_enums.cpp | 3 ++- tests/parquet/test_flatten.cpp | 3 ++- tests/parquet/test_gzip.cpp | 3 ++- tests/parquet/test_literal.cpp | 3 ++- tests/parquet/test_optionals.cpp | 3 ++- tests/parquet/test_readme_example.cpp | 3 ++- tests/parquet/test_ref.cpp | 3 ++- tests/parquet/test_save_load.cpp | 5 +++-- tests/parquet/test_shared_ptr.cpp | 3 ++- tests/parquet/test_unique_ptr.cpp | 3 ++- tests/parquet/write_and_read.hpp | 5 ++++- tests/toml/CMakeLists.txt | 2 +- tests/toml/test_add_struct_name.cpp | 1 + tests/toml/test_array.cpp | 7 +++++-- tests/toml/test_box.cpp | 6 +++++- tests/toml/test_combined_processors.cpp | 1 + tests/toml/test_custom_class1.cpp | 4 +++- tests/toml/test_custom_class3.cpp | 4 +++- tests/toml/test_custom_class4.cpp | 4 +++- tests/toml/test_default_values.cpp | 4 +++- tests/toml/test_deque.cpp | 8 +++++++- tests/toml/test_enum.cpp | 4 +++- tests/toml/test_field_variant.cpp | 4 +++- tests/toml/test_flag_enum.cpp | 4 +++- tests/toml/test_flag_enum_with_int.cpp | 4 +++- tests/toml/test_flatten.cpp | 4 +++- tests/toml/test_flatten_anonymous.cpp | 4 +++- tests/toml/test_forward_list.cpp | 8 +++++++- tests/toml/test_literal.cpp | 4 +++- tests/toml/test_literal_map.cpp | 4 +++- tests/toml/test_map.cpp | 6 +++++- tests/toml/test_map_with_key_validation.cpp | 7 ++++++- tests/toml/test_monster_example.cpp | 4 +++- tests/toml/test_readme_example.cpp | 4 +++- tests/toml/test_readme_example2.cpp | 4 +++- tests/toml/test_ref.cpp | 6 +++++- tests/toml/test_regression_bugs.cpp | 7 +++++-- tests/toml/test_save_load.cpp | 5 +++-- tests/toml/test_set.cpp | 8 +++++++- tests/toml/test_size.cpp | 4 +++- tests/toml/test_snake_case_to_camel_case.cpp | 1 + tests/toml/test_snake_case_to_pascal_case.cpp | 1 + tests/toml/test_string_map.cpp | 4 +++- tests/toml/test_tagged_union.cpp | 4 +++- tests/toml/test_timestamp.cpp | 4 +++- tests/toml/test_unique_ptr.cpp | 6 +++++- tests/toml/test_unique_ptr2.cpp | 7 ++++++- tests/toml/test_variant.cpp | 7 ++++++- tests/toml/test_wstring.cpp | 4 +++- tests/toml/write_and_read.hpp | 6 +++++- tests/ubjson/CMakeLists.txt | 2 +- tests/ubjson/test_add_struct_name.cpp | 1 + tests/ubjson/test_array.cpp | 7 +++++-- tests/ubjson/test_box.cpp | 6 +++++- tests/ubjson/test_bytestring.cpp | 6 +++++- tests/ubjson/test_combined_processors.cpp | 1 + tests/ubjson/test_custom_class1.cpp | 4 +++- tests/ubjson/test_custom_class3.cpp | 4 +++- tests/ubjson/test_custom_class4.cpp | 4 +++- tests/ubjson/test_default_values.cpp | 4 +++- tests/ubjson/test_deque.cpp | 8 +++++++- tests/ubjson/test_enum.cpp | 4 +++- tests/ubjson/test_error_messages.cpp | 7 ++++--- tests/ubjson/test_extra_fields.cpp | 4 +++- tests/ubjson/test_field_variant.cpp | 4 +++- tests/ubjson/test_flag_enum.cpp | 4 +++- tests/ubjson/test_flag_enum_with_int.cpp | 4 +++- tests/ubjson/test_flatten.cpp | 4 +++- tests/ubjson/test_flatten_anonymous.cpp | 4 +++- tests/ubjson/test_forward_list.cpp | 8 +++++++- tests/ubjson/test_literal.cpp | 4 +++- tests/ubjson/test_literal_map.cpp | 4 +++- tests/ubjson/test_map.cpp | 6 +++++- tests/ubjson/test_map_with_key_validation.cpp | 7 ++++++- tests/ubjson/test_monster_example.cpp | 4 +++- tests/ubjson/test_read_byte_containers.cpp | 9 +++++++-- tests/ubjson/test_readme_example.cpp | 4 +++- tests/ubjson/test_readme_example2.cpp | 4 +++- tests/ubjson/test_ref.cpp | 6 +++++- tests/ubjson/test_save_load.cpp | 5 +++-- tests/ubjson/test_set.cpp | 8 +++++++- tests/ubjson/test_size.cpp | 4 +++- tests/ubjson/test_snake_case_to_camel_case.cpp | 1 + tests/ubjson/test_snake_case_to_pascal_case.cpp | 1 + tests/ubjson/test_string_map.cpp | 4 +++- tests/ubjson/test_tagged_union.cpp | 4 +++- tests/ubjson/test_tagged_union2.cpp | 4 +++- tests/ubjson/test_timestamp.cpp | 4 +++- tests/ubjson/test_unique_ptr.cpp | 6 +++++- tests/ubjson/test_unique_ptr2.cpp | 7 ++++++- tests/ubjson/test_variant.cpp | 7 ++++++- tests/ubjson/test_vectorstring.cpp | 6 ++++-- tests/ubjson/test_wstring.cpp | 4 +++- tests/ubjson/write_and_read.hpp | 5 ++++- tests/xml/CMakeLists.txt | 2 +- tests/xml/test_add_struct_name.cpp | 1 + tests/xml/test_array.cpp | 7 +++++-- tests/xml/test_attribute_rename.cpp | 4 +++- tests/xml/test_box.cpp | 6 +++++- tests/xml/test_combined_processors.cpp | 1 + tests/xml/test_comment.cpp | 4 +++- tests/xml/test_custom_class1.cpp | 4 +++- tests/xml/test_custom_class3.cpp | 4 +++- tests/xml/test_custom_class4.cpp | 4 +++- tests/xml/test_default_if_missing.cpp | 6 ++++-- tests/xml/test_default_values.cpp | 4 +++- tests/xml/test_deque.cpp | 8 +++++++- tests/xml/test_enum.cpp | 4 +++- tests/xml/test_field_variant.cpp | 4 +++- tests/xml/test_flag_enum.cpp | 4 +++- tests/xml/test_flag_enum_with_int.cpp | 4 +++- tests/xml/test_flatten.cpp | 4 +++- tests/xml/test_flatten_anonymous.cpp | 4 +++- tests/xml/test_forward_list.cpp | 8 +++++++- tests/xml/test_generic.cpp | 4 +++- tests/xml/test_literal.cpp | 4 +++- tests/xml/test_literal_map.cpp | 4 +++- tests/xml/test_map.cpp | 6 +++++- tests/xml/test_map_with_key_validation.cpp | 7 ++++++- tests/xml/test_monster_example.cpp | 4 +++- tests/xml/test_readme_example.cpp | 4 +++- tests/xml/test_readme_example2.cpp | 4 +++- tests/xml/test_ref.cpp | 6 +++++- tests/xml/test_regression_bugs.cpp | 5 +++-- tests/xml/test_save_load.cpp | 5 +++-- tests/xml/test_set.cpp | 8 +++++++- tests/xml/test_size.cpp | 4 +++- tests/xml/test_snake_case_to_camel_case.cpp | 1 + tests/xml/test_snake_case_to_pascal_case.cpp | 1 + tests/xml/test_string_map.cpp | 4 +++- tests/xml/test_tagged_union.cpp | 4 +++- tests/xml/test_timestamp.cpp | 4 +++- tests/xml/test_unique_ptr.cpp | 6 +++++- tests/xml/test_unique_ptr2.cpp | 7 ++++++- tests/xml/test_variant.cpp | 7 ++++++- tests/xml/test_wstring.cpp | 4 +++- tests/xml/test_xml_content.cpp | 6 ++++-- tests/xml/test_xml_content2.cpp | 6 ++++-- tests/xml/write_and_read.hpp | 7 +++++-- tests/yaml/CMakeLists.txt | 2 +- tests/yaml/test_add_struct_name.cpp | 1 + tests/yaml/test_array.cpp | 7 +++++-- tests/yaml/test_box.cpp | 6 +++++- tests/yaml/test_combined_processors.cpp | 1 + tests/yaml/test_comment.cpp | 4 +++- tests/yaml/test_comment_optional_array.cpp | 5 +++-- tests/yaml/test_custom_class1.cpp | 4 +++- tests/yaml/test_custom_class3.cpp | 4 +++- tests/yaml/test_custom_class4.cpp | 4 +++- tests/yaml/test_default_values.cpp | 4 +++- tests/yaml/test_deque.cpp | 8 +++++++- tests/yaml/test_double.cpp | 4 +++- tests/yaml/test_enum.cpp | 4 +++- tests/yaml/test_field_variant.cpp | 4 +++- tests/yaml/test_flag_enum.cpp | 4 +++- tests/yaml/test_flag_enum_with_int.cpp | 4 +++- tests/yaml/test_flatten.cpp | 4 +++- tests/yaml/test_flatten_anonymous.cpp | 4 +++- tests/yaml/test_forward_list.cpp | 8 +++++++- tests/yaml/test_literal.cpp | 4 +++- tests/yaml/test_literal_map.cpp | 4 +++- tests/yaml/test_map.cpp | 6 +++++- tests/yaml/test_map_with_key_validation.cpp | 7 ++++++- tests/yaml/test_monster_example.cpp | 4 +++- tests/yaml/test_multiline.cpp | 4 +++- tests/yaml/test_read_null.cpp | 5 ++++- tests/yaml/test_readme_example.cpp | 4 +++- tests/yaml/test_readme_example2.cpp | 4 +++- tests/yaml/test_ref.cpp | 6 +++++- tests/yaml/test_save_load.cpp | 5 +++-- tests/yaml/test_set.cpp | 8 +++++++- tests/yaml/test_size.cpp | 4 +++- tests/yaml/test_skip.cpp | 6 ++++-- tests/yaml/test_snake_case_to_camel_case.cpp | 1 + tests/yaml/test_snake_case_to_pascal_case.cpp | 1 + tests/yaml/test_string_map.cpp | 4 +++- tests/yaml/test_tagged_union.cpp | 4 +++- tests/yaml/test_timestamp.cpp | 4 +++- tests/yaml/test_unique_ptr.cpp | 6 +++++- tests/yaml/test_unique_ptr2.cpp | 7 ++++++- tests/yaml/test_variant.cpp | 7 ++++++- tests/yaml/test_wstring.cpp | 4 +++- tests/yaml/write_and_read.hpp | 6 +++++- tests/yas/CMakeLists.txt | 2 +- tests/yas/test_add_struct_name.cpp | 1 + tests/yas/test_array.cpp | 7 +++++-- tests/yas/test_box.cpp | 7 +++++-- tests/yas/test_bytestring.cpp | 6 +++++- tests/yas/test_custom_class1.cpp | 4 +++- tests/yas/test_custom_class3.cpp | 4 +++- tests/yas/test_custom_class4.cpp | 6 +++++- tests/yas/test_default_values.cpp | 4 +++- tests/yas/test_deque.cpp | 8 +++++++- tests/yas/test_enum.cpp | 5 +++-- tests/yas/test_field_variant.cpp | 4 +++- tests/yas/test_field_variant_std.cpp | 6 +++++- tests/yas/test_flag_enum.cpp | 4 +++- tests/yas/test_flag_enum_with_int.cpp | 4 +++- tests/yas/test_flatten.cpp | 4 +++- tests/yas/test_flatten_anonymous.cpp | 4 +++- tests/yas/test_forward_list.cpp | 8 +++++++- tests/yas/test_generic.cpp | 5 +++-- tests/yas/test_literal.cpp | 6 ++++-- tests/yas/test_literal_map.cpp | 4 +++- tests/yas/test_map.cpp | 8 ++++++-- tests/yas/test_map2.cpp | 8 ++++++-- tests/yas/test_monster_example.cpp | 4 +++- tests/yas/test_optional_fields.cpp | 7 +++++-- tests/yas/test_optionals_in_vectors.cpp | 8 ++++++-- tests/yas/test_person.cpp | 5 +++-- tests/yas/test_readme_example.cpp | 5 +++-- tests/yas/test_readme_example2.cpp | 4 +++- tests/yas/test_readme_example3.cpp | 4 +++- tests/yas/test_ref.cpp | 6 +++++- tests/yas/test_rfl_tuple.cpp | 8 ++++++-- tests/yas/test_rfl_variant.cpp | 6 +++++- tests/yas/test_save_load.cpp | 5 +++-- tests/yas/test_set.cpp | 8 +++++++- tests/yas/test_shared_ptr.cpp | 8 ++++++-- tests/yas/test_size.cpp | 4 +++- tests/yas/test_string_map.cpp | 6 ++++-- tests/yas/test_tagged_union.cpp | 5 +++-- tests/yas/test_timestamp.cpp | 5 +++-- tests/yas/test_tuple.cpp | 5 +++-- tests/yas/test_unique_ptr.cpp | 7 +++++-- tests/yas/test_unique_ptr2.cpp | 7 ++++++- tests/yas/test_variant.cpp | 7 +++++-- tests/yas/test_variants_in_vectors.cpp | 8 ++++++-- tests/yas/test_wstring.cpp | 4 +++- tests/yas/write_and_read.hpp | 7 +++++-- 862 files changed, 3175 insertions(+), 1146 deletions(-) diff --git a/tests/avro/CMakeLists.txt b/tests/avro/CMakeLists.txt index bca216303..0686a08ae 100644 --- a/tests/avro/CMakeLists.txt +++ b/tests/avro/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-avro-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-avro-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-avro-tests PRIVATE ) target_link_libraries(reflect-cpp-avro-tests PRIVATE reflectcpp_tests_crt) diff --git a/tests/avro/test_add_struct_name.cpp b/tests/avro/test_add_struct_name.cpp index 87324e61e..658e652d8 100644 --- a/tests/avro/test_add_struct_name.cpp +++ b/tests/avro/test_add_struct_name.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.avro; namespace test_add_struct_name { diff --git a/tests/avro/test_array.cpp b/tests/avro/test_array.cpp index 9c8e5e485..45f68665a 100644 --- a/tests/avro/test_array.cpp +++ b/tests/avro/test_array.cpp @@ -1,13 +1,16 @@ #include #include -#include #include // Make sure things still compile when // rfl.hpp is included after rfl/avro.hpp. -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.avro; + namespace test_array { diff --git a/tests/avro/test_box.cpp b/tests/avro/test_box.cpp index 151f85830..4e861ad3a 100644 --- a/tests/avro/test_box.cpp +++ b/tests/avro/test_box.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.avro; +import rfl; + namespace test_box { diff --git a/tests/avro/test_bytestring.cpp b/tests/avro/test_bytestring.cpp index 29fe59e86..106c4daf5 100644 --- a/tests/avro/test_bytestring.cpp +++ b/tests/avro/test_bytestring.cpp @@ -1,6 +1,10 @@ -#include #include "write_and_read.hpp" +#include + +import rfl.avro; +import rfl; + namespace test_bytestring { diff --git a/tests/avro/test_combined_processors.cpp b/tests/avro/test_combined_processors.cpp index 354815b42..1c572b2e0 100644 --- a/tests/avro/test_combined_processors.cpp +++ b/tests/avro/test_combined_processors.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.avro; namespace test_combined_processors { diff --git a/tests/avro/test_custom_class1.cpp b/tests/avro/test_custom_class1.cpp index bca796ee5..1da15c3cb 100644 --- a/tests/avro/test_custom_class1.cpp +++ b/tests/avro/test_custom_class1.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_custom_class1 { diff --git a/tests/avro/test_custom_class3.cpp b/tests/avro/test_custom_class3.cpp index 715771c65..9554a90f4 100644 --- a/tests/avro/test_custom_class3.cpp +++ b/tests/avro/test_custom_class3.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_custom_class3 { diff --git a/tests/avro/test_custom_class4.cpp b/tests/avro/test_custom_class4.cpp index 0db5f0cad..4a4b73566 100644 --- a/tests/avro/test_custom_class4.cpp +++ b/tests/avro/test_custom_class4.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_custom_class4 { diff --git a/tests/avro/test_default_values.cpp b/tests/avro/test_default_values.cpp index 59a2b8cce..68af5aab8 100644 --- a/tests/avro/test_default_values.cpp +++ b/tests/avro/test_default_values.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_default_values { diff --git a/tests/avro/test_deque.cpp b/tests/avro/test_deque.cpp index a8832f224..054c5a6e0 100644 --- a/tests/avro/test_deque.cpp +++ b/tests/avro/test_deque.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.avro; +import rfl; + namespace test_deque { diff --git a/tests/avro/test_enum.cpp b/tests/avro/test_enum.cpp index bafe9fadf..355d42825 100644 --- a/tests/avro/test_enum.cpp +++ b/tests/avro/test_enum.cpp @@ -1,8 +1,10 @@ #include -#include -#include #include "write_and_read.hpp" +import rfl.avro; +import rfl; +import rfl.json; + namespace test_enum { diff --git a/tests/avro/test_field_variant.cpp b/tests/avro/test_field_variant.cpp index 759280f54..ead6c6d74 100644 --- a/tests/avro/test_field_variant.cpp +++ b/tests/avro/test_field_variant.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_field_variant { diff --git a/tests/avro/test_field_variant_std.cpp b/tests/avro/test_field_variant_std.cpp index 473e3ab79..0237a7301 100644 --- a/tests/avro/test_field_variant_std.cpp +++ b/tests/avro/test_field_variant_std.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.avro; +import rfl; + namespace test_field_variant_std { diff --git a/tests/avro/test_flag_enum.cpp b/tests/avro/test_flag_enum.cpp index 39e62e2be..a0fa270be 100644 --- a/tests/avro/test_flag_enum.cpp +++ b/tests/avro/test_flag_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_flag_enum { diff --git a/tests/avro/test_flag_enum_with_int.cpp b/tests/avro/test_flag_enum_with_int.cpp index 45544b6ad..53c24bb5b 100644 --- a/tests/avro/test_flag_enum_with_int.cpp +++ b/tests/avro/test_flag_enum_with_int.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/avro/test_flatten.cpp b/tests/avro/test_flatten.cpp index 4325afad1..675f6e960 100644 --- a/tests/avro/test_flatten.cpp +++ b/tests/avro/test_flatten.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_flatten { diff --git a/tests/avro/test_flatten_anonymous.cpp b/tests/avro/test_flatten_anonymous.cpp index 8212f3e8f..fb20815db 100644 --- a/tests/avro/test_flatten_anonymous.cpp +++ b/tests/avro/test_flatten_anonymous.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/avro/test_float_and_int.cpp b/tests/avro/test_float_and_int.cpp index 091dcb3dd..1558e04ee 100644 --- a/tests/avro/test_float_and_int.cpp +++ b/tests/avro/test_float_and_int.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.avro; namespace test_float_and_int { diff --git a/tests/avro/test_forward_list.cpp b/tests/avro/test_forward_list.cpp index 9e964779a..9bafab81e 100644 --- a/tests/avro/test_forward_list.cpp +++ b/tests/avro/test_forward_list.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.avro; +import rfl; + namespace test_forward_list { diff --git a/tests/avro/test_literal.cpp b/tests/avro/test_literal.cpp index 6a891e9ad..55535f90a 100644 --- a/tests/avro/test_literal.cpp +++ b/tests/avro/test_literal.cpp @@ -1,9 +1,11 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; +import rfl.json; + namespace test_literal { diff --git a/tests/avro/test_literal_map.cpp b/tests/avro/test_literal_map.cpp index e6c408be0..fca66cda8 100644 --- a/tests/avro/test_literal_map.cpp +++ b/tests/avro/test_literal_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_literal_map { diff --git a/tests/avro/test_map.cpp b/tests/avro/test_map.cpp index 55e9cf5df..0217b05d0 100644 --- a/tests/avro/test_map.cpp +++ b/tests/avro/test_map.cpp @@ -1,9 +1,14 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl.avro; +import rfl; +import rfl.json; + namespace test_map { diff --git a/tests/avro/test_map2.cpp b/tests/avro/test_map2.cpp index 852fd58ec..ae781ba62 100644 --- a/tests/avro/test_map2.cpp +++ b/tests/avro/test_map2.cpp @@ -1,9 +1,13 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl.avro; +import rfl; +import rfl.json; + namespace test_map2 { diff --git a/tests/avro/test_monster_example.cpp b/tests/avro/test_monster_example.cpp index ef8ba215b..ebf912b0f 100644 --- a/tests/avro/test_monster_example.cpp +++ b/tests/avro/test_monster_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_monster_example { diff --git a/tests/avro/test_optional_fields.cpp b/tests/avro/test_optional_fields.cpp index 0df4d7e1e..9325cfb0f 100644 --- a/tests/avro/test_optional_fields.cpp +++ b/tests/avro/test_optional_fields.cpp @@ -1,9 +1,13 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.avro; +import rfl; +import rfl.json; + namespace test_optional_fields { diff --git a/tests/avro/test_readme_example.cpp b/tests/avro/test_readme_example.cpp index 38dc1880c..310aa6848 100644 --- a/tests/avro/test_readme_example.cpp +++ b/tests/avro/test_readme_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_readme_example { diff --git a/tests/avro/test_readme_example2.cpp b/tests/avro/test_readme_example2.cpp index 1fd0cf5a1..635d53ba6 100644 --- a/tests/avro/test_readme_example2.cpp +++ b/tests/avro/test_readme_example2.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_readme_example2 { diff --git a/tests/avro/test_readme_example3.cpp b/tests/avro/test_readme_example3.cpp index fbeb3d7bc..a2520ae7e 100644 --- a/tests/avro/test_readme_example3.cpp +++ b/tests/avro/test_readme_example3.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_readme_example3 { diff --git a/tests/avro/test_ref.cpp b/tests/avro/test_ref.cpp index 892dd9087..d2627475c 100644 --- a/tests/avro/test_ref.cpp +++ b/tests/avro/test_ref.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.avro; +import rfl; + namespace test_ref { diff --git a/tests/avro/test_regression_bugs.cpp b/tests/avro/test_regression_bugs.cpp index 58f75a9f4..e7de26ed0 100644 --- a/tests/avro/test_regression_bugs.cpp +++ b/tests/avro/test_regression_bugs.cpp @@ -2,10 +2,10 @@ #include #include +import rfl; +import rfl.avro; + -#include -#include -#include // avro::SchemaImpl move-assignment — double-decrement / use-after-free // File: src/rfl/avro/SchemaImpl.cpp:34-42 diff --git a/tests/avro/test_rfl_tuple.cpp b/tests/avro/test_rfl_tuple.cpp index f33a84adc..7edac2f33 100644 --- a/tests/avro/test_rfl_tuple.cpp +++ b/tests/avro/test_rfl_tuple.cpp @@ -1,10 +1,14 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl.avro; +import rfl; +import rfl.json; + namespace test_rfl_tuple { diff --git a/tests/avro/test_rfl_variant.cpp b/tests/avro/test_rfl_variant.cpp index f3439b378..77554f4fa 100644 --- a/tests/avro/test_rfl_variant.cpp +++ b/tests/avro/test_rfl_variant.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.avro; +import rfl; + namespace test_variant { diff --git a/tests/avro/test_save_load.cpp b/tests/avro/test_save_load.cpp index a5ba510a1..a2c9adc15 100644 --- a/tests/avro/test_save_load.cpp +++ b/tests/avro/test_save_load.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include +import rfl; +import rfl.avro; + namespace test_save_load { diff --git a/tests/avro/test_set.cpp b/tests/avro/test_set.cpp index a80b0e445..5a07ded92 100644 --- a/tests/avro/test_set.cpp +++ b/tests/avro/test_set.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.avro; +import rfl; + namespace test_set { diff --git a/tests/avro/test_shared_ptr.cpp b/tests/avro/test_shared_ptr.cpp index 31c91b299..e1558a93a 100644 --- a/tests/avro/test_shared_ptr.cpp +++ b/tests/avro/test_shared_ptr.cpp @@ -1,10 +1,14 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.avro; +import rfl; +import rfl.json; + namespace test_shared_ptr { diff --git a/tests/avro/test_size.cpp b/tests/avro/test_size.cpp index 7ea307269..598ac887a 100644 --- a/tests/avro/test_size.cpp +++ b/tests/avro/test_size.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_size { diff --git a/tests/avro/test_snake_case_to_camel_case.cpp b/tests/avro/test_snake_case_to_camel_case.cpp index 3a2b10643..8b3e65608 100644 --- a/tests/avro/test_snake_case_to_camel_case.cpp +++ b/tests/avro/test_snake_case_to_camel_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.avro; namespace test_snake_case_to_camel_case { diff --git a/tests/avro/test_snake_case_to_pascal_case.cpp b/tests/avro/test_snake_case_to_pascal_case.cpp index 7c623d0ba..99fbc5a53 100644 --- a/tests/avro/test_snake_case_to_pascal_case.cpp +++ b/tests/avro/test_snake_case_to_pascal_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.avro; namespace test_snake_case_to_pascal_case { diff --git a/tests/avro/test_string_map.cpp b/tests/avro/test_string_map.cpp index ad6869d14..16102a787 100644 --- a/tests/avro/test_string_map.cpp +++ b/tests/avro/test_string_map.cpp @@ -1,10 +1,12 @@ #include #include -#include -#include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; +import rfl.json; + namespace test_string_map { TEST(avro, test_string_map) { diff --git a/tests/avro/test_tagged_union.cpp b/tests/avro/test_tagged_union.cpp index f00617dc0..6bea20742 100644 --- a/tests/avro/test_tagged_union.cpp +++ b/tests/avro/test_tagged_union.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_tagged_union { diff --git a/tests/avro/test_timestamp.cpp b/tests/avro/test_timestamp.cpp index cc13d0bff..c50056e2a 100644 --- a/tests/avro/test_timestamp.cpp +++ b/tests/avro/test_timestamp.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + namespace test_timestamp { diff --git a/tests/avro/test_tuple.cpp b/tests/avro/test_tuple.cpp index 98dde5d4f..93b2a1f54 100644 --- a/tests/avro/test_tuple.cpp +++ b/tests/avro/test_tuple.cpp @@ -1,11 +1,15 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.avro; +import rfl; +import rfl.json; + namespace test_tuple { diff --git a/tests/avro/test_tutorial_example.cpp b/tests/avro/test_tutorial_example.cpp index 04f36fd46..7c19ede96 100644 --- a/tests/avro/test_tutorial_example.cpp +++ b/tests/avro/test_tutorial_example.cpp @@ -1,8 +1,9 @@ #include -#include -#include #include +import rfl; +import rfl.avro; + /// The basic example from the Avro C tutorial. namespace test_tutorial_example { diff --git a/tests/avro/test_tutorial_example_automated_schema.cpp b/tests/avro/test_tutorial_example_automated_schema.cpp index d67a9959d..a6ac53945 100644 --- a/tests/avro/test_tutorial_example_automated_schema.cpp +++ b/tests/avro/test_tutorial_example_automated_schema.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.avro; + /// The basic example from the Avro C tutorial. namespace test_tutorial_example_automated_schema { diff --git a/tests/avro/test_unique_ptr.cpp b/tests/avro/test_unique_ptr.cpp index c48ad3867..c28e56a6b 100644 --- a/tests/avro/test_unique_ptr.cpp +++ b/tests/avro/test_unique_ptr.cpp @@ -1,10 +1,14 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.avro; +import rfl; +import rfl.json; + namespace test_unique_ptr { diff --git a/tests/avro/test_unique_ptr2.cpp b/tests/avro/test_unique_ptr2.cpp index b42255faf..7375288a8 100644 --- a/tests/avro/test_unique_ptr2.cpp +++ b/tests/avro/test_unique_ptr2.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.avro; +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/avro/test_variant.cpp b/tests/avro/test_variant.cpp index 80ad28190..18506ccef 100644 --- a/tests/avro/test_variant.cpp +++ b/tests/avro/test_variant.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.avro; +import rfl; + namespace test_variant { diff --git a/tests/avro/test_wstring.cpp b/tests/avro/test_wstring.cpp index 2810272ea..eeee1aea2 100644 --- a/tests/avro/test_wstring.cpp +++ b/tests/avro/test_wstring.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.avro; +import rfl; + struct TestStruct { std::string theNormalString; diff --git a/tests/avro/write_and_read.hpp b/tests/avro/write_and_read.hpp index f60168b7f..fb476b082 100644 --- a/tests/avro/write_and_read.hpp +++ b/tests/avro/write_and_read.hpp @@ -3,9 +3,12 @@ #include -#include -#include #include +#include + +import rfl.json; +import rfl.avro; + template void write_and_read(const auto& _struct) { diff --git a/tests/boost_serialization/CMakeLists.txt b/tests/boost_serialization/CMakeLists.txt index 84c9cab26..566b75493 100644 --- a/tests/boost_serialization/CMakeLists.txt +++ b/tests/boost_serialization/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-boost-serialization-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-boost-serialization-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-boost-serialization-tests PRIVATE ) target_link_libraries(reflect-cpp-boost-serialization-tests PRIVATE reflectcpp_tests_crt) diff --git a/tests/boost_serialization/test_add_struct_name.cpp b/tests/boost_serialization/test_add_struct_name.cpp index 55a4cb4e7..c56bdd8ca 100644 --- a/tests/boost_serialization/test_add_struct_name.cpp +++ b/tests/boost_serialization/test_add_struct_name.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.boost_serialization; namespace test_add_struct_name { diff --git a/tests/boost_serialization/test_array.cpp b/tests/boost_serialization/test_array.cpp index 67e286db6..854c3f66a 100644 --- a/tests/boost_serialization/test_array.cpp +++ b/tests/boost_serialization/test_array.cpp @@ -1,13 +1,16 @@ #include #include -#include #include // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.boost_serialization; + namespace test_array { diff --git a/tests/boost_serialization/test_box.cpp b/tests/boost_serialization/test_box.cpp index 1afcdff58..c0275ed64 100644 --- a/tests/boost_serialization/test_box.cpp +++ b/tests/boost_serialization/test_box.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.boost_serialization; +import rfl; + namespace test_box { diff --git a/tests/boost_serialization/test_combined_processors.cpp b/tests/boost_serialization/test_combined_processors.cpp index 7f5e041fe..366e9c59e 100644 --- a/tests/boost_serialization/test_combined_processors.cpp +++ b/tests/boost_serialization/test_combined_processors.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.boost_serialization; namespace test_combined_processors { diff --git a/tests/boost_serialization/test_custom_class1.cpp b/tests/boost_serialization/test_custom_class1.cpp index b07d3746a..a33582df0 100644 --- a/tests/boost_serialization/test_custom_class1.cpp +++ b/tests/boost_serialization/test_custom_class1.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_custom_class1 { diff --git a/tests/boost_serialization/test_custom_class3.cpp b/tests/boost_serialization/test_custom_class3.cpp index 79510b45e..9d398c5bb 100644 --- a/tests/boost_serialization/test_custom_class3.cpp +++ b/tests/boost_serialization/test_custom_class3.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_custom_class3 { diff --git a/tests/boost_serialization/test_custom_class4.cpp b/tests/boost_serialization/test_custom_class4.cpp index 4cb88bc70..124284e0f 100644 --- a/tests/boost_serialization/test_custom_class4.cpp +++ b/tests/boost_serialization/test_custom_class4.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_custom_class4 { diff --git a/tests/boost_serialization/test_default_values.cpp b/tests/boost_serialization/test_default_values.cpp index 1a55dfd86..44e5ed076 100644 --- a/tests/boost_serialization/test_default_values.cpp +++ b/tests/boost_serialization/test_default_values.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_default_values { diff --git a/tests/boost_serialization/test_deque.cpp b/tests/boost_serialization/test_deque.cpp index 55a3373a6..8434d8b62 100644 --- a/tests/boost_serialization/test_deque.cpp +++ b/tests/boost_serialization/test_deque.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.boost_serialization; +import rfl; + namespace test_deque { diff --git a/tests/boost_serialization/test_enum.cpp b/tests/boost_serialization/test_enum.cpp index a26019ab8..b5ded05d4 100644 --- a/tests/boost_serialization/test_enum.cpp +++ b/tests/boost_serialization/test_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_enum { diff --git a/tests/boost_serialization/test_field_variant.cpp b/tests/boost_serialization/test_field_variant.cpp index eb94c59f4..5dedfc3fb 100644 --- a/tests/boost_serialization/test_field_variant.cpp +++ b/tests/boost_serialization/test_field_variant.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_field_variant { diff --git a/tests/boost_serialization/test_flag_enum.cpp b/tests/boost_serialization/test_flag_enum.cpp index 8d09cdd51..03f07e19b 100644 --- a/tests/boost_serialization/test_flag_enum.cpp +++ b/tests/boost_serialization/test_flag_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_flag_enum { diff --git a/tests/boost_serialization/test_flag_enum_with_int.cpp b/tests/boost_serialization/test_flag_enum_with_int.cpp index d4e887f08..e3554758d 100644 --- a/tests/boost_serialization/test_flag_enum_with_int.cpp +++ b/tests/boost_serialization/test_flag_enum_with_int.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/boost_serialization/test_flatten.cpp b/tests/boost_serialization/test_flatten.cpp index d8a5d6ca7..ce4b4146e 100644 --- a/tests/boost_serialization/test_flatten.cpp +++ b/tests/boost_serialization/test_flatten.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_flatten { diff --git a/tests/boost_serialization/test_flatten_anonymous.cpp b/tests/boost_serialization/test_flatten_anonymous.cpp index bfad4b0dc..0bfafaf58 100644 --- a/tests/boost_serialization/test_flatten_anonymous.cpp +++ b/tests/boost_serialization/test_flatten_anonymous.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/boost_serialization/test_forward_list.cpp b/tests/boost_serialization/test_forward_list.cpp index 801c52956..945d6595a 100644 --- a/tests/boost_serialization/test_forward_list.cpp +++ b/tests/boost_serialization/test_forward_list.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.boost_serialization; +import rfl; + namespace test_forward_list { diff --git a/tests/boost_serialization/test_generic.cpp b/tests/boost_serialization/test_generic.cpp index 5a11024b3..3c7079c23 100644 --- a/tests/boost_serialization/test_generic.cpp +++ b/tests/boost_serialization/test_generic.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.boost_serialization; + namespace test_generic { diff --git a/tests/boost_serialization/test_literal.cpp b/tests/boost_serialization/test_literal.cpp index 519d85c46..c543ec3f0 100644 --- a/tests/boost_serialization/test_literal.cpp +++ b/tests/boost_serialization/test_literal.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_literal { diff --git a/tests/boost_serialization/test_literal_map.cpp b/tests/boost_serialization/test_literal_map.cpp index c3335248b..cb033b85c 100644 --- a/tests/boost_serialization/test_literal_map.cpp +++ b/tests/boost_serialization/test_literal_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_literal_map { diff --git a/tests/boost_serialization/test_map.cpp b/tests/boost_serialization/test_map.cpp index d8d463f4e..d0b365a21 100644 --- a/tests/boost_serialization/test_map.cpp +++ b/tests/boost_serialization/test_map.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl.boost_serialization; +import rfl; + namespace test_map { diff --git a/tests/boost_serialization/test_map_with_key_validation.cpp b/tests/boost_serialization/test_map_with_key_validation.cpp index 4a422b1c2..104abc19d 100644 --- a/tests/boost_serialization/test_map_with_key_validation.cpp +++ b/tests/boost_serialization/test_map_with_key_validation.cpp @@ -1,8 +1,13 @@ #include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl.boost_serialization; +import rfl; + namespace test_map_with_key_validation { diff --git a/tests/boost_serialization/test_monster_example.cpp b/tests/boost_serialization/test_monster_example.cpp index b3c412ee1..f0ed69ba9 100644 --- a/tests/boost_serialization/test_monster_example.cpp +++ b/tests/boost_serialization/test_monster_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_monster_example { diff --git a/tests/boost_serialization/test_readme_example.cpp b/tests/boost_serialization/test_readme_example.cpp index 173770538..670d107ac 100644 --- a/tests/boost_serialization/test_readme_example.cpp +++ b/tests/boost_serialization/test_readme_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_readme_example { diff --git a/tests/boost_serialization/test_readme_example2.cpp b/tests/boost_serialization/test_readme_example2.cpp index 83529ab2d..7179b0f6a 100644 --- a/tests/boost_serialization/test_readme_example2.cpp +++ b/tests/boost_serialization/test_readme_example2.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_readme_example2 { diff --git a/tests/boost_serialization/test_ref.cpp b/tests/boost_serialization/test_ref.cpp index c019a181d..a6f060642 100644 --- a/tests/boost_serialization/test_ref.cpp +++ b/tests/boost_serialization/test_ref.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.boost_serialization; +import rfl; + namespace test_ref { diff --git a/tests/boost_serialization/test_save_load.cpp b/tests/boost_serialization/test_save_load.cpp index e97c6e982..1e75dc5ae 100644 --- a/tests/boost_serialization/test_save_load.cpp +++ b/tests/boost_serialization/test_save_load.cpp @@ -1,10 +1,11 @@ #include #include -#include -#include #include #include +import rfl; +import rfl.boost_serialization; + namespace test_save_load { diff --git a/tests/boost_serialization/test_set.cpp b/tests/boost_serialization/test_set.cpp index f783bb2c7..b4aeb1439 100644 --- a/tests/boost_serialization/test_set.cpp +++ b/tests/boost_serialization/test_set.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.boost_serialization; +import rfl; + namespace test_set { diff --git a/tests/boost_serialization/test_size.cpp b/tests/boost_serialization/test_size.cpp index 3c91004c2..f7d60d3f9 100644 --- a/tests/boost_serialization/test_size.cpp +++ b/tests/boost_serialization/test_size.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_size { diff --git a/tests/boost_serialization/test_snake_case_to_camel_case.cpp b/tests/boost_serialization/test_snake_case_to_camel_case.cpp index 20f108a71..bd89d554f 100644 --- a/tests/boost_serialization/test_snake_case_to_camel_case.cpp +++ b/tests/boost_serialization/test_snake_case_to_camel_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.boost_serialization; namespace test_snake_case_to_camel_case { diff --git a/tests/boost_serialization/test_snake_case_to_pascal_case.cpp b/tests/boost_serialization/test_snake_case_to_pascal_case.cpp index df0a81234..64ec11f37 100644 --- a/tests/boost_serialization/test_snake_case_to_pascal_case.cpp +++ b/tests/boost_serialization/test_snake_case_to_pascal_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.boost_serialization; namespace test_snake_case_to_pascal_case { diff --git a/tests/boost_serialization/test_string_map.cpp b/tests/boost_serialization/test_string_map.cpp index 14887045b..ecd2619e3 100644 --- a/tests/boost_serialization/test_string_map.cpp +++ b/tests/boost_serialization/test_string_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_string_map { TEST(boost_serialization, test_string_map) { diff --git a/tests/boost_serialization/test_tagged_union.cpp b/tests/boost_serialization/test_tagged_union.cpp index 956292bfa..baa8f9d8e 100644 --- a/tests/boost_serialization/test_tagged_union.cpp +++ b/tests/boost_serialization/test_tagged_union.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_tagged_union { diff --git a/tests/boost_serialization/test_timestamp.cpp b/tests/boost_serialization/test_timestamp.cpp index dbeb95bf6..2f40706f5 100644 --- a/tests/boost_serialization/test_timestamp.cpp +++ b/tests/boost_serialization/test_timestamp.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.boost_serialization; +import rfl; + namespace test_timestamp { diff --git a/tests/boost_serialization/test_unique_ptr.cpp b/tests/boost_serialization/test_unique_ptr.cpp index 186be2617..16b793960 100644 --- a/tests/boost_serialization/test_unique_ptr.cpp +++ b/tests/boost_serialization/test_unique_ptr.cpp @@ -1,9 +1,13 @@ #include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.boost_serialization; +import rfl; + namespace test_unique_ptr { diff --git a/tests/boost_serialization/test_unique_ptr2.cpp b/tests/boost_serialization/test_unique_ptr2.cpp index f46107577..cb5a68110 100644 --- a/tests/boost_serialization/test_unique_ptr2.cpp +++ b/tests/boost_serialization/test_unique_ptr2.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.boost_serialization; +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/boost_serialization/test_variant.cpp b/tests/boost_serialization/test_variant.cpp index 4b87ecb76..de9768cac 100644 --- a/tests/boost_serialization/test_variant.cpp +++ b/tests/boost_serialization/test_variant.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.boost_serialization; +import rfl; + namespace test_variant { diff --git a/tests/boost_serialization/write_and_read.hpp b/tests/boost_serialization/write_and_read.hpp index 1714dbc5a..81dac060b 100644 --- a/tests/boost_serialization/write_and_read.hpp +++ b/tests/boost_serialization/write_and_read.hpp @@ -3,9 +3,12 @@ #include -#include -#include #include +#include + +import rfl.json; +import rfl.boost_serialization; + template void write_and_read(const auto& _struct) { diff --git a/tests/bson/CMakeLists.txt b/tests/bson/CMakeLists.txt index ca16dd2c8..ad1961650 100644 --- a/tests/bson/CMakeLists.txt +++ b/tests/bson/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-bson-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-bson-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-bson-tests PRIVATE ) target_include_directories(reflect-cpp-bson-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") diff --git a/tests/bson/test_add_struct_name.cpp b/tests/bson/test_add_struct_name.cpp index f9d5800d6..695305ace 100644 --- a/tests/bson/test_add_struct_name.cpp +++ b/tests/bson/test_add_struct_name.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.bson; namespace test_add_struct_name { diff --git a/tests/bson/test_array.cpp b/tests/bson/test_array.cpp index 5032090a2..f6b2e8b77 100644 --- a/tests/bson/test_array.cpp +++ b/tests/bson/test_array.cpp @@ -1,13 +1,16 @@ #include #include -#include #include // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.bson; + namespace test_array { diff --git a/tests/bson/test_box.cpp b/tests/bson/test_box.cpp index 148ff54a1..2c471d2e8 100644 --- a/tests/bson/test_box.cpp +++ b/tests/bson/test_box.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.bson; +import rfl; + namespace test_box { diff --git a/tests/bson/test_bytestring.cpp b/tests/bson/test_bytestring.cpp index 16d5bb7ae..cb548c5d4 100644 --- a/tests/bson/test_bytestring.cpp +++ b/tests/bson/test_bytestring.cpp @@ -1,7 +1,11 @@ -#include #include #include "write_and_read.hpp" +#include + +import rfl.bson; +import rfl; + namespace test_bytestring { diff --git a/tests/bson/test_combined_processors.cpp b/tests/bson/test_combined_processors.cpp index 477a3e789..36c698272 100644 --- a/tests/bson/test_combined_processors.cpp +++ b/tests/bson/test_combined_processors.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.bson; namespace test_combined_processors { diff --git a/tests/bson/test_custom_class1.cpp b/tests/bson/test_custom_class1.cpp index a0d103331..f886ba64e 100644 --- a/tests/bson/test_custom_class1.cpp +++ b/tests/bson/test_custom_class1.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_custom_class1 { diff --git a/tests/bson/test_custom_class3.cpp b/tests/bson/test_custom_class3.cpp index 66f364913..bcd3838b7 100644 --- a/tests/bson/test_custom_class3.cpp +++ b/tests/bson/test_custom_class3.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_custom_class3 { diff --git a/tests/bson/test_custom_class4.cpp b/tests/bson/test_custom_class4.cpp index 725eeb1a2..14a2dbc93 100644 --- a/tests/bson/test_custom_class4.cpp +++ b/tests/bson/test_custom_class4.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_custom_class4 { diff --git a/tests/bson/test_default_values.cpp b/tests/bson/test_default_values.cpp index 9db8a2e6d..a22037a10 100644 --- a/tests/bson/test_default_values.cpp +++ b/tests/bson/test_default_values.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_default_values { diff --git a/tests/bson/test_deque.cpp b/tests/bson/test_deque.cpp index fd4661964..378de5cca 100644 --- a/tests/bson/test_deque.cpp +++ b/tests/bson/test_deque.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.bson; +import rfl; + namespace test_deque { diff --git a/tests/bson/test_enum.cpp b/tests/bson/test_enum.cpp index 624aa7e8a..3ed263e86 100644 --- a/tests/bson/test_enum.cpp +++ b/tests/bson/test_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_enum { diff --git a/tests/bson/test_field_variant.cpp b/tests/bson/test_field_variant.cpp index 3d506e921..ba4fa7b6e 100644 --- a/tests/bson/test_field_variant.cpp +++ b/tests/bson/test_field_variant.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_field_variant { diff --git a/tests/bson/test_flag_enum.cpp b/tests/bson/test_flag_enum.cpp index 37aaf9685..85007b7ee 100644 --- a/tests/bson/test_flag_enum.cpp +++ b/tests/bson/test_flag_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_flag_enum { diff --git a/tests/bson/test_flag_enum_with_int.cpp b/tests/bson/test_flag_enum_with_int.cpp index 3c1b3d77f..0b3563fa2 100644 --- a/tests/bson/test_flag_enum_with_int.cpp +++ b/tests/bson/test_flag_enum_with_int.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/bson/test_flatten.cpp b/tests/bson/test_flatten.cpp index 05447bd9b..69c5379ee 100644 --- a/tests/bson/test_flatten.cpp +++ b/tests/bson/test_flatten.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_flatten { diff --git a/tests/bson/test_flatten_anonymous.cpp b/tests/bson/test_flatten_anonymous.cpp index 890651f04..c39e6bcb6 100644 --- a/tests/bson/test_flatten_anonymous.cpp +++ b/tests/bson/test_flatten_anonymous.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/bson/test_forward_list.cpp b/tests/bson/test_forward_list.cpp index 0ccb0814d..f6ad6f8c3 100644 --- a/tests/bson/test_forward_list.cpp +++ b/tests/bson/test_forward_list.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.bson; +import rfl; + namespace test_forward_list { diff --git a/tests/bson/test_literal.cpp b/tests/bson/test_literal.cpp index a8b4cd1c5..63c852a5a 100644 --- a/tests/bson/test_literal.cpp +++ b/tests/bson/test_literal.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_literal { diff --git a/tests/bson/test_literal_map.cpp b/tests/bson/test_literal_map.cpp index d4285cd5f..b21968d12 100644 --- a/tests/bson/test_literal_map.cpp +++ b/tests/bson/test_literal_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_literal_map { diff --git a/tests/bson/test_map.cpp b/tests/bson/test_map.cpp index b40305e23..f895503cf 100644 --- a/tests/bson/test_map.cpp +++ b/tests/bson/test_map.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl.bson; +import rfl; + namespace test_map { diff --git a/tests/bson/test_map_with_key_validation.cpp b/tests/bson/test_map_with_key_validation.cpp index 82dca8c8f..a503de478 100644 --- a/tests/bson/test_map_with_key_validation.cpp +++ b/tests/bson/test_map_with_key_validation.cpp @@ -1,8 +1,13 @@ #include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl.bson; +import rfl; + namespace test_map_with_key_validation { diff --git a/tests/bson/test_monster_example.cpp b/tests/bson/test_monster_example.cpp index 55aa804f0..a2cf37380 100644 --- a/tests/bson/test_monster_example.cpp +++ b/tests/bson/test_monster_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_monster_example { diff --git a/tests/bson/test_oid.cpp b/tests/bson/test_oid.cpp index a20cb3357..1da28fb95 100644 --- a/tests/bson/test_oid.cpp +++ b/tests/bson/test_oid.cpp @@ -1,7 +1,11 @@ -#include #include #include "write_and_read.hpp" +#include + +import rfl.bson; +import rfl; + namespace test_oid { diff --git a/tests/bson/test_readme_example.cpp b/tests/bson/test_readme_example.cpp index dd43cea10..c22117b15 100644 --- a/tests/bson/test_readme_example.cpp +++ b/tests/bson/test_readme_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_readme_example { diff --git a/tests/bson/test_readme_example2.cpp b/tests/bson/test_readme_example2.cpp index ac13250ce..113cf587e 100644 --- a/tests/bson/test_readme_example2.cpp +++ b/tests/bson/test_readme_example2.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_readme_example2 { diff --git a/tests/bson/test_ref.cpp b/tests/bson/test_ref.cpp index 6f6fc1bc5..6d57418fb 100644 --- a/tests/bson/test_ref.cpp +++ b/tests/bson/test_ref.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.bson; +import rfl; + namespace test_ref { diff --git a/tests/bson/test_regression_bugs.cpp b/tests/bson/test_regression_bugs.cpp index 4f18be78b..94cfabd3c 100644 --- a/tests/bson/test_regression_bugs.cpp +++ b/tests/bson/test_regression_bugs.cpp @@ -5,9 +5,10 @@ #include #include #include +import rfl; +import rfl.bson; + -#include -#include // bson::Reader — float fields reject integer BSON values // File: include/rfl/bson/Reader.hpp:127-132 diff --git a/tests/bson/test_save_load.cpp b/tests/bson/test_save_load.cpp index 620d4969c..8492393c5 100644 --- a/tests/bson/test_save_load.cpp +++ b/tests/bson/test_save_load.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include +import rfl; +import rfl.bson; + namespace test_save_load { diff --git a/tests/bson/test_set.cpp b/tests/bson/test_set.cpp index de3fc35d7..af3cfcc70 100644 --- a/tests/bson/test_set.cpp +++ b/tests/bson/test_set.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.bson; +import rfl; + namespace test_set { diff --git a/tests/bson/test_size.cpp b/tests/bson/test_size.cpp index 667a5a82f..ac73dc73a 100644 --- a/tests/bson/test_size.cpp +++ b/tests/bson/test_size.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_size { diff --git a/tests/bson/test_snake_case_to_camel_case.cpp b/tests/bson/test_snake_case_to_camel_case.cpp index 00210d772..005e46e71 100644 --- a/tests/bson/test_snake_case_to_camel_case.cpp +++ b/tests/bson/test_snake_case_to_camel_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.bson; namespace test_snake_case_to_camel_case { diff --git a/tests/bson/test_snake_case_to_pascal_case.cpp b/tests/bson/test_snake_case_to_pascal_case.cpp index f775e186d..259e667cf 100644 --- a/tests/bson/test_snake_case_to_pascal_case.cpp +++ b/tests/bson/test_snake_case_to_pascal_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.bson; namespace test_snake_case_to_pascal_case { diff --git a/tests/bson/test_string_map.cpp b/tests/bson/test_string_map.cpp index 715f332cd..186ef9ba9 100644 --- a/tests/bson/test_string_map.cpp +++ b/tests/bson/test_string_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_string_map { TEST(bson, test_string_map) { diff --git a/tests/bson/test_tagged_union.cpp b/tests/bson/test_tagged_union.cpp index 549d6f248..fd8c133ea 100644 --- a/tests/bson/test_tagged_union.cpp +++ b/tests/bson/test_tagged_union.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_tagged_union { diff --git a/tests/bson/test_timestamp.cpp b/tests/bson/test_timestamp.cpp index 8ff8b7fb2..b4dfd04ea 100644 --- a/tests/bson/test_timestamp.cpp +++ b/tests/bson/test_timestamp.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_timestamp { diff --git a/tests/bson/test_unique_ptr.cpp b/tests/bson/test_unique_ptr.cpp index 0c829259c..cd0365da5 100644 --- a/tests/bson/test_unique_ptr.cpp +++ b/tests/bson/test_unique_ptr.cpp @@ -1,9 +1,13 @@ #include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.bson; +import rfl; + namespace test_unique_ptr { diff --git a/tests/bson/test_unique_ptr2.cpp b/tests/bson/test_unique_ptr2.cpp index 7baa452d0..2367af19b 100644 --- a/tests/bson/test_unique_ptr2.cpp +++ b/tests/bson/test_unique_ptr2.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.bson; +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/bson/test_variant.cpp b/tests/bson/test_variant.cpp index d909356bd..76296d464 100644 --- a/tests/bson/test_variant.cpp +++ b/tests/bson/test_variant.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.bson; +import rfl; + namespace test_variant { diff --git a/tests/bson/test_vectorstring.cpp b/tests/bson/test_vectorstring.cpp index db624c353..56794332f 100644 --- a/tests/bson/test_vectorstring.cpp +++ b/tests/bson/test_vectorstring.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + namespace test_vectorstring { diff --git a/tests/bson/test_wstring.cpp b/tests/bson/test_wstring.cpp index 70cabfe60..1bf5dfd48 100644 --- a/tests/bson/test_wstring.cpp +++ b/tests/bson/test_wstring.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.bson; +import rfl; + struct TestStruct { std::string theNormalString; diff --git a/tests/bson/write_and_read.hpp b/tests/bson/write_and_read.hpp index 5f38b0814..d48522514 100644 --- a/tests/bson/write_and_read.hpp +++ b/tests/bson/write_and_read.hpp @@ -2,8 +2,11 @@ #define WRITE_AND_READ_ #include +#include + +import rfl.bson; + -#include template void write_and_read(const auto& _struct) { diff --git a/tests/capnproto/CMakeLists.txt b/tests/capnproto/CMakeLists.txt index a7755b107..c7ecc3c72 100644 --- a/tests/capnproto/CMakeLists.txt +++ b/tests/capnproto/CMakeLists.txt @@ -7,7 +7,7 @@ add_executable( reflect-cpp-capnproto-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-capnproto-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-capnproto-tests PRIVATE ) target_link_libraries(reflect-cpp-capnproto-tests PRIVATE reflectcpp_tests_crt) diff --git a/tests/capnproto/compile_fail/capnproto_read_istream_schema.cpp b/tests/capnproto/compile_fail/capnproto_read_istream_schema.cpp index 0ea5121bd..24aafbbff 100644 --- a/tests/capnproto/compile_fail/capnproto_read_istream_schema.cpp +++ b/tests/capnproto/compile_fail/capnproto_read_istream_schema.cpp @@ -8,9 +8,10 @@ #include #include +import rfl; +import rfl.capnproto; + -#include -#include struct Simple { std::string field1; diff --git a/tests/capnproto/test_add_struct_name.cpp b/tests/capnproto/test_add_struct_name.cpp index 64a93d33c..3b2771bdb 100644 --- a/tests/capnproto/test_add_struct_name.cpp +++ b/tests/capnproto/test_add_struct_name.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.capnproto; namespace test_add_struct_name { diff --git a/tests/capnproto/test_array.cpp b/tests/capnproto/test_array.cpp index 3753232c7..658fe5d88 100644 --- a/tests/capnproto/test_array.cpp +++ b/tests/capnproto/test_array.cpp @@ -1,13 +1,16 @@ #include #include -#include #include // Make sure things still compile when // rfl.hpp is included after rfl/capnproto.hpp. -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.capnproto; + namespace test_array { diff --git a/tests/capnproto/test_box.cpp b/tests/capnproto/test_box.cpp index 33356d850..104c53932 100644 --- a/tests/capnproto/test_box.cpp +++ b/tests/capnproto/test_box.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; + namespace test_box { diff --git a/tests/capnproto/test_bytestring.cpp b/tests/capnproto/test_bytestring.cpp index fa531dc75..c8e96a421 100644 --- a/tests/capnproto/test_bytestring.cpp +++ b/tests/capnproto/test_bytestring.cpp @@ -1,6 +1,10 @@ -#include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; + namespace test_bytestring { diff --git a/tests/capnproto/test_custom_class1.cpp b/tests/capnproto/test_custom_class1.cpp index a8ca3dfee..1fc02eda5 100644 --- a/tests/capnproto/test_custom_class1.cpp +++ b/tests/capnproto/test_custom_class1.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_custom_class1 { diff --git a/tests/capnproto/test_custom_class3.cpp b/tests/capnproto/test_custom_class3.cpp index 9f47c9cbd..7319cfa9b 100644 --- a/tests/capnproto/test_custom_class3.cpp +++ b/tests/capnproto/test_custom_class3.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_custom_class3 { diff --git a/tests/capnproto/test_custom_class4.cpp b/tests/capnproto/test_custom_class4.cpp index 867f6b46e..352a76862 100644 --- a/tests/capnproto/test_custom_class4.cpp +++ b/tests/capnproto/test_custom_class4.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; + namespace test_custom_class4 { diff --git a/tests/capnproto/test_default_values.cpp b/tests/capnproto/test_default_values.cpp index 756a89d44..86d378d12 100644 --- a/tests/capnproto/test_default_values.cpp +++ b/tests/capnproto/test_default_values.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_default_values { diff --git a/tests/capnproto/test_deque.cpp b/tests/capnproto/test_deque.cpp index c26cf2499..9ed955529 100644 --- a/tests/capnproto/test_deque.cpp +++ b/tests/capnproto/test_deque.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.capnproto; +import rfl; + namespace test_deque { diff --git a/tests/capnproto/test_enum.cpp b/tests/capnproto/test_enum.cpp index c21e83af6..a1df7070d 100644 --- a/tests/capnproto/test_enum.cpp +++ b/tests/capnproto/test_enum.cpp @@ -1,8 +1,10 @@ #include -#include -#include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; +import rfl.json; + namespace test_enum { diff --git a/tests/capnproto/test_field_variant.cpp b/tests/capnproto/test_field_variant.cpp index a6ca27893..8ef576d50 100644 --- a/tests/capnproto/test_field_variant.cpp +++ b/tests/capnproto/test_field_variant.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_field_variant { diff --git a/tests/capnproto/test_field_variant_std.cpp b/tests/capnproto/test_field_variant_std.cpp index 0aefd665c..9a6057b20 100644 --- a/tests/capnproto/test_field_variant_std.cpp +++ b/tests/capnproto/test_field_variant_std.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; + namespace test_field_variant_std { diff --git a/tests/capnproto/test_flag_enum.cpp b/tests/capnproto/test_flag_enum.cpp index fcb3981bb..d5fabe0df 100644 --- a/tests/capnproto/test_flag_enum.cpp +++ b/tests/capnproto/test_flag_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_flag_enum { diff --git a/tests/capnproto/test_flag_enum_with_int.cpp b/tests/capnproto/test_flag_enum_with_int.cpp index dcc044ce4..9d45d847c 100644 --- a/tests/capnproto/test_flag_enum_with_int.cpp +++ b/tests/capnproto/test_flag_enum_with_int.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/capnproto/test_flatten.cpp b/tests/capnproto/test_flatten.cpp index 8392ac5b7..bfd867bed 100644 --- a/tests/capnproto/test_flatten.cpp +++ b/tests/capnproto/test_flatten.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_flatten { diff --git a/tests/capnproto/test_flatten_anonymous.cpp b/tests/capnproto/test_flatten_anonymous.cpp index 92cf36d55..6e40eb1f0 100644 --- a/tests/capnproto/test_flatten_anonymous.cpp +++ b/tests/capnproto/test_flatten_anonymous.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/capnproto/test_forward_list.cpp b/tests/capnproto/test_forward_list.cpp index a2910bebf..55bf54eaa 100644 --- a/tests/capnproto/test_forward_list.cpp +++ b/tests/capnproto/test_forward_list.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.capnproto; +import rfl; + namespace test_forward_list { diff --git a/tests/capnproto/test_literal.cpp b/tests/capnproto/test_literal.cpp index c1324c638..b024e15ef 100644 --- a/tests/capnproto/test_literal.cpp +++ b/tests/capnproto/test_literal.cpp @@ -1,9 +1,11 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; +import rfl.json; + namespace test_literal { diff --git a/tests/capnproto/test_literal_map.cpp b/tests/capnproto/test_literal_map.cpp index 2e5a1cde3..3cb05d045 100644 --- a/tests/capnproto/test_literal_map.cpp +++ b/tests/capnproto/test_literal_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_literal_map { diff --git a/tests/capnproto/test_map.cpp b/tests/capnproto/test_map.cpp index a43512d35..043caaba9 100644 --- a/tests/capnproto/test_map.cpp +++ b/tests/capnproto/test_map.cpp @@ -1,9 +1,14 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl.capnproto; +import rfl; +import rfl.json; + namespace test_map { diff --git a/tests/capnproto/test_map2.cpp b/tests/capnproto/test_map2.cpp index 82ad9bda2..f47e0b96e 100644 --- a/tests/capnproto/test_map2.cpp +++ b/tests/capnproto/test_map2.cpp @@ -1,9 +1,13 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; +import rfl.json; + namespace test_map2 { diff --git a/tests/capnproto/test_map_value_types.cpp b/tests/capnproto/test_map_value_types.cpp index f53c375ff..d3fe55e1a 100644 --- a/tests/capnproto/test_map_value_types.cpp +++ b/tests/capnproto/test_map_value_types.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; + namespace test_map_value_types { diff --git a/tests/capnproto/test_monster_example.cpp b/tests/capnproto/test_monster_example.cpp index 9d3e2cac6..43f96bdcf 100644 --- a/tests/capnproto/test_monster_example.cpp +++ b/tests/capnproto/test_monster_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_monster_example { diff --git a/tests/capnproto/test_optional_fields.cpp b/tests/capnproto/test_optional_fields.cpp index 05e6f3eab..fd7b5ea0c 100644 --- a/tests/capnproto/test_optional_fields.cpp +++ b/tests/capnproto/test_optional_fields.cpp @@ -1,9 +1,13 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; +import rfl.json; + namespace test_optional_fields { diff --git a/tests/capnproto/test_optionals_in_vectors.cpp b/tests/capnproto/test_optionals_in_vectors.cpp index cfac09ec2..fb2bbdfb7 100644 --- a/tests/capnproto/test_optionals_in_vectors.cpp +++ b/tests/capnproto/test_optionals_in_vectors.cpp @@ -1,9 +1,13 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; +import rfl.json; + namespace test_optionals_in_vectors { diff --git a/tests/capnproto/test_person.cpp b/tests/capnproto/test_person.cpp index dddb48805..72fc40f4b 100644 --- a/tests/capnproto/test_person.cpp +++ b/tests/capnproto/test_person.cpp @@ -1,11 +1,12 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.capnproto; + namespace test_tutorial_example { diff --git a/tests/capnproto/test_readme_example.cpp b/tests/capnproto/test_readme_example.cpp index 6e09fd787..2c91bdc1e 100644 --- a/tests/capnproto/test_readme_example.cpp +++ b/tests/capnproto/test_readme_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_readme_example { diff --git a/tests/capnproto/test_readme_example2.cpp b/tests/capnproto/test_readme_example2.cpp index ea1087dfc..d1045ffcd 100644 --- a/tests/capnproto/test_readme_example2.cpp +++ b/tests/capnproto/test_readme_example2.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_readme_example2 { diff --git a/tests/capnproto/test_readme_example3.cpp b/tests/capnproto/test_readme_example3.cpp index dd89ff1e6..b14ba9270 100644 --- a/tests/capnproto/test_readme_example3.cpp +++ b/tests/capnproto/test_readme_example3.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_readme_example3 { diff --git a/tests/capnproto/test_ref.cpp b/tests/capnproto/test_ref.cpp index 4c4a000b4..192c6d626 100644 --- a/tests/capnproto/test_ref.cpp +++ b/tests/capnproto/test_ref.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; + namespace test_ref { diff --git a/tests/capnproto/test_rfl_tuple.cpp b/tests/capnproto/test_rfl_tuple.cpp index 6e94f36e7..74af3ea00 100644 --- a/tests/capnproto/test_rfl_tuple.cpp +++ b/tests/capnproto/test_rfl_tuple.cpp @@ -1,10 +1,14 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; +import rfl.json; + namespace test_rfl_tuple { diff --git a/tests/capnproto/test_rfl_variant.cpp b/tests/capnproto/test_rfl_variant.cpp index 81d715f47..8505fd87c 100644 --- a/tests/capnproto/test_rfl_variant.cpp +++ b/tests/capnproto/test_rfl_variant.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; + namespace test_variant { diff --git a/tests/capnproto/test_save_load.cpp b/tests/capnproto/test_save_load.cpp index b782517a5..bb9c02ad4 100644 --- a/tests/capnproto/test_save_load.cpp +++ b/tests/capnproto/test_save_load.cpp @@ -1,10 +1,11 @@ #include #include -#include -#include #include #include +import rfl; +import rfl.capnproto; + namespace test_save_load { diff --git a/tests/capnproto/test_set.cpp b/tests/capnproto/test_set.cpp index 0881e460a..d4388480b 100644 --- a/tests/capnproto/test_set.cpp +++ b/tests/capnproto/test_set.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.capnproto; +import rfl; + namespace test_set { diff --git a/tests/capnproto/test_shared_ptr.cpp b/tests/capnproto/test_shared_ptr.cpp index 5639ce5a4..534155371 100644 --- a/tests/capnproto/test_shared_ptr.cpp +++ b/tests/capnproto/test_shared_ptr.cpp @@ -1,10 +1,14 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; +import rfl.json; + namespace test_shared_ptr { diff --git a/tests/capnproto/test_size.cpp b/tests/capnproto/test_size.cpp index 53cda167c..487f5c980 100644 --- a/tests/capnproto/test_size.cpp +++ b/tests/capnproto/test_size.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_size { diff --git a/tests/capnproto/test_string_map.cpp b/tests/capnproto/test_string_map.cpp index 6da2173ce..4c4e97803 100644 --- a/tests/capnproto/test_string_map.cpp +++ b/tests/capnproto/test_string_map.cpp @@ -1,10 +1,12 @@ #include #include -#include -#include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; +import rfl.json; + namespace test_string_map { diff --git a/tests/capnproto/test_tagged_union.cpp b/tests/capnproto/test_tagged_union.cpp index 4aa218e99..696a00fa4 100644 --- a/tests/capnproto/test_tagged_union.cpp +++ b/tests/capnproto/test_tagged_union.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_tagged_union { diff --git a/tests/capnproto/test_timestamp.cpp b/tests/capnproto/test_timestamp.cpp index 119ec6f43..64f36c1bf 100644 --- a/tests/capnproto/test_timestamp.cpp +++ b/tests/capnproto/test_timestamp.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_timestamp { diff --git a/tests/capnproto/test_tuple.cpp b/tests/capnproto/test_tuple.cpp index 0aa9af4dd..8ba959cdf 100644 --- a/tests/capnproto/test_tuple.cpp +++ b/tests/capnproto/test_tuple.cpp @@ -1,11 +1,15 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; +import rfl.json; + namespace test_tuple { diff --git a/tests/capnproto/test_tutorial_example.cpp b/tests/capnproto/test_tutorial_example.cpp index 338dc078f..7817f7ff0 100644 --- a/tests/capnproto/test_tutorial_example.cpp +++ b/tests/capnproto/test_tutorial_example.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include +import rfl; +import rfl.capnproto; + // #include "write_and_read.hpp" diff --git a/tests/capnproto/test_uint64.cpp b/tests/capnproto/test_uint64.cpp index df43c478f..35173ac41 100644 --- a/tests/capnproto/test_uint64.cpp +++ b/tests/capnproto/test_uint64.cpp @@ -1,9 +1,11 @@ -#include #include #include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + namespace test_uint64 { diff --git a/tests/capnproto/test_unique_ptr.cpp b/tests/capnproto/test_unique_ptr.cpp index faee7144d..a85ac889e 100644 --- a/tests/capnproto/test_unique_ptr.cpp +++ b/tests/capnproto/test_unique_ptr.cpp @@ -1,10 +1,14 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; +import rfl.json; + namespace test_unique_ptr { diff --git a/tests/capnproto/test_unique_ptr2.cpp b/tests/capnproto/test_unique_ptr2.cpp index 2387c5823..1477e0789 100644 --- a/tests/capnproto/test_unique_ptr2.cpp +++ b/tests/capnproto/test_unique_ptr2.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.capnproto; +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/capnproto/test_variant.cpp b/tests/capnproto/test_variant.cpp index 271b852a4..2e755d839 100644 --- a/tests/capnproto/test_variant.cpp +++ b/tests/capnproto/test_variant.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.capnproto; +import rfl; + namespace test_variant { diff --git a/tests/capnproto/test_variants_in_vectors.cpp b/tests/capnproto/test_variants_in_vectors.cpp index 62128caee..64903b5ff 100644 --- a/tests/capnproto/test_variants_in_vectors.cpp +++ b/tests/capnproto/test_variants_in_vectors.cpp @@ -1,9 +1,13 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.capnproto; +import rfl; +import rfl.json; + namespace test_variants_in_vectors { diff --git a/tests/capnproto/test_wstring.cpp b/tests/capnproto/test_wstring.cpp index 39f4a38bc..581f7cb3c 100644 --- a/tests/capnproto/test_wstring.cpp +++ b/tests/capnproto/test_wstring.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.capnproto; +import rfl; + struct TestStruct { std::string theNormalString; diff --git a/tests/capnproto/write_and_read.hpp b/tests/capnproto/write_and_read.hpp index fab5c65e0..c5bbe34c5 100644 --- a/tests/capnproto/write_and_read.hpp +++ b/tests/capnproto/write_and_read.hpp @@ -2,8 +2,11 @@ #define WRITE_AND_READ_ #include +#include + +import rfl.capnproto; + -#include template void write_and_read(const auto& _struct) { diff --git a/tests/cbor/CMakeLists.txt b/tests/cbor/CMakeLists.txt index 174eed149..74cbd5fb3 100644 --- a/tests/cbor/CMakeLists.txt +++ b/tests/cbor/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-cbor-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-cbor-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-cbor-tests PRIVATE ) target_link_libraries(reflect-cpp-cbor-tests PRIVATE reflectcpp_tests_crt) diff --git a/tests/cbor/test_add_struct_name.cpp b/tests/cbor/test_add_struct_name.cpp index 2d88a7e6c..5b2066352 100644 --- a/tests/cbor/test_add_struct_name.cpp +++ b/tests/cbor/test_add_struct_name.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.cbor; namespace test_add_struct_name { diff --git a/tests/cbor/test_array.cpp b/tests/cbor/test_array.cpp index e27b0e75e..966bb11bc 100644 --- a/tests/cbor/test_array.cpp +++ b/tests/cbor/test_array.cpp @@ -1,13 +1,16 @@ #include #include -#include #include // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.cbor; + namespace test_array { diff --git a/tests/cbor/test_box.cpp b/tests/cbor/test_box.cpp index 64e7ff16c..f6490008e 100644 --- a/tests/cbor/test_box.cpp +++ b/tests/cbor/test_box.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.cbor; +import rfl; + namespace test_box { diff --git a/tests/cbor/test_bytestring.cpp b/tests/cbor/test_bytestring.cpp index d5f5990b2..d2ce3df09 100644 --- a/tests/cbor/test_bytestring.cpp +++ b/tests/cbor/test_bytestring.cpp @@ -1,6 +1,10 @@ -#include #include "write_and_read.hpp" +#include + +import rfl.cbor; +import rfl; + namespace test_bytestring { diff --git a/tests/cbor/test_combined_processors.cpp b/tests/cbor/test_combined_processors.cpp index eb166cbbc..53ef27526 100644 --- a/tests/cbor/test_combined_processors.cpp +++ b/tests/cbor/test_combined_processors.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.cbor; namespace test_combined_processors { diff --git a/tests/cbor/test_custom_class1.cpp b/tests/cbor/test_custom_class1.cpp index dcf09b2a5..2ce8d3870 100644 --- a/tests/cbor/test_custom_class1.cpp +++ b/tests/cbor/test_custom_class1.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_custom_class1 { diff --git a/tests/cbor/test_custom_class3.cpp b/tests/cbor/test_custom_class3.cpp index c4370cfb8..a2c36426b 100644 --- a/tests/cbor/test_custom_class3.cpp +++ b/tests/cbor/test_custom_class3.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_custom_class3 { diff --git a/tests/cbor/test_custom_class4.cpp b/tests/cbor/test_custom_class4.cpp index 8539c79a0..ae06833bf 100644 --- a/tests/cbor/test_custom_class4.cpp +++ b/tests/cbor/test_custom_class4.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_custom_class4 { diff --git a/tests/cbor/test_default_values.cpp b/tests/cbor/test_default_values.cpp index 82b16f662..e74d4658d 100644 --- a/tests/cbor/test_default_values.cpp +++ b/tests/cbor/test_default_values.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_default_values { diff --git a/tests/cbor/test_deque.cpp b/tests/cbor/test_deque.cpp index e9948149f..4a46ee844 100644 --- a/tests/cbor/test_deque.cpp +++ b/tests/cbor/test_deque.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.cbor; +import rfl; + namespace test_deque { diff --git a/tests/cbor/test_enum.cpp b/tests/cbor/test_enum.cpp index 861bd8b0e..0d5282066 100644 --- a/tests/cbor/test_enum.cpp +++ b/tests/cbor/test_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_enum { diff --git a/tests/cbor/test_error_messages.cpp b/tests/cbor/test_error_messages.cpp index 8fb063a16..47b3785f3 100644 --- a/tests/cbor/test_error_messages.cpp +++ b/tests/cbor/test_error_messages.cpp @@ -1,10 +1,11 @@ #include -#include -#include -#include #include #include +import rfl; +import rfl.json; +import rfl.cbor; + namespace test_error_messages { diff --git a/tests/cbor/test_extra_fields.cpp b/tests/cbor/test_extra_fields.cpp index fe77536e5..3a6767e42 100644 --- a/tests/cbor/test_extra_fields.cpp +++ b/tests/cbor/test_extra_fields.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_extra_fields { diff --git a/tests/cbor/test_field_variant.cpp b/tests/cbor/test_field_variant.cpp index e85936570..f1e0d3b09 100644 --- a/tests/cbor/test_field_variant.cpp +++ b/tests/cbor/test_field_variant.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_field_variant { diff --git a/tests/cbor/test_flag_enum.cpp b/tests/cbor/test_flag_enum.cpp index f31a4e2e9..1899ca70e 100644 --- a/tests/cbor/test_flag_enum.cpp +++ b/tests/cbor/test_flag_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_flag_enum { diff --git a/tests/cbor/test_flag_enum_with_int.cpp b/tests/cbor/test_flag_enum_with_int.cpp index 8978d0968..43b786db9 100644 --- a/tests/cbor/test_flag_enum_with_int.cpp +++ b/tests/cbor/test_flag_enum_with_int.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/cbor/test_flatten.cpp b/tests/cbor/test_flatten.cpp index 378915146..3bd34df81 100644 --- a/tests/cbor/test_flatten.cpp +++ b/tests/cbor/test_flatten.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_flatten { diff --git a/tests/cbor/test_flatten_anonymous.cpp b/tests/cbor/test_flatten_anonymous.cpp index e9a71966a..03760cdfc 100644 --- a/tests/cbor/test_flatten_anonymous.cpp +++ b/tests/cbor/test_flatten_anonymous.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/cbor/test_forward_list.cpp b/tests/cbor/test_forward_list.cpp index cb5f89e27..8e2252da6 100644 --- a/tests/cbor/test_forward_list.cpp +++ b/tests/cbor/test_forward_list.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.cbor; +import rfl; + namespace test_forward_list { diff --git a/tests/cbor/test_integers.cpp b/tests/cbor/test_integers.cpp index c09cefaad..d7da8663d 100644 --- a/tests/cbor/test_integers.cpp +++ b/tests/cbor/test_integers.cpp @@ -1,7 +1,8 @@ #include -#include #include "write_and_read.hpp" +import rfl.cbor; + namespace test_integers { diff --git a/tests/cbor/test_literal.cpp b/tests/cbor/test_literal.cpp index 591e60815..b50817f28 100644 --- a/tests/cbor/test_literal.cpp +++ b/tests/cbor/test_literal.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_literal { diff --git a/tests/cbor/test_literal_map.cpp b/tests/cbor/test_literal_map.cpp index ab101abf1..014d75db0 100644 --- a/tests/cbor/test_literal_map.cpp +++ b/tests/cbor/test_literal_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_literal_map { diff --git a/tests/cbor/test_map.cpp b/tests/cbor/test_map.cpp index 25d45e0f5..9aee6c052 100644 --- a/tests/cbor/test_map.cpp +++ b/tests/cbor/test_map.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl.cbor; +import rfl; + namespace test_map { diff --git a/tests/cbor/test_map_with_key_validation.cpp b/tests/cbor/test_map_with_key_validation.cpp index d7bb1c13c..69bb6a943 100644 --- a/tests/cbor/test_map_with_key_validation.cpp +++ b/tests/cbor/test_map_with_key_validation.cpp @@ -1,8 +1,13 @@ #include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl.cbor; +import rfl; + namespace test_map_with_key_validation { diff --git a/tests/cbor/test_monster_example.cpp b/tests/cbor/test_monster_example.cpp index 1569def75..5a07b737f 100644 --- a/tests/cbor/test_monster_example.cpp +++ b/tests/cbor/test_monster_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_monster_example { diff --git a/tests/cbor/test_no_optionals.cpp b/tests/cbor/test_no_optionals.cpp index 552cb9160..fb9862e64 100644 --- a/tests/cbor/test_no_optionals.cpp +++ b/tests/cbor/test_no_optionals.cpp @@ -1,9 +1,12 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.cbor; + namespace test_no_optionals { diff --git a/tests/cbor/test_optional_fields.cpp b/tests/cbor/test_optional_fields.cpp index 6a4309035..0bc6d3554 100644 --- a/tests/cbor/test_optional_fields.cpp +++ b/tests/cbor/test_optional_fields.cpp @@ -1,9 +1,12 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.cbor; + namespace test_optional_fields { diff --git a/tests/cbor/test_read_byte_containers.cpp b/tests/cbor/test_read_byte_containers.cpp index ed863b469..fc0291a14 100644 --- a/tests/cbor/test_read_byte_containers.cpp +++ b/tests/cbor/test_read_byte_containers.cpp @@ -2,11 +2,16 @@ #include #include -#include +#include +#include +#include + +import rfl; +import rfl.cbor; + // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include namespace test_read_byte_containers { diff --git a/tests/cbor/test_readme_example.cpp b/tests/cbor/test_readme_example.cpp index c069be9cb..138a0264f 100644 --- a/tests/cbor/test_readme_example.cpp +++ b/tests/cbor/test_readme_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_readme_example { diff --git a/tests/cbor/test_readme_example2.cpp b/tests/cbor/test_readme_example2.cpp index 54ec6de6a..f16e0bb9f 100644 --- a/tests/cbor/test_readme_example2.cpp +++ b/tests/cbor/test_readme_example2.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_readme_example2 { diff --git a/tests/cbor/test_ref.cpp b/tests/cbor/test_ref.cpp index 60d434b53..89af11d6c 100644 --- a/tests/cbor/test_ref.cpp +++ b/tests/cbor/test_ref.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.cbor; +import rfl; + namespace test_ref { diff --git a/tests/cbor/test_save_load.cpp b/tests/cbor/test_save_load.cpp index 54f3f2b51..99e8f8583 100644 --- a/tests/cbor/test_save_load.cpp +++ b/tests/cbor/test_save_load.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include +import rfl; +import rfl.cbor; + namespace test_save_load { diff --git a/tests/cbor/test_set.cpp b/tests/cbor/test_set.cpp index 148a0d43e..4ad76496e 100644 --- a/tests/cbor/test_set.cpp +++ b/tests/cbor/test_set.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.cbor; +import rfl; + namespace test_set { diff --git a/tests/cbor/test_size.cpp b/tests/cbor/test_size.cpp index 33b79a21d..5cd66cb8d 100644 --- a/tests/cbor/test_size.cpp +++ b/tests/cbor/test_size.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_size { diff --git a/tests/cbor/test_snake_case_to_camel_case.cpp b/tests/cbor/test_snake_case_to_camel_case.cpp index b901b8b28..c4cdbfbc3 100644 --- a/tests/cbor/test_snake_case_to_camel_case.cpp +++ b/tests/cbor/test_snake_case_to_camel_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.cbor; namespace test_snake_case_to_camel_case { diff --git a/tests/cbor/test_snake_case_to_pascal_case.cpp b/tests/cbor/test_snake_case_to_pascal_case.cpp index 1f072e0c8..de95a59ec 100644 --- a/tests/cbor/test_snake_case_to_pascal_case.cpp +++ b/tests/cbor/test_snake_case_to_pascal_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.cbor; namespace test_snake_case_to_pascal_case { diff --git a/tests/cbor/test_string_map.cpp b/tests/cbor/test_string_map.cpp index c86a42803..db18b71ac 100644 --- a/tests/cbor/test_string_map.cpp +++ b/tests/cbor/test_string_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_string_map { TEST(cbor, test_string_map) { diff --git a/tests/cbor/test_tagged_union.cpp b/tests/cbor/test_tagged_union.cpp index b4bc688f9..4e370aac5 100644 --- a/tests/cbor/test_tagged_union.cpp +++ b/tests/cbor/test_tagged_union.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_tagged_union { diff --git a/tests/cbor/test_tagged_union2.cpp b/tests/cbor/test_tagged_union2.cpp index e8c13cec2..9dffbf06d 100644 --- a/tests/cbor/test_tagged_union2.cpp +++ b/tests/cbor/test_tagged_union2.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_tagged_union2 { diff --git a/tests/cbor/test_timestamp.cpp b/tests/cbor/test_timestamp.cpp index 295a28c2d..d49ac3e19 100644 --- a/tests/cbor/test_timestamp.cpp +++ b/tests/cbor/test_timestamp.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_timestamp { diff --git a/tests/cbor/test_unique_ptr.cpp b/tests/cbor/test_unique_ptr.cpp index 49129d998..51ce22131 100644 --- a/tests/cbor/test_unique_ptr.cpp +++ b/tests/cbor/test_unique_ptr.cpp @@ -1,9 +1,13 @@ #include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.cbor; +import rfl; + namespace test_unique_ptr { diff --git a/tests/cbor/test_unique_ptr2.cpp b/tests/cbor/test_unique_ptr2.cpp index 41f2ed914..814e9ba17 100644 --- a/tests/cbor/test_unique_ptr2.cpp +++ b/tests/cbor/test_unique_ptr2.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.cbor; +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/cbor/test_variant.cpp b/tests/cbor/test_variant.cpp index 7ba1c02bc..1f20078f1 100644 --- a/tests/cbor/test_variant.cpp +++ b/tests/cbor/test_variant.cpp @@ -1,8 +1,13 @@ #include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl.cbor; +import rfl; + namespace test_variant { diff --git a/tests/cbor/test_variant_auto_tagging.cpp b/tests/cbor/test_variant_auto_tagging.cpp index 642304b44..f80c1ffb3 100644 --- a/tests/cbor/test_variant_auto_tagging.cpp +++ b/tests/cbor/test_variant_auto_tagging.cpp @@ -1,9 +1,13 @@ #include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.cbor; +import rfl; + // NOTE TO MAINTAINERS: // These tests are very similar to the others in diff --git a/tests/cbor/test_vectorstring.cpp b/tests/cbor/test_vectorstring.cpp index 682290d16..b3603b6eb 100644 --- a/tests/cbor/test_vectorstring.cpp +++ b/tests/cbor/test_vectorstring.cpp @@ -1,6 +1,8 @@ -#include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + namespace test_vectorstring { diff --git a/tests/cbor/test_wstring.cpp b/tests/cbor/test_wstring.cpp index 9c4c11b75..d7a99ae7d 100644 --- a/tests/cbor/test_wstring.cpp +++ b/tests/cbor/test_wstring.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.cbor; +import rfl; + struct TestStruct { std::string theNormalString; diff --git a/tests/cbor/write_and_read.hpp b/tests/cbor/write_and_read.hpp index ea011ea47..a57b470d0 100644 --- a/tests/cbor/write_and_read.hpp +++ b/tests/cbor/write_and_read.hpp @@ -3,9 +3,16 @@ #include +#include +#include #include -#include +#include #include +#include +#include + +import rfl.cbor; + // Helper function to parse hex bytes from CBOR diagnostic output template diff --git a/tests/cereal/CMakeLists.txt b/tests/cereal/CMakeLists.txt index e3b915fb2..2fae68e5c 100644 --- a/tests/cereal/CMakeLists.txt +++ b/tests/cereal/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-cereal-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-cereal-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-cereal-tests PRIVATE ) target_link_libraries(reflect-cpp-cereal-tests PRIVATE reflectcpp_tests_crt) diff --git a/tests/cereal/test_add_struct_name.cpp b/tests/cereal/test_add_struct_name.cpp index 1f8e5ab13..50e44ddfa 100644 --- a/tests/cereal/test_add_struct_name.cpp +++ b/tests/cereal/test_add_struct_name.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.cereal; namespace test_add_struct_name { diff --git a/tests/cereal/test_array.cpp b/tests/cereal/test_array.cpp index 81412d435..b47128bdb 100644 --- a/tests/cereal/test_array.cpp +++ b/tests/cereal/test_array.cpp @@ -1,11 +1,14 @@ #include #include -#include #include -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.cereal; + namespace test_array { diff --git a/tests/cereal/test_box.cpp b/tests/cereal/test_box.cpp index 06c44cb22..b6669fab9 100644 --- a/tests/cereal/test_box.cpp +++ b/tests/cereal/test_box.cpp @@ -1,10 +1,13 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.cereal; + namespace test_box { diff --git a/tests/cereal/test_bytestring.cpp b/tests/cereal/test_bytestring.cpp index 8a897ca12..66163ae00 100644 --- a/tests/cereal/test_bytestring.cpp +++ b/tests/cereal/test_bytestring.cpp @@ -1,6 +1,10 @@ -#include #include "write_and_read.hpp" +#include + +import rfl.cereal; +import rfl; + namespace test_bytestring { diff --git a/tests/cereal/test_custom_class1.cpp b/tests/cereal/test_custom_class1.cpp index ec1c4aefe..40215098c 100644 --- a/tests/cereal/test_custom_class1.cpp +++ b/tests/cereal/test_custom_class1.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + namespace test_custom_class1 { diff --git a/tests/cereal/test_custom_class3.cpp b/tests/cereal/test_custom_class3.cpp index 1876297d3..ba8cb2977 100644 --- a/tests/cereal/test_custom_class3.cpp +++ b/tests/cereal/test_custom_class3.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + namespace test_custom_class3 { diff --git a/tests/cereal/test_custom_class4.cpp b/tests/cereal/test_custom_class4.cpp index 97ddd04d7..9fe50d795 100644 --- a/tests/cereal/test_custom_class4.cpp +++ b/tests/cereal/test_custom_class4.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl.cereal; +import rfl; + namespace test_custom_class4 { diff --git a/tests/cereal/test_default_values.cpp b/tests/cereal/test_default_values.cpp index 3fb3c9160..e95828fd1 100644 --- a/tests/cereal/test_default_values.cpp +++ b/tests/cereal/test_default_values.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + namespace test_default_values { diff --git a/tests/cereal/test_deque.cpp b/tests/cereal/test_deque.cpp index a0bcc9474..b94d4ecda 100644 --- a/tests/cereal/test_deque.cpp +++ b/tests/cereal/test_deque.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.cereal; +import rfl; + namespace test_deque { diff --git a/tests/cereal/test_enum.cpp b/tests/cereal/test_enum.cpp index 925200726..b7bc63c32 100644 --- a/tests/cereal/test_enum.cpp +++ b/tests/cereal/test_enum.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.cereal; + namespace test_enum { diff --git a/tests/cereal/test_field_variant.cpp b/tests/cereal/test_field_variant.cpp index 5c0d3d9fd..119ab249d 100644 --- a/tests/cereal/test_field_variant.cpp +++ b/tests/cereal/test_field_variant.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + namespace test_field_variant { diff --git a/tests/cereal/test_field_variant_std.cpp b/tests/cereal/test_field_variant_std.cpp index 4932cb24d..35e00b03d 100644 --- a/tests/cereal/test_field_variant_std.cpp +++ b/tests/cereal/test_field_variant_std.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.cereal; +import rfl; + namespace test_field_variant_std { diff --git a/tests/cereal/test_flag_enum.cpp b/tests/cereal/test_flag_enum.cpp index aa7d13965..15f4f2ab3 100644 --- a/tests/cereal/test_flag_enum.cpp +++ b/tests/cereal/test_flag_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + namespace test_flag_enum { diff --git a/tests/cereal/test_flag_enum_with_int.cpp b/tests/cereal/test_flag_enum_with_int.cpp index 3605e8cbd..aca530792 100644 --- a/tests/cereal/test_flag_enum_with_int.cpp +++ b/tests/cereal/test_flag_enum_with_int.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/cereal/test_flatten.cpp b/tests/cereal/test_flatten.cpp index 50323a912..7d1f1ea89 100644 --- a/tests/cereal/test_flatten.cpp +++ b/tests/cereal/test_flatten.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + namespace test_flatten { diff --git a/tests/cereal/test_flatten_anonymous.cpp b/tests/cereal/test_flatten_anonymous.cpp index ec8ea1182..44f0f504d 100644 --- a/tests/cereal/test_flatten_anonymous.cpp +++ b/tests/cereal/test_flatten_anonymous.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/cereal/test_forward_list.cpp b/tests/cereal/test_forward_list.cpp index 5b1696cbb..a6c97037e 100644 --- a/tests/cereal/test_forward_list.cpp +++ b/tests/cereal/test_forward_list.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.cereal; +import rfl; + namespace test_forward_list { diff --git a/tests/cereal/test_generic.cpp b/tests/cereal/test_generic.cpp index 1dfd789d1..f17f68a88 100644 --- a/tests/cereal/test_generic.cpp +++ b/tests/cereal/test_generic.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.cereal; + namespace test_generic { diff --git a/tests/cereal/test_literal.cpp b/tests/cereal/test_literal.cpp index 873bece8e..37cd81423 100644 --- a/tests/cereal/test_literal.cpp +++ b/tests/cereal/test_literal.cpp @@ -1,9 +1,11 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; +import rfl.json; + namespace test_literal { diff --git a/tests/cereal/test_literal_map.cpp b/tests/cereal/test_literal_map.cpp index f3baa931c..693e791b6 100644 --- a/tests/cereal/test_literal_map.cpp +++ b/tests/cereal/test_literal_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + namespace test_literal_map { diff --git a/tests/cereal/test_map.cpp b/tests/cereal/test_map.cpp index 3b8aad9c1..28a291f49 100644 --- a/tests/cereal/test_map.cpp +++ b/tests/cereal/test_map.cpp @@ -1,11 +1,15 @@ #include #include -#include -#include #include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.cereal; + namespace test_map { diff --git a/tests/cereal/test_map2.cpp b/tests/cereal/test_map2.cpp index dddc2b456..9a7013b3c 100644 --- a/tests/cereal/test_map2.cpp +++ b/tests/cereal/test_map2.cpp @@ -1,9 +1,13 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl.cereal; +import rfl; +import rfl.json; + namespace test_map2 { diff --git a/tests/cereal/test_monster_example.cpp b/tests/cereal/test_monster_example.cpp index 3bf66f849..9fea3ea8e 100644 --- a/tests/cereal/test_monster_example.cpp +++ b/tests/cereal/test_monster_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + namespace test_monster_example { diff --git a/tests/cereal/test_optional_fields.cpp b/tests/cereal/test_optional_fields.cpp index c1ce79a23..13708ddf1 100644 --- a/tests/cereal/test_optional_fields.cpp +++ b/tests/cereal/test_optional_fields.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.cereal; + namespace test_optional_fields { diff --git a/tests/cereal/test_optionals_in_vectors.cpp b/tests/cereal/test_optionals_in_vectors.cpp index 70c952a33..549c53775 100644 --- a/tests/cereal/test_optionals_in_vectors.cpp +++ b/tests/cereal/test_optionals_in_vectors.cpp @@ -1,9 +1,13 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.cereal; +import rfl; +import rfl.json; + namespace test_optionals_in_vectors { diff --git a/tests/cereal/test_person.cpp b/tests/cereal/test_person.cpp index aa33cd539..85d0e14d0 100644 --- a/tests/cereal/test_person.cpp +++ b/tests/cereal/test_person.cpp @@ -1,11 +1,12 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.cereal; + namespace test_person { diff --git a/tests/cereal/test_readme_example.cpp b/tests/cereal/test_readme_example.cpp index 6cc2baaae..197be5ffb 100644 --- a/tests/cereal/test_readme_example.cpp +++ b/tests/cereal/test_readme_example.cpp @@ -1,9 +1,10 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.cereal; + namespace test_readme_example { diff --git a/tests/cereal/test_readme_example2.cpp b/tests/cereal/test_readme_example2.cpp index b912b2be1..fa449e6cb 100644 --- a/tests/cereal/test_readme_example2.cpp +++ b/tests/cereal/test_readme_example2.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + namespace test_readme_example2 { diff --git a/tests/cereal/test_readme_example3.cpp b/tests/cereal/test_readme_example3.cpp index 4c9873c22..9f7c9b4d0 100644 --- a/tests/cereal/test_readme_example3.cpp +++ b/tests/cereal/test_readme_example3.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + namespace test_readme_example3 { diff --git a/tests/cereal/test_ref.cpp b/tests/cereal/test_ref.cpp index 0e4a2f2ec..5d0ced880 100644 --- a/tests/cereal/test_ref.cpp +++ b/tests/cereal/test_ref.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.cereal; +import rfl; + namespace test_ref { diff --git a/tests/cereal/test_rfl_tuple.cpp b/tests/cereal/test_rfl_tuple.cpp index 5729a867e..c43ab731a 100644 --- a/tests/cereal/test_rfl_tuple.cpp +++ b/tests/cereal/test_rfl_tuple.cpp @@ -1,10 +1,14 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl.cereal; +import rfl; +import rfl.json; + namespace test_rfl_tuple { diff --git a/tests/cereal/test_rfl_variant.cpp b/tests/cereal/test_rfl_variant.cpp index 4be257c94..e37073333 100644 --- a/tests/cereal/test_rfl_variant.cpp +++ b/tests/cereal/test_rfl_variant.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.cereal; +import rfl; + namespace test_variant { diff --git a/tests/cereal/test_save_load.cpp b/tests/cereal/test_save_load.cpp index c719d434b..e8cddb9d8 100644 --- a/tests/cereal/test_save_load.cpp +++ b/tests/cereal/test_save_load.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.cereal; + namespace test_save_load { struct Person { diff --git a/tests/cereal/test_set.cpp b/tests/cereal/test_set.cpp index bf8aa128b..362e65152 100644 --- a/tests/cereal/test_set.cpp +++ b/tests/cereal/test_set.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.cereal; +import rfl; + namespace test_set { diff --git a/tests/cereal/test_shared_ptr.cpp b/tests/cereal/test_shared_ptr.cpp index f9a870a04..326a24a51 100644 --- a/tests/cereal/test_shared_ptr.cpp +++ b/tests/cereal/test_shared_ptr.cpp @@ -1,10 +1,14 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.cereal; +import rfl; +import rfl.json; + namespace test_shared_ptr { diff --git a/tests/cereal/test_size.cpp b/tests/cereal/test_size.cpp index 4d6741465..061b23274 100644 --- a/tests/cereal/test_size.cpp +++ b/tests/cereal/test_size.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + namespace test_size { diff --git a/tests/cereal/test_string_map.cpp b/tests/cereal/test_string_map.cpp index b0e16ec77..3b37fa951 100644 --- a/tests/cereal/test_string_map.cpp +++ b/tests/cereal/test_string_map.cpp @@ -1,10 +1,12 @@ #include #include -#include -#include #include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; +import rfl.json; + namespace test_string_map { diff --git a/tests/cereal/test_tagged_union.cpp b/tests/cereal/test_tagged_union.cpp index 00eb5baf2..770bdcdc1 100644 --- a/tests/cereal/test_tagged_union.cpp +++ b/tests/cereal/test_tagged_union.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.cereal; + namespace test_tagged_union { diff --git a/tests/cereal/test_timestamp.cpp b/tests/cereal/test_timestamp.cpp index 42cbe3ade..a6cfc2eba 100644 --- a/tests/cereal/test_timestamp.cpp +++ b/tests/cereal/test_timestamp.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.cereal; + namespace test_timestamp { diff --git a/tests/cereal/test_tuple.cpp b/tests/cereal/test_tuple.cpp index c7dfcfe24..9cc3dd11a 100644 --- a/tests/cereal/test_tuple.cpp +++ b/tests/cereal/test_tuple.cpp @@ -1,11 +1,12 @@ #include -#include -#include #include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.cereal; + namespace test_tuple { diff --git a/tests/cereal/test_unique_ptr.cpp b/tests/cereal/test_unique_ptr.cpp index 588643ccc..17c60d5ed 100644 --- a/tests/cereal/test_unique_ptr.cpp +++ b/tests/cereal/test_unique_ptr.cpp @@ -1,11 +1,14 @@ #include #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.cereal; + namespace test_unique_ptr { diff --git a/tests/cereal/test_unique_ptr2.cpp b/tests/cereal/test_unique_ptr2.cpp index 31d5d72db..2757745af 100644 --- a/tests/cereal/test_unique_ptr2.cpp +++ b/tests/cereal/test_unique_ptr2.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.cereal; +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/cereal/test_variant.cpp b/tests/cereal/test_variant.cpp index b2c7e3d13..c254d60c3 100644 --- a/tests/cereal/test_variant.cpp +++ b/tests/cereal/test_variant.cpp @@ -1,10 +1,13 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.cereal; + namespace test_variant { diff --git a/tests/cereal/test_variants_in_vectors.cpp b/tests/cereal/test_variants_in_vectors.cpp index 0f1a3d891..aa8d3c0e6 100644 --- a/tests/cereal/test_variants_in_vectors.cpp +++ b/tests/cereal/test_variants_in_vectors.cpp @@ -1,9 +1,13 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.cereal; +import rfl; +import rfl.json; + namespace test_variants_in_vectors { diff --git a/tests/cereal/test_wstring.cpp b/tests/cereal/test_wstring.cpp index aef3725bf..c0298d3f3 100644 --- a/tests/cereal/test_wstring.cpp +++ b/tests/cereal/test_wstring.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.cereal; +import rfl; + struct TestStruct { std::string theNormalString; diff --git a/tests/cereal/write_and_read.hpp b/tests/cereal/write_and_read.hpp index fc84a002a..42c2adb77 100644 --- a/tests/cereal/write_and_read.hpp +++ b/tests/cereal/write_and_read.hpp @@ -2,8 +2,11 @@ #define WRITE_AND_READ_ #include +#include + +import rfl.cereal; + -#include template void write_and_read(const auto& _struct) { diff --git a/tests/cli/CMakeLists.txt b/tests/cli/CMakeLists.txt index 73bd38ddf..a20df4584 100644 --- a/tests/cli/CMakeLists.txt +++ b/tests/cli/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-cli-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-cli-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-cli-tests PRIVATE ) target_include_directories(reflect-cpp-cli-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") diff --git a/tests/cli/test_basic.cpp b/tests/cli/test_basic.cpp index 615f2d09d..2064a113c 100644 --- a/tests/cli/test_basic.cpp +++ b/tests/cli/test_basic.cpp @@ -1,7 +1,8 @@ #include -#include -#include #include +import rfl; +import rfl.cli; + namespace test_basic { diff --git a/tests/cli/test_bool_short_positional.cpp b/tests/cli/test_bool_short_positional.cpp index 55a84aee3..cc6b8e8cd 100644 --- a/tests/cli/test_bool_short_positional.cpp +++ b/tests/cli/test_bool_short_positional.cpp @@ -1,7 +1,8 @@ #include -#include -#include #include +import rfl; +import rfl.cli; + namespace test_bool_short_positional { diff --git a/tests/cli/test_enum.cpp b/tests/cli/test_enum.cpp index 29c6f033b..663ca4776 100644 --- a/tests/cli/test_enum.cpp +++ b/tests/cli/test_enum.cpp @@ -1,7 +1,8 @@ #include -#include -#include #include +import rfl; +import rfl.cli; + namespace test_enum { diff --git a/tests/cli/test_errors.cpp b/tests/cli/test_errors.cpp index 0570191c0..3fe871ce2 100644 --- a/tests/cli/test_errors.cpp +++ b/tests/cli/test_errors.cpp @@ -1,7 +1,8 @@ #include -#include -#include #include +import rfl; +import rfl.cli; + namespace test_errors { diff --git a/tests/cli/test_flatten.cpp b/tests/cli/test_flatten.cpp index 53f763a05..ed8400e49 100644 --- a/tests/cli/test_flatten.cpp +++ b/tests/cli/test_flatten.cpp @@ -1,7 +1,8 @@ #include -#include -#include #include +import rfl; +import rfl.cli; + namespace test_flatten { diff --git a/tests/cli/test_kebab_case.cpp b/tests/cli/test_kebab_case.cpp index 33a18a067..c3b4ea848 100644 --- a/tests/cli/test_kebab_case.cpp +++ b/tests/cli/test_kebab_case.cpp @@ -1,7 +1,8 @@ #include -#include -#include #include +import rfl; +import rfl.cli; + namespace test_kebab_case { diff --git a/tests/cli/test_nested.cpp b/tests/cli/test_nested.cpp index a09f80e4e..76fa146ac 100644 --- a/tests/cli/test_nested.cpp +++ b/tests/cli/test_nested.cpp @@ -1,7 +1,8 @@ #include -#include -#include #include +import rfl; +import rfl.cli; + namespace test_nested { diff --git a/tests/cli/test_optional.cpp b/tests/cli/test_optional.cpp index 1a5e12178..50ea6d12e 100644 --- a/tests/cli/test_optional.cpp +++ b/tests/cli/test_optional.cpp @@ -1,8 +1,9 @@ #include -#include -#include #include #include +import rfl; +import rfl.cli; + namespace test_optional { diff --git a/tests/cli/test_positional.cpp b/tests/cli/test_positional.cpp index da1d41726..0fe377f49 100644 --- a/tests/cli/test_positional.cpp +++ b/tests/cli/test_positional.cpp @@ -1,7 +1,10 @@ #include -#include -#include #include +#include + +import rfl; +import rfl.cli; + namespace test_positional { diff --git a/tests/cli/test_positional_and_short.cpp b/tests/cli/test_positional_and_short.cpp index 2b5caea0e..63f1d5c5e 100644 --- a/tests/cli/test_positional_and_short.cpp +++ b/tests/cli/test_positional_and_short.cpp @@ -1,7 +1,8 @@ #include -#include -#include #include +import rfl; +import rfl.cli; + namespace test_positional_and_short { diff --git a/tests/cli/test_regression_bugs.cpp b/tests/cli/test_regression_bugs.cpp index d3e68ff0a..00fb6764c 100644 --- a/tests/cli/test_regression_bugs.cpp +++ b/tests/cli/test_regression_bugs.cpp @@ -3,9 +3,10 @@ #include #include #include +import rfl; +import rfl.cli; + -#include -#include // cli::Reader stoull accepts negative numbers for unsigned types // File: include/rfl/cli/Reader.hpp:77 diff --git a/tests/cli/test_rename.cpp b/tests/cli/test_rename.cpp index 39fe709e2..c5c5118b8 100644 --- a/tests/cli/test_rename.cpp +++ b/tests/cli/test_rename.cpp @@ -1,7 +1,8 @@ #include -#include -#include #include +import rfl; +import rfl.cli; + namespace test_rename { diff --git a/tests/cli/test_settings_macro.cpp b/tests/cli/test_settings_macro.cpp index d30d28e27..23d716f9d 100644 --- a/tests/cli/test_settings_macro.cpp +++ b/tests/cli/test_settings_macro.cpp @@ -1,6 +1,10 @@ #include #include #include +#include + +import rfl; + namespace test_settings_macro { diff --git a/tests/cli/test_short.cpp b/tests/cli/test_short.cpp index e018c72d3..ad9de61b7 100644 --- a/tests/cli/test_short.cpp +++ b/tests/cli/test_short.cpp @@ -1,7 +1,8 @@ #include -#include -#include #include +import rfl; +import rfl.cli; + namespace test_short { diff --git a/tests/cli/test_vector.cpp b/tests/cli/test_vector.cpp index cd672fbf8..b53f1c49c 100644 --- a/tests/cli/test_vector.cpp +++ b/tests/cli/test_vector.cpp @@ -1,8 +1,9 @@ #include -#include -#include #include #include +import rfl; +import rfl.cli; + namespace test_vector { diff --git a/tests/csv/CMakeLists.txt b/tests/csv/CMakeLists.txt index 085e39b49..9a42b6a23 100644 --- a/tests/csv/CMakeLists.txt +++ b/tests/csv/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-csv-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-csv-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-csv-tests PRIVATE ) target_include_directories(reflect-cpp-csv-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") diff --git a/tests/csv/test_boolean.cpp b/tests/csv/test_boolean.cpp index 39ad77c1b..ed3235901 100644 --- a/tests/csv/test_boolean.cpp +++ b/tests/csv/test_boolean.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.csv; + namespace test_boolean { diff --git a/tests/csv/test_box.cpp b/tests/csv/test_box.cpp index 507a707af..bd096bcba 100644 --- a/tests/csv/test_box.cpp +++ b/tests/csv/test_box.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.csv; + namespace test_box { diff --git a/tests/csv/test_bytestring.cpp b/tests/csv/test_bytestring.cpp index 465d135d4..d923a3ebd 100644 --- a/tests/csv/test_bytestring.cpp +++ b/tests/csv/test_bytestring.cpp @@ -1,7 +1,10 @@ -#include #include #include "write_and_read.hpp" +#include + +import rfl.csv; + namespace test_bytestring { diff --git a/tests/csv/test_camel_case.cpp b/tests/csv/test_camel_case.cpp index fe1de9330..41d312755 100644 --- a/tests/csv/test_camel_case.cpp +++ b/tests/csv/test_camel_case.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.csv; + namespace test_camel_case { diff --git a/tests/csv/test_deque.cpp b/tests/csv/test_deque.cpp index fb02306d5..e38935e90 100644 --- a/tests/csv/test_deque.cpp +++ b/tests/csv/test_deque.cpp @@ -1,8 +1,9 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.csv; + namespace test_deque { diff --git a/tests/csv/test_enums.cpp b/tests/csv/test_enums.cpp index cb7897dff..8f24b40d8 100644 --- a/tests/csv/test_enums.cpp +++ b/tests/csv/test_enums.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.csv; + namespace test_enums { diff --git a/tests/csv/test_flatten.cpp b/tests/csv/test_flatten.cpp index a5dca5360..fa4d712e7 100644 --- a/tests/csv/test_flatten.cpp +++ b/tests/csv/test_flatten.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.csv; + namespace test_flatten { diff --git a/tests/csv/test_literal.cpp b/tests/csv/test_literal.cpp index 3c3f16949..0724e4dfe 100644 --- a/tests/csv/test_literal.cpp +++ b/tests/csv/test_literal.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.csv; + namespace test_literal { diff --git a/tests/csv/test_optionals.cpp b/tests/csv/test_optionals.cpp index fac02974c..71a640a99 100644 --- a/tests/csv/test_optionals.cpp +++ b/tests/csv/test_optionals.cpp @@ -1,9 +1,10 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.csv; + namespace test_optionals { diff --git a/tests/csv/test_readme_example.cpp b/tests/csv/test_readme_example.cpp index 3d39b54f8..87ba286cc 100644 --- a/tests/csv/test_readme_example.cpp +++ b/tests/csv/test_readme_example.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.csv; + namespace test_readme_example { diff --git a/tests/csv/test_ref.cpp b/tests/csv/test_ref.cpp index b48f36ac9..b366d3f07 100644 --- a/tests/csv/test_ref.cpp +++ b/tests/csv/test_ref.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.csv; + namespace test_ref { diff --git a/tests/csv/test_save_load.cpp b/tests/csv/test_save_load.cpp index 43abf314e..9918a63d3 100644 --- a/tests/csv/test_save_load.cpp +++ b/tests/csv/test_save_load.cpp @@ -1,10 +1,11 @@ #include #include -#include -#include #include #include +import rfl; +import rfl.csv; + namespace test_save_load { diff --git a/tests/csv/test_settings.cpp b/tests/csv/test_settings.cpp index 03ad02985..9696f80cb 100644 --- a/tests/csv/test_settings.cpp +++ b/tests/csv/test_settings.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.csv; + namespace test_settings { diff --git a/tests/csv/test_shared_ptr.cpp b/tests/csv/test_shared_ptr.cpp index 88b7ec714..492a7132c 100644 --- a/tests/csv/test_shared_ptr.cpp +++ b/tests/csv/test_shared_ptr.cpp @@ -1,9 +1,10 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.csv; + namespace test_shared_ptr { diff --git a/tests/csv/test_unique_ptr.cpp b/tests/csv/test_unique_ptr.cpp index a0448f0c0..91c1a4821 100644 --- a/tests/csv/test_unique_ptr.cpp +++ b/tests/csv/test_unique_ptr.cpp @@ -1,9 +1,10 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.csv; + namespace test_unique_ptr { diff --git a/tests/csv/write_and_read.hpp b/tests/csv/write_and_read.hpp index d5198e4e3..1ad944c2f 100644 --- a/tests/csv/write_and_read.hpp +++ b/tests/csv/write_and_read.hpp @@ -2,8 +2,11 @@ #define WRITE_AND_READ_ #include +#include + +import rfl.csv; + -#include template void write_and_read(const auto& _vec, const rfl::csv::Settings& _settings = diff --git a/tests/flexbuffers/CMakeLists.txt b/tests/flexbuffers/CMakeLists.txt index 63204e564..42553b67d 100644 --- a/tests/flexbuffers/CMakeLists.txt +++ b/tests/flexbuffers/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-flexbuffers-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-flexbuffers-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-flexbuffers-tests PRIVATE ) target_include_directories(reflect-cpp-flexbuffers-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") diff --git a/tests/flexbuffers/test_add_struct_name.cpp b/tests/flexbuffers/test_add_struct_name.cpp index 7b63625af..7716c0b02 100644 --- a/tests/flexbuffers/test_add_struct_name.cpp +++ b/tests/flexbuffers/test_add_struct_name.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.flexbuf; namespace test_add_struct_name { diff --git a/tests/flexbuffers/test_array.cpp b/tests/flexbuffers/test_array.cpp index 76ec1eb4d..a59fbca7e 100644 --- a/tests/flexbuffers/test_array.cpp +++ b/tests/flexbuffers/test_array.cpp @@ -1,13 +1,16 @@ #include #include -#include #include // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.flexbuf; + namespace test_array { diff --git a/tests/flexbuffers/test_box.cpp b/tests/flexbuffers/test_box.cpp index fdfd89946..58220194d 100644 --- a/tests/flexbuffers/test_box.cpp +++ b/tests/flexbuffers/test_box.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.flexbuf; +import rfl; + namespace test_box { diff --git a/tests/flexbuffers/test_bytestring.cpp b/tests/flexbuffers/test_bytestring.cpp index abbf3d4e7..309f5321b 100644 --- a/tests/flexbuffers/test_bytestring.cpp +++ b/tests/flexbuffers/test_bytestring.cpp @@ -1,7 +1,11 @@ -#include #include #include "write_and_read.hpp" +#include + +import rfl.flexbuf; +import rfl; + namespace test_bytestring { diff --git a/tests/flexbuffers/test_combined_processors.cpp b/tests/flexbuffers/test_combined_processors.cpp index 1a0011bc6..c82af8f41 100644 --- a/tests/flexbuffers/test_combined_processors.cpp +++ b/tests/flexbuffers/test_combined_processors.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.flexbuf; namespace test_combined_processors { diff --git a/tests/flexbuffers/test_custom_class1.cpp b/tests/flexbuffers/test_custom_class1.cpp index bfc65a700..84fd67966 100644 --- a/tests/flexbuffers/test_custom_class1.cpp +++ b/tests/flexbuffers/test_custom_class1.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_custom_class1 { diff --git a/tests/flexbuffers/test_custom_class3.cpp b/tests/flexbuffers/test_custom_class3.cpp index 26a72132b..f9d9b0445 100644 --- a/tests/flexbuffers/test_custom_class3.cpp +++ b/tests/flexbuffers/test_custom_class3.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_custom_class3 { diff --git a/tests/flexbuffers/test_custom_class4.cpp b/tests/flexbuffers/test_custom_class4.cpp index 3d1495f64..155ec2a4f 100644 --- a/tests/flexbuffers/test_custom_class4.cpp +++ b/tests/flexbuffers/test_custom_class4.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_custom_class4 { diff --git a/tests/flexbuffers/test_default_values.cpp b/tests/flexbuffers/test_default_values.cpp index a8d6460ce..6f805c4ef 100644 --- a/tests/flexbuffers/test_default_values.cpp +++ b/tests/flexbuffers/test_default_values.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_default_values { diff --git a/tests/flexbuffers/test_deque.cpp b/tests/flexbuffers/test_deque.cpp index f361bd20c..ac1d93130 100644 --- a/tests/flexbuffers/test_deque.cpp +++ b/tests/flexbuffers/test_deque.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.flexbuf; +import rfl; + namespace test_deque { diff --git a/tests/flexbuffers/test_enum.cpp b/tests/flexbuffers/test_enum.cpp index 3f751a47c..184b484bf 100644 --- a/tests/flexbuffers/test_enum.cpp +++ b/tests/flexbuffers/test_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_enum { diff --git a/tests/flexbuffers/test_field_variant.cpp b/tests/flexbuffers/test_field_variant.cpp index 3c3106fd5..ca036d0f8 100644 --- a/tests/flexbuffers/test_field_variant.cpp +++ b/tests/flexbuffers/test_field_variant.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_field_variant { diff --git a/tests/flexbuffers/test_flag_enum.cpp b/tests/flexbuffers/test_flag_enum.cpp index 9792444b4..528a36de6 100644 --- a/tests/flexbuffers/test_flag_enum.cpp +++ b/tests/flexbuffers/test_flag_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_flag_enum { diff --git a/tests/flexbuffers/test_flag_enum_with_int.cpp b/tests/flexbuffers/test_flag_enum_with_int.cpp index 740c6135a..17379b3c7 100644 --- a/tests/flexbuffers/test_flag_enum_with_int.cpp +++ b/tests/flexbuffers/test_flag_enum_with_int.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/flexbuffers/test_flatten.cpp b/tests/flexbuffers/test_flatten.cpp index 259187dc7..f312da060 100644 --- a/tests/flexbuffers/test_flatten.cpp +++ b/tests/flexbuffers/test_flatten.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_flatten { diff --git a/tests/flexbuffers/test_flatten_anonymous.cpp b/tests/flexbuffers/test_flatten_anonymous.cpp index 6a7e5eab0..0a22a7523 100644 --- a/tests/flexbuffers/test_flatten_anonymous.cpp +++ b/tests/flexbuffers/test_flatten_anonymous.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/flexbuffers/test_forward_list.cpp b/tests/flexbuffers/test_forward_list.cpp index 79c1e01b3..f725d63dc 100644 --- a/tests/flexbuffers/test_forward_list.cpp +++ b/tests/flexbuffers/test_forward_list.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.flexbuf; +import rfl; + namespace test_forward_list { diff --git a/tests/flexbuffers/test_literal.cpp b/tests/flexbuffers/test_literal.cpp index 5cf835e5b..bcd219664 100644 --- a/tests/flexbuffers/test_literal.cpp +++ b/tests/flexbuffers/test_literal.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_literal { diff --git a/tests/flexbuffers/test_literal_map.cpp b/tests/flexbuffers/test_literal_map.cpp index 48fcbec47..75ba8bbcf 100644 --- a/tests/flexbuffers/test_literal_map.cpp +++ b/tests/flexbuffers/test_literal_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_literal_map { diff --git a/tests/flexbuffers/test_map.cpp b/tests/flexbuffers/test_map.cpp index 95e9a7a08..a78e9247e 100644 --- a/tests/flexbuffers/test_map.cpp +++ b/tests/flexbuffers/test_map.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl.flexbuf; +import rfl; + namespace test_map { diff --git a/tests/flexbuffers/test_map_with_key_validation.cpp b/tests/flexbuffers/test_map_with_key_validation.cpp index eccf04853..8f0ec1960 100644 --- a/tests/flexbuffers/test_map_with_key_validation.cpp +++ b/tests/flexbuffers/test_map_with_key_validation.cpp @@ -1,8 +1,13 @@ #include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl.flexbuf; +import rfl; + namespace test_map_with_key_validation { diff --git a/tests/flexbuffers/test_monster_example.cpp b/tests/flexbuffers/test_monster_example.cpp index 3c52c99f9..d878202b7 100644 --- a/tests/flexbuffers/test_monster_example.cpp +++ b/tests/flexbuffers/test_monster_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_monster_example { diff --git a/tests/flexbuffers/test_readme_example.cpp b/tests/flexbuffers/test_readme_example.cpp index 037300eac..5d71089c5 100644 --- a/tests/flexbuffers/test_readme_example.cpp +++ b/tests/flexbuffers/test_readme_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_readme_example { diff --git a/tests/flexbuffers/test_readme_example2.cpp b/tests/flexbuffers/test_readme_example2.cpp index d8f37efcf..1f7c780ee 100644 --- a/tests/flexbuffers/test_readme_example2.cpp +++ b/tests/flexbuffers/test_readme_example2.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_readme_example2 { diff --git a/tests/flexbuffers/test_ref.cpp b/tests/flexbuffers/test_ref.cpp index c02ccf905..a2525c40d 100644 --- a/tests/flexbuffers/test_ref.cpp +++ b/tests/flexbuffers/test_ref.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.flexbuf; +import rfl; + namespace test_ref { diff --git a/tests/flexbuffers/test_save_load.cpp b/tests/flexbuffers/test_save_load.cpp index 0754c7d42..860870e5b 100644 --- a/tests/flexbuffers/test_save_load.cpp +++ b/tests/flexbuffers/test_save_load.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include +import rfl; +import rfl.flexbuf; + namespace test_save_load { diff --git a/tests/flexbuffers/test_set.cpp b/tests/flexbuffers/test_set.cpp index 98bd5f843..3ce75fc92 100644 --- a/tests/flexbuffers/test_set.cpp +++ b/tests/flexbuffers/test_set.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.flexbuf; +import rfl; + namespace test_set { diff --git a/tests/flexbuffers/test_size.cpp b/tests/flexbuffers/test_size.cpp index 082fecaa2..b55b9ece7 100644 --- a/tests/flexbuffers/test_size.cpp +++ b/tests/flexbuffers/test_size.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_size { diff --git a/tests/flexbuffers/test_snake_case_to_camel_case.cpp b/tests/flexbuffers/test_snake_case_to_camel_case.cpp index 35c85ab68..9de25c69b 100644 --- a/tests/flexbuffers/test_snake_case_to_camel_case.cpp +++ b/tests/flexbuffers/test_snake_case_to_camel_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.flexbuf; namespace test_snake_case_to_camel_case { diff --git a/tests/flexbuffers/test_snake_case_to_pascal_case.cpp b/tests/flexbuffers/test_snake_case_to_pascal_case.cpp index b53414b11..cf8bbe7c9 100644 --- a/tests/flexbuffers/test_snake_case_to_pascal_case.cpp +++ b/tests/flexbuffers/test_snake_case_to_pascal_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.flexbuf; namespace test_snake_case_to_pascal_case { diff --git a/tests/flexbuffers/test_string_map.cpp b/tests/flexbuffers/test_string_map.cpp index 384e37bf0..e3b299d48 100644 --- a/tests/flexbuffers/test_string_map.cpp +++ b/tests/flexbuffers/test_string_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_string_map { TEST(flexbuf, test_string_map) { diff --git a/tests/flexbuffers/test_tagged_union.cpp b/tests/flexbuffers/test_tagged_union.cpp index bb7173003..fc15135f8 100644 --- a/tests/flexbuffers/test_tagged_union.cpp +++ b/tests/flexbuffers/test_tagged_union.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_tagged_union { diff --git a/tests/flexbuffers/test_tagged_union2.cpp b/tests/flexbuffers/test_tagged_union2.cpp index 050b4f4f6..6e91840e5 100644 --- a/tests/flexbuffers/test_tagged_union2.cpp +++ b/tests/flexbuffers/test_tagged_union2.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_tagged_union2 { diff --git a/tests/flexbuffers/test_timestamp.cpp b/tests/flexbuffers/test_timestamp.cpp index 1317b58b6..27c437df0 100644 --- a/tests/flexbuffers/test_timestamp.cpp +++ b/tests/flexbuffers/test_timestamp.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + namespace test_timestamp { diff --git a/tests/flexbuffers/test_unique_ptr.cpp b/tests/flexbuffers/test_unique_ptr.cpp index 979b6cd58..e86abe185 100644 --- a/tests/flexbuffers/test_unique_ptr.cpp +++ b/tests/flexbuffers/test_unique_ptr.cpp @@ -1,9 +1,13 @@ #include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.flexbuf; +import rfl; + namespace test_unique_ptr { diff --git a/tests/flexbuffers/test_unique_ptr2.cpp b/tests/flexbuffers/test_unique_ptr2.cpp index a0a03f98c..298d5870a 100644 --- a/tests/flexbuffers/test_unique_ptr2.cpp +++ b/tests/flexbuffers/test_unique_ptr2.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.flexbuf; +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/flexbuffers/test_variant.cpp b/tests/flexbuffers/test_variant.cpp index 933fcbedd..842cf2ad4 100644 --- a/tests/flexbuffers/test_variant.cpp +++ b/tests/flexbuffers/test_variant.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.flexbuf; +import rfl; + namespace test_variant { diff --git a/tests/flexbuffers/test_wstring.cpp b/tests/flexbuffers/test_wstring.cpp index b0ab7f1f4..e863cf908 100644 --- a/tests/flexbuffers/test_wstring.cpp +++ b/tests/flexbuffers/test_wstring.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.flexbuf; +import rfl; + struct TestStruct { std::string theNormalString; diff --git a/tests/flexbuffers/write_and_read.hpp b/tests/flexbuffers/write_and_read.hpp index 0eeef2d61..8d7d1e6e2 100644 --- a/tests/flexbuffers/write_and_read.hpp +++ b/tests/flexbuffers/write_and_read.hpp @@ -2,8 +2,11 @@ #define WRITE_AND_READ_ #include +#include + +import rfl.flexbuf; + -#include template void write_and_read(const auto& _struct) { diff --git a/tests/generic/compile_fail/flatten_cross_type_move_assign.cpp b/tests/generic/compile_fail/flatten_cross_type_move_assign.cpp index 07288bf4c..4e6b0ecf3 100644 --- a/tests/generic/compile_fail/flatten_cross_type_move_assign.cpp +++ b/tests/generic/compile_fail/flatten_cross_type_move_assign.cpp @@ -1,3 +1,8 @@ +#include + +import rfl; + + // Flatten::operator=(Flatten&&) uses std::forward(_f) which passes // Flatten instead of U — fails to compile for cross-type assignment. // File: include/rfl/Flatten.hpp:103-105 @@ -6,7 +11,6 @@ // This file instantiates the buggy operator. It should FAIL to compile // while the bug exists, and succeed after the fix. -#include struct Base { int x = 0; diff --git a/tests/generic/test_array.cpp b/tests/generic/test_array.cpp index e1ddba698..9e7d98e96 100644 --- a/tests/generic/test_array.cpp +++ b/tests/generic/test_array.cpp @@ -1,9 +1,12 @@ #include #include -#include #include #include "write_and_read.hpp" +#include + +import rfl; + namespace test_array { diff --git a/tests/generic/test_bad_access_error.cpp b/tests/generic/test_bad_access_error.cpp index 5422512dc..357657b95 100644 --- a/tests/generic/test_bad_access_error.cpp +++ b/tests/generic/test_bad_access_error.cpp @@ -2,8 +2,12 @@ #include #endif -#include #include +#include + +import rfl; + + namespace test_exceptions { diff --git a/tests/generic/test_box.cpp b/tests/generic/test_box.cpp index e91fae931..850f27384 100644 --- a/tests/generic/test_box.cpp +++ b/tests/generic/test_box.cpp @@ -1,7 +1,10 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl; + namespace test_box { diff --git a/tests/generic/test_byte_containers.cpp b/tests/generic/test_byte_containers.cpp index e39eacf0b..7d666eb6d 100644 --- a/tests/generic/test_byte_containers.cpp +++ b/tests/generic/test_byte_containers.cpp @@ -1,10 +1,16 @@ #include #include -#include #include #include #include "write_and_read.hpp" +#include +#include +#include +#include + +import rfl; + namespace test_byte_container_concepts { diff --git a/tests/generic/test_custom_class1.cpp b/tests/generic/test_custom_class1.cpp index 3fed8cd92..15f191102 100644 --- a/tests/generic/test_custom_class1.cpp +++ b/tests/generic/test_custom_class1.cpp @@ -1,9 +1,10 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl; + namespace test_custom_class1 { diff --git a/tests/generic/test_custom_class3.cpp b/tests/generic/test_custom_class3.cpp index b89b2f2bb..2ea97b421 100644 --- a/tests/generic/test_custom_class3.cpp +++ b/tests/generic/test_custom_class3.cpp @@ -1,8 +1,9 @@ #include -#include #include #include "write_and_read.hpp" +import rfl; + namespace test_custom_class3 { diff --git a/tests/generic/test_custom_class4.cpp b/tests/generic/test_custom_class4.cpp index 093de954e..2ef62dbfb 100644 --- a/tests/generic/test_custom_class4.cpp +++ b/tests/generic/test_custom_class4.cpp @@ -1,8 +1,9 @@ #include -#include #include #include "write_and_read.hpp" +import rfl; + namespace test_custom_class4 { diff --git a/tests/generic/test_default_values.cpp b/tests/generic/test_default_values.cpp index e378102a3..b8410c633 100644 --- a/tests/generic/test_default_values.cpp +++ b/tests/generic/test_default_values.cpp @@ -1,9 +1,10 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl; + namespace test_default_values { diff --git a/tests/generic/test_deque.cpp b/tests/generic/test_deque.cpp index 568e20d7f..fa8a5ae8f 100644 --- a/tests/generic/test_deque.cpp +++ b/tests/generic/test_deque.cpp @@ -1,7 +1,12 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl; + namespace test_deque { diff --git a/tests/generic/test_enum.cpp b/tests/generic/test_enum.cpp index cec7f9650..e1b82f185 100644 --- a/tests/generic/test_enum.cpp +++ b/tests/generic/test_enum.cpp @@ -1,7 +1,8 @@ #include -#include #include "write_and_read.hpp" +import rfl; + namespace test_enum { diff --git a/tests/generic/test_enum_range.cpp b/tests/generic/test_enum_range.cpp index 4b54a671c..fef9671e1 100644 --- a/tests/generic/test_enum_range.cpp +++ b/tests/generic/test_enum_range.cpp @@ -1,10 +1,9 @@ #include -// Redefine the range of the enums -#define RFL_ENUM_RANGE_MIN -128 -#define RFL_ENUM_RANGE_MAX 128 -#include #include "write_and_read.hpp" +import rfl; + + namespace test_enum_range { @@ -36,4 +35,4 @@ TEST(generic, test_enum_range) { write_and_read(circle); } -} // namespace test_enum_range \ No newline at end of file +} // namespace test_enum_range diff --git a/tests/generic/test_enum_range_min_max.cpp b/tests/generic/test_enum_range_min_max.cpp index 732a71716..fa2f99653 100644 --- a/tests/generic/test_enum_range_min_max.cpp +++ b/tests/generic/test_enum_range_min_max.cpp @@ -1,8 +1,6 @@ #include -// Redefine the range of the enums -#define RFL_ENUM_RANGE_MIN -128 -#define RFL_ENUM_RANGE_MAX 128 -#include + +import rfl; namespace test_enum_range_min_max { @@ -27,8 +25,8 @@ TEST(generic, test_enum_range_min_max) { "Range should be defined."); auto [inner_min, inner_max] = rfl::get_enum_range(); - EXPECT_EQ(inner_min, RFL_ENUM_RANGE_MIN); - EXPECT_EQ(inner_max, RFL_ENUM_RANGE_MAX); + EXPECT_EQ(inner_min, REFLECTCPP_TEST_ENUM_RANGE_MIN); + EXPECT_EQ(inner_max, REFLECTCPP_TEST_ENUM_RANGE_MAX); auto [line_min, line_max] = rfl::get_enum_range(); EXPECT_EQ(line_min, 190); diff --git a/tests/generic/test_enum_range_size.cpp b/tests/generic/test_enum_range_size.cpp index 46652097f..69d55a558 100644 --- a/tests/generic/test_enum_range_size.cpp +++ b/tests/generic/test_enum_range_size.cpp @@ -1,8 +1,5 @@ #include -// Redefine the range of the enums -#define RFL_ENUM_RANGE_MIN -128 -#define RFL_ENUM_RANGE_MAX 128 -#include +import rfl; namespace test_enum_range_size { diff --git a/tests/generic/test_field.cpp b/tests/generic/test_field.cpp index 31a989973..7531da485 100644 --- a/tests/generic/test_field.cpp +++ b/tests/generic/test_field.cpp @@ -1,8 +1,11 @@ #include -#include #include "test_helpers.hpp" +#include + +import rfl; + namespace test_field_cross_move { diff --git a/tests/generic/test_field_variant.cpp b/tests/generic/test_field_variant.cpp index 452a79df9..bfcff7187 100644 --- a/tests/generic/test_field_variant.cpp +++ b/tests/generic/test_field_variant.cpp @@ -1,7 +1,8 @@ #include -#include #include "write_and_read.hpp" +import rfl; + namespace test_field_variant { diff --git a/tests/generic/test_flag_enum.cpp b/tests/generic/test_flag_enum.cpp index 5285a4bf2..a3b6a4001 100644 --- a/tests/generic/test_flag_enum.cpp +++ b/tests/generic/test_flag_enum.cpp @@ -1,7 +1,8 @@ #include -#include #include "write_and_read.hpp" +import rfl; + namespace test_flag_enum { diff --git a/tests/generic/test_flag_enum_with_int.cpp b/tests/generic/test_flag_enum_with_int.cpp index 717a7c0a9..5a8b0cefb 100644 --- a/tests/generic/test_flag_enum_with_int.cpp +++ b/tests/generic/test_flag_enum_with_int.cpp @@ -1,7 +1,8 @@ #include -#include #include "write_and_read.hpp" +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/generic/test_flatten.cpp b/tests/generic/test_flatten.cpp index 14d340e6f..52e5fe5e5 100644 --- a/tests/generic/test_flatten.cpp +++ b/tests/generic/test_flatten.cpp @@ -1,10 +1,13 @@ #include -#include #include #include "test_helpers.hpp" #include "write_and_read.hpp" +#include + +import rfl; + namespace test_flatten { diff --git a/tests/generic/test_flatten_anonymous.cpp b/tests/generic/test_flatten_anonymous.cpp index 757af931f..fd2d3f1af 100644 --- a/tests/generic/test_flatten_anonymous.cpp +++ b/tests/generic/test_flatten_anonymous.cpp @@ -1,8 +1,9 @@ #include -#include #include #include "write_and_read.hpp" +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/generic/test_forward_list.cpp b/tests/generic/test_forward_list.cpp index e8096ca31..83f262d54 100644 --- a/tests/generic/test_forward_list.cpp +++ b/tests/generic/test_forward_list.cpp @@ -1,7 +1,12 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl; + namespace test_forward_list { diff --git a/tests/generic/test_generic.cpp b/tests/generic/test_generic.cpp index ff97bf215..b2a3d025f 100644 --- a/tests/generic/test_generic.cpp +++ b/tests/generic/test_generic.cpp @@ -2,8 +2,9 @@ #include #include +import rfl; + -#include namespace test_generic_to_int_truncation { diff --git a/tests/generic/test_literal.cpp b/tests/generic/test_literal.cpp index 9c702a41f..28383c639 100644 --- a/tests/generic/test_literal.cpp +++ b/tests/generic/test_literal.cpp @@ -1,8 +1,9 @@ #include -#include #include #include "write_and_read.hpp" +import rfl; + namespace test_literal { diff --git a/tests/generic/test_literal_map.cpp b/tests/generic/test_literal_map.cpp index 391bcde9b..87c5b9f3c 100644 --- a/tests/generic/test_literal_map.cpp +++ b/tests/generic/test_literal_map.cpp @@ -1,9 +1,10 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl; + namespace test_literal_map { diff --git a/tests/generic/test_map.cpp b/tests/generic/test_map.cpp index ed334d466..f0753f4de 100644 --- a/tests/generic/test_map.cpp +++ b/tests/generic/test_map.cpp @@ -1,8 +1,11 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl; + namespace test_map { diff --git a/tests/generic/test_map_with_key_validation.cpp b/tests/generic/test_map_with_key_validation.cpp index ec81884fe..2ee2b96ea 100644 --- a/tests/generic/test_map_with_key_validation.cpp +++ b/tests/generic/test_map_with_key_validation.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl; + namespace test_map_with_key_validation { diff --git a/tests/generic/test_monster_example.cpp b/tests/generic/test_monster_example.cpp index afcfd9acd..406c7206d 100644 --- a/tests/generic/test_monster_example.cpp +++ b/tests/generic/test_monster_example.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl; + namespace test_monster_example { diff --git a/tests/generic/test_object.cpp b/tests/generic/test_object.cpp index 3ce084e63..83eb7118f 100644 --- a/tests/generic/test_object.cpp +++ b/tests/generic/test_object.cpp @@ -1,8 +1,9 @@ #include #include +import rfl; + -#include namespace test_object_difference_type_signed { diff --git a/tests/generic/test_optional.cpp b/tests/generic/test_optional.cpp index 838adbd9d..51fc88c53 100644 --- a/tests/generic/test_optional.cpp +++ b/tests/generic/test_optional.cpp @@ -1,6 +1,9 @@ -#include #include #include +#include + +import rfl; + namespace test_optional { diff --git a/tests/generic/test_readme_example.cpp b/tests/generic/test_readme_example.cpp index 0a9ffafd1..0441060d5 100644 --- a/tests/generic/test_readme_example.cpp +++ b/tests/generic/test_readme_example.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl; + namespace test_readme_example { diff --git a/tests/generic/test_readme_example2.cpp b/tests/generic/test_readme_example2.cpp index 4808ad17c..cda2ad908 100644 --- a/tests/generic/test_readme_example2.cpp +++ b/tests/generic/test_readme_example2.cpp @@ -1,7 +1,8 @@ -#include #include #include "write_and_read.hpp" +import rfl; + namespace test_readme_example2 { diff --git a/tests/generic/test_ref.cpp b/tests/generic/test_ref.cpp index 8acf24411..7f5889e1f 100644 --- a/tests/generic/test_ref.cpp +++ b/tests/generic/test_ref.cpp @@ -1,7 +1,10 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl; + namespace test_ref { diff --git a/tests/generic/test_result.cpp b/tests/generic/test_result.cpp index f05a9d3e4..dbe814443 100644 --- a/tests/generic/test_result.cpp +++ b/tests/generic/test_result.cpp @@ -2,8 +2,9 @@ #include #include +import rfl; + -#include namespace test_result_cross_assign { diff --git a/tests/generic/test_set.cpp b/tests/generic/test_set.cpp index 985d7fc57..3a048fa2f 100644 --- a/tests/generic/test_set.cpp +++ b/tests/generic/test_set.cpp @@ -1,7 +1,12 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl; + namespace test_set { diff --git a/tests/generic/test_size.cpp b/tests/generic/test_size.cpp index daf75dbbc..479dd9977 100644 --- a/tests/generic/test_size.cpp +++ b/tests/generic/test_size.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl; + namespace test_size { diff --git a/tests/generic/test_skip.cpp b/tests/generic/test_skip.cpp index 9c9fcec57..96c53d960 100644 --- a/tests/generic/test_skip.cpp +++ b/tests/generic/test_skip.cpp @@ -1,8 +1,11 @@ #include -#include #include "test_helpers.hpp" +#include + +import rfl; + namespace test_skip_cross_move { diff --git a/tests/generic/test_string_map.cpp b/tests/generic/test_string_map.cpp index 688453c5b..be5f1b2a0 100644 --- a/tests/generic/test_string_map.cpp +++ b/tests/generic/test_string_map.cpp @@ -1,9 +1,10 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl; + namespace test_string_map { TEST(generic, test_string_map) { diff --git a/tests/generic/test_tagged_union.cpp b/tests/generic/test_tagged_union.cpp index 50ae24425..cb19c16b0 100644 --- a/tests/generic/test_tagged_union.cpp +++ b/tests/generic/test_tagged_union.cpp @@ -1,8 +1,11 @@ #include #include -#include #include "write_and_read.hpp" +#include + +import rfl; + namespace test_tagged_union { diff --git a/tests/generic/test_timestamp.cpp b/tests/generic/test_timestamp.cpp index d658b30b2..31e9726fb 100644 --- a/tests/generic/test_timestamp.cpp +++ b/tests/generic/test_timestamp.cpp @@ -1,8 +1,9 @@ #include -#include #include #include "write_and_read.hpp" +import rfl; + namespace test_timestamp { diff --git a/tests/generic/test_tuple.cpp b/tests/generic/test_tuple.cpp index 0c521bf74..237233b3a 100644 --- a/tests/generic/test_tuple.cpp +++ b/tests/generic/test_tuple.cpp @@ -3,8 +3,9 @@ #include #include #include +import rfl; + -#include namespace test_tuple_spaceship { @@ -108,4 +109,4 @@ TEST(Tuple, equality_multi) { EXPECT_FALSE(a == c); } -} // namespace test_tuple_spaceship \ No newline at end of file +} // namespace test_tuple_spaceship diff --git a/tests/generic/test_unique_ptr.cpp b/tests/generic/test_unique_ptr.cpp index 2b32e7a19..942ab0e21 100644 --- a/tests/generic/test_unique_ptr.cpp +++ b/tests/generic/test_unique_ptr.cpp @@ -1,9 +1,12 @@ #include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; + namespace test_unique_ptr { diff --git a/tests/generic/test_unique_ptr2.cpp b/tests/generic/test_unique_ptr2.cpp index ee51e202e..f648df465 100644 --- a/tests/generic/test_unique_ptr2.cpp +++ b/tests/generic/test_unique_ptr2.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/generic/test_variant.cpp b/tests/generic/test_variant.cpp index 5bbf6abf6..db6f8f22c 100644 --- a/tests/generic/test_variant.cpp +++ b/tests/generic/test_variant.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl; + namespace test_variant { diff --git a/tests/generic/test_wstring.cpp b/tests/generic/test_wstring.cpp index 275c3d5a7..6f5d73836 100644 --- a/tests/generic/test_wstring.cpp +++ b/tests/generic/test_wstring.cpp @@ -1,8 +1,9 @@ #include -#include #include #include "write_and_read.hpp" +import rfl; + struct TestStruct { std::string theNormalString; diff --git a/tests/generic/write_and_read.hpp b/tests/generic/write_and_read.hpp index abf3aabd3..dd91eaf47 100644 --- a/tests/generic/write_and_read.hpp +++ b/tests/generic/write_and_read.hpp @@ -2,8 +2,11 @@ #define WRITE_AND_READ_ #include +#include + +import rfl.json; + -#include template void write_and_read(const auto& _struct) { diff --git a/tests/json/CMakeLists.txt b/tests/json/CMakeLists.txt index 1d11e263b..584ee9c2a 100644 --- a/tests/json/CMakeLists.txt +++ b/tests/json/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-json-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-json-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-json-tests PRIVATE ) target_include_directories(reflect-cpp-json-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") diff --git a/tests/json/test_add_namespaced_tags_to_rfl_variants.cpp b/tests/json/test_add_namespaced_tags_to_rfl_variants.cpp index ad6dc2c9f..e9c35416c 100644 --- a/tests/json/test_add_namespaced_tags_to_rfl_variants.cpp +++ b/tests/json/test_add_namespaced_tags_to_rfl_variants.cpp @@ -1,10 +1,13 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + // NOTE TO MAINTAINERS: // These tests are very similar to the others in test_add_*tags_to_*variants.cpp, so please keep them diff --git a/tests/json/test_add_namespaced_tags_to_variants.cpp b/tests/json/test_add_namespaced_tags_to_variants.cpp index 338d07122..c164b34e0 100644 --- a/tests/json/test_add_namespaced_tags_to_variants.cpp +++ b/tests/json/test_add_namespaced_tags_to_variants.cpp @@ -1,11 +1,12 @@ #include -#include -#include #include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + // NOTE TO MAINTAINERS: // These tests are very similar to the others in test_add_*tags_to_*variants.cpp, so please keep them diff --git a/tests/json/test_add_struct_name.cpp b/tests/json/test_add_struct_name.cpp index d05b86f02..0f314e63f 100644 --- a/tests/json/test_add_struct_name.cpp +++ b/tests/json/test_add_struct_name.cpp @@ -1,9 +1,10 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_add_struct_name { diff --git a/tests/json/test_add_tags_to_rfl_variants.cpp b/tests/json/test_add_tags_to_rfl_variants.cpp index 5afbc4c10..1ee67a34b 100644 --- a/tests/json/test_add_tags_to_rfl_variants.cpp +++ b/tests/json/test_add_tags_to_rfl_variants.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + // NOTE TO MAINTAINERS: // These tests are very similar to the others in test_add_*tags_to_*variants.cpp, so please keep them diff --git a/tests/json/test_add_tags_to_variants.cpp b/tests/json/test_add_tags_to_variants.cpp index af7595bc4..59e3e6540 100644 --- a/tests/json/test_add_tags_to_variants.cpp +++ b/tests/json/test_add_tags_to_variants.cpp @@ -1,11 +1,12 @@ #include -#include -#include #include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + // NOTE TO MAINTAINERS: // These tests are very similar to the others in test_add_*tags_to_*variants.cpp, so please keep them diff --git a/tests/json/test_all_of.cpp b/tests/json/test_all_of.cpp index 512ec446c..ec9e00f7d 100644 --- a/tests/json/test_all_of.cpp +++ b/tests/json/test_all_of.cpp @@ -1,11 +1,12 @@ -#include #include // Make sure things still compile when // rfl.hpp is included after rfl/json.hpp. -#include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_all_of { diff --git a/tests/json/test_alphanumeric_map.cpp b/tests/json/test_alphanumeric_map.cpp index d7b1d5d7e..c32f0c5a3 100644 --- a/tests/json/test_alphanumeric_map.cpp +++ b/tests/json/test_alphanumeric_map.cpp @@ -1,10 +1,11 @@ #include #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_alphanumeric_map { diff --git a/tests/json/test_alphanumeric_unordered_map.cpp b/tests/json/test_alphanumeric_unordered_map.cpp index 32516aa52..c02707254 100644 --- a/tests/json/test_alphanumeric_unordered_map.cpp +++ b/tests/json/test_alphanumeric_unordered_map.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_alphanumeric_unordered_map { TEST(json, test_alphanumeric_unordered_map) { diff --git a/tests/json/test_and_then.cpp b/tests/json/test_and_then.cpp index 46f48194f..e1d9ae546 100644 --- a/tests/json/test_and_then.cpp +++ b/tests/json/test_and_then.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_and_then { diff --git a/tests/json/test_anonymous_fields.cpp b/tests/json/test_anonymous_fields.cpp index ca8c5133b..59c493f9b 100644 --- a/tests/json/test_anonymous_fields.cpp +++ b/tests/json/test_anonymous_fields.cpp @@ -1,9 +1,10 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_anonymous_fields { diff --git a/tests/json/test_any_of.cpp b/tests/json/test_any_of.cpp index 4e3d9963b..4e3a83cfc 100644 --- a/tests/json/test_any_of.cpp +++ b/tests/json/test_any_of.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_any_of { diff --git a/tests/json/test_apply.cpp b/tests/json/test_apply.cpp index 8ae1b2c55..2faaea605 100644 --- a/tests/json/test_apply.cpp +++ b/tests/json/test_apply.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_apply { diff --git a/tests/json/test_apply_on_named_tuple.cpp b/tests/json/test_apply_on_named_tuple.cpp index d9e02f1b5..3dd3425de 100644 --- a/tests/json/test_apply_on_named_tuple.cpp +++ b/tests/json/test_apply_on_named_tuple.cpp @@ -1,10 +1,11 @@ #include #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_apply_on_named_tuple { diff --git a/tests/json/test_array.cpp b/tests/json/test_array.cpp index 688382385..f5c627e4f 100644 --- a/tests/json/test_array.cpp +++ b/tests/json/test_array.cpp @@ -1,11 +1,14 @@ #include #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_array { diff --git a/tests/json/test_array2.cpp b/tests/json/test_array2.cpp index 4913fb963..59feec502 100644 --- a/tests/json/test_array2.cpp +++ b/tests/json/test_array2.cpp @@ -1,9 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl; + namespace test_array2 { diff --git a/tests/json/test_as.cpp b/tests/json/test_as.cpp index c404ed1ab..f08d5662e 100644 --- a/tests/json/test_as.cpp +++ b/tests/json/test_as.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_as { diff --git a/tests/json/test_as2.cpp b/tests/json/test_as2.cpp index a5f4ad19b..e86da4ccc 100644 --- a/tests/json/test_as2.cpp +++ b/tests/json/test_as2.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_as2 { diff --git a/tests/json/test_as_flatten.cpp b/tests/json/test_as_flatten.cpp index 13b3050f2..54b4ba0b0 100644 --- a/tests/json/test_as_flatten.cpp +++ b/tests/json/test_as_flatten.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_as_flatten { diff --git a/tests/json/test_atomic.cpp b/tests/json/test_atomic.cpp index 0ff15d825..5e28e26b8 100644 --- a/tests/json/test_atomic.cpp +++ b/tests/json/test_atomic.cpp @@ -1,10 +1,14 @@ #include #include -#include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.json; + namespace test_atomic { diff --git a/tests/json/test_atomic_array.cpp b/tests/json/test_atomic_array.cpp index eb9678f21..677d72a2f 100644 --- a/tests/json/test_atomic_array.cpp +++ b/tests/json/test_atomic_array.cpp @@ -1,9 +1,13 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.json; + namespace test_atomic_array { diff --git a/tests/json/test_atomic_box.cpp b/tests/json/test_atomic_box.cpp index 41dbb6046..ea8c7b6c9 100644 --- a/tests/json/test_atomic_box.cpp +++ b/tests/json/test_atomic_box.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_atomic_box { diff --git a/tests/json/test_atomic_negative.cpp b/tests/json/test_atomic_negative.cpp index cb0e3ec3a..d0996ed67 100644 --- a/tests/json/test_atomic_negative.cpp +++ b/tests/json/test_atomic_negative.cpp @@ -2,8 +2,9 @@ #include #include -#include -#include +import rfl; +import rfl.json; + namespace test_atomic_negative { diff --git a/tests/json/test_atomic_ref.cpp b/tests/json/test_atomic_ref.cpp index f07fb6d02..d83312636 100644 --- a/tests/json/test_atomic_ref.cpp +++ b/tests/json/test_atomic_ref.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_atomic_ref { diff --git a/tests/json/test_atomic_shared_ptr.cpp b/tests/json/test_atomic_shared_ptr.cpp index f2ac2a687..ce29ef228 100644 --- a/tests/json/test_atomic_shared_ptr.cpp +++ b/tests/json/test_atomic_shared_ptr.cpp @@ -1,9 +1,13 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.json; + namespace test_atomic_shared_ptr { diff --git a/tests/json/test_atomic_unique_ptr.cpp b/tests/json/test_atomic_unique_ptr.cpp index 1560625c2..50b77a974 100644 --- a/tests/json/test_atomic_unique_ptr.cpp +++ b/tests/json/test_atomic_unique_ptr.cpp @@ -1,9 +1,13 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.json; + namespace test_atomic_unique_ptr { diff --git a/tests/json/test_binary.cpp b/tests/json/test_binary.cpp index c6dc4a3e7..b7ec7f888 100644 --- a/tests/json/test_binary.cpp +++ b/tests/json/test_binary.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_binary { diff --git a/tests/json/test_box.cpp b/tests/json/test_box.cpp index dd9bd6d53..d9199c2e8 100644 --- a/tests/json/test_box.cpp +++ b/tests/json/test_box.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_box { diff --git a/tests/json/test_box2.cpp b/tests/json/test_box2.cpp index b0f25a731..9fd793b6b 100644 --- a/tests/json/test_box2.cpp +++ b/tests/json/test_box2.cpp @@ -1,9 +1,13 @@ #include #include -#include -#include #include +#include +#include + +import rfl; +import rfl.json; + namespace test_box2 { diff --git a/tests/json/test_camel_case_to_snake_case_rename.cpp b/tests/json/test_camel_case_to_snake_case_rename.cpp index b9ff0f246..f8198d31d 100644 --- a/tests/json/test_camel_case_to_snake_case_rename.cpp +++ b/tests/json/test_camel_case_to_snake_case_rename.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_camel_case_to_snake_case_rename { diff --git a/tests/json/test_chrono_duration.cpp b/tests/json/test_chrono_duration.cpp index c78a11c7f..0dc757f62 100644 --- a/tests/json/test_chrono_duration.cpp +++ b/tests/json/test_chrono_duration.cpp @@ -1,10 +1,11 @@ #include #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_chrono_duration { diff --git a/tests/json/test_combined_processors.cpp b/tests/json/test_combined_processors.cpp index ef69df412..9e1dd28f0 100644 --- a/tests/json/test_combined_processors.cpp +++ b/tests/json/test_combined_processors.cpp @@ -1,9 +1,10 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_combined_processors { diff --git a/tests/json/test_const_fields.cpp b/tests/json/test_const_fields.cpp index d98980694..e1b9e5bd0 100644 --- a/tests/json/test_const_fields.cpp +++ b/tests/json/test_const_fields.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_const_fields { diff --git a/tests/json/test_custom_class1.cpp b/tests/json/test_custom_class1.cpp index 6df483164..8b6dcc8a8 100644 --- a/tests/json/test_custom_class1.cpp +++ b/tests/json/test_custom_class1.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_custom_class1 { diff --git a/tests/json/test_custom_class2.cpp b/tests/json/test_custom_class2.cpp index ee7a07459..d1e6b012f 100644 --- a/tests/json/test_custom_class2.cpp +++ b/tests/json/test_custom_class2.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_custom_class2 { diff --git a/tests/json/test_custom_class3.cpp b/tests/json/test_custom_class3.cpp index 141997276..a4a8fa318 100644 --- a/tests/json/test_custom_class3.cpp +++ b/tests/json/test_custom_class3.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_custom_class3 { diff --git a/tests/json/test_custom_class4.cpp b/tests/json/test_custom_class4.cpp index 18d8244cb..7fe7dcbd3 100644 --- a/tests/json/test_custom_class4.cpp +++ b/tests/json/test_custom_class4.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_custom_class4 { diff --git a/tests/json/test_custom_constructor.cpp b/tests/json/test_custom_constructor.cpp index 490f40d9f..467a69dd1 100644 --- a/tests/json/test_custom_constructor.cpp +++ b/tests/json/test_custom_constructor.cpp @@ -1,8 +1,11 @@ -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_custom_constructor { diff --git a/tests/json/test_custom_enum1.cpp b/tests/json/test_custom_enum1.cpp index 7c4509d50..d3f69fe65 100644 --- a/tests/json/test_custom_enum1.cpp +++ b/tests/json/test_custom_enum1.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_custom_enum1 { diff --git a/tests/json/test_deep_nested.cpp b/tests/json/test_deep_nested.cpp index b455e9cd6..cb3b3c84d 100644 --- a/tests/json/test_deep_nested.cpp +++ b/tests/json/test_deep_nested.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_deep_nested { diff --git a/tests/json/test_default_if_missing.cpp b/tests/json/test_default_if_missing.cpp index 238cb2fe8..9287dac01 100644 --- a/tests/json/test_default_if_missing.cpp +++ b/tests/json/test_default_if_missing.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_default_if_missing { diff --git a/tests/json/test_default_if_missing_no_field_names.cpp b/tests/json/test_default_if_missing_no_field_names.cpp index 11db4f559..9bb274930 100644 --- a/tests/json/test_default_if_missing_no_field_names.cpp +++ b/tests/json/test_default_if_missing_no_field_names.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_default_if_missing_no_field_names { diff --git a/tests/json/test_default_val.cpp b/tests/json/test_default_val.cpp index 9ef09671a..e2c893521 100644 --- a/tests/json/test_default_val.cpp +++ b/tests/json/test_default_val.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_default_val { diff --git a/tests/json/test_default_val_no_field_names.cpp b/tests/json/test_default_val_no_field_names.cpp index 1aac232bc..6997611d7 100644 --- a/tests/json/test_default_val_no_field_names.cpp +++ b/tests/json/test_default_val_no_field_names.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_default_val_no_field_names { diff --git a/tests/json/test_default_values.cpp b/tests/json/test_default_values.cpp index 0b0fcc3f9..126b9846f 100644 --- a/tests/json/test_default_values.cpp +++ b/tests/json/test_default_values.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_default_values { diff --git a/tests/json/test_deque.cpp b/tests/json/test_deque.cpp index 39e012cef..1bff0c16e 100644 --- a/tests/json/test_deque.cpp +++ b/tests/json/test_deque.cpp @@ -1,8 +1,13 @@ -#include -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl; +import rfl.json; + namespace test_deque { diff --git a/tests/json/test_duration.cpp b/tests/json/test_duration.cpp index 2f5ead2c5..3266aa94e 100644 --- a/tests/json/test_duration.cpp +++ b/tests/json/test_duration.cpp @@ -1,8 +1,9 @@ #include -#include -#include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_duration { diff --git a/tests/json/test_duration_conversion.cpp b/tests/json/test_duration_conversion.cpp index ba110df8c..9bdcc5b4c 100644 --- a/tests/json/test_duration_conversion.cpp +++ b/tests/json/test_duration_conversion.cpp @@ -1,8 +1,9 @@ #include -#include -#include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_duration_conversion { diff --git a/tests/json/test_duration_default.cpp b/tests/json/test_duration_default.cpp index a7fe15ea2..2c12635fa 100644 --- a/tests/json/test_duration_default.cpp +++ b/tests/json/test_duration_default.cpp @@ -1,9 +1,9 @@ #include -#include -#include -#include "rfl/DefaultIfMissing.hpp" #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_duration_default { diff --git a/tests/json/test_email.cpp b/tests/json/test_email.cpp index 590970cd0..e52edf25b 100644 --- a/tests/json/test_email.cpp +++ b/tests/json/test_email.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_email { diff --git a/tests/json/test_empty_object.cpp b/tests/json/test_empty_object.cpp index 6c722bb71..e10629adb 100644 --- a/tests/json/test_empty_object.cpp +++ b/tests/json/test_empty_object.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_empty_object { diff --git a/tests/json/test_enum1.cpp b/tests/json/test_enum1.cpp index 346624bb8..1457372e5 100644 --- a/tests/json/test_enum1.cpp +++ b/tests/json/test_enum1.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_enum1 { diff --git a/tests/json/test_enum2.cpp b/tests/json/test_enum2.cpp index ec0e2595c..7fbae425c 100644 --- a/tests/json/test_enum2.cpp +++ b/tests/json/test_enum2.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_enum2 { diff --git a/tests/json/test_enum3.cpp b/tests/json/test_enum3.cpp index fbf01f064..2412a99db 100644 --- a/tests/json/test_enum3.cpp +++ b/tests/json/test_enum3.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_enum3 { diff --git a/tests/json/test_enum4.cpp b/tests/json/test_enum4.cpp index 455e96972..2bfdde670 100644 --- a/tests/json/test_enum4.cpp +++ b/tests/json/test_enum4.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_enum4 { diff --git a/tests/json/test_enum5.cpp b/tests/json/test_enum5.cpp index a704d7646..56c2202f5 100644 --- a/tests/json/test_enum5.cpp +++ b/tests/json/test_enum5.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_enum5 { diff --git a/tests/json/test_enum6.cpp b/tests/json/test_enum6.cpp index 173b8d312..01fe4efa6 100644 --- a/tests/json/test_enum6.cpp +++ b/tests/json/test_enum6.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_enum6 { diff --git a/tests/json/test_enum7.cpp b/tests/json/test_enum7.cpp index 1a9776fee..29cd8cdeb 100644 --- a/tests/json/test_enum7.cpp +++ b/tests/json/test_enum7.cpp @@ -1,8 +1,9 @@ #include -#include -#include #include +import rfl; +import rfl.json; + namespace test_enum7 { diff --git a/tests/json/test_enum8.cpp b/tests/json/test_enum8.cpp index b64a4eb6f..f1f173889 100644 --- a/tests/json/test_enum8.cpp +++ b/tests/json/test_enum8.cpp @@ -1,10 +1,11 @@ #include #include -#include -#include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_enum8 { diff --git a/tests/json/test_enum_descriptions.cpp b/tests/json/test_enum_descriptions.cpp index ac2a4d7c3..ac32699cd 100644 --- a/tests/json/test_enum_descriptions.cpp +++ b/tests/json/test_enum_descriptions.cpp @@ -1,7 +1,10 @@ #include -#include -#include #include +#include + +import rfl; +import rfl.json; + namespace test_enum_descriptions { diff --git a/tests/json/test_enum_error_messages.cpp b/tests/json/test_enum_error_messages.cpp index 7514bbe35..52efac8e5 100644 --- a/tests/json/test_enum_error_messages.cpp +++ b/tests/json/test_enum_error_messages.cpp @@ -1,8 +1,11 @@ #include -#include -#include #include +#include + +import rfl; +import rfl.json; + namespace test_enum_error_messages { diff --git a/tests/json/test_enum_underlying.cpp b/tests/json/test_enum_underlying.cpp index 82605636b..4f0e5293c 100644 --- a/tests/json/test_enum_underlying.cpp +++ b/tests/json/test_enum_underlying.cpp @@ -1,6 +1,7 @@ #include +import rfl.json; + -#include namespace test_enum_underlying { diff --git a/tests/json/test_error_messages.cpp b/tests/json/test_error_messages.cpp index cbe056a4f..0a7bb8833 100644 --- a/tests/json/test_error_messages.cpp +++ b/tests/json/test_error_messages.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include +import rfl; +import rfl.json; + namespace test_error_messages { diff --git a/tests/json/test_extra_fields.cpp b/tests/json/test_extra_fields.cpp index f5d152e82..ac46e036c 100644 --- a/tests/json/test_extra_fields.cpp +++ b/tests/json/test_extra_fields.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_extra_fields { diff --git a/tests/json/test_extra_fields_with_no_extra_fields.cpp b/tests/json/test_extra_fields_with_no_extra_fields.cpp index 9a8e64cac..6966781c8 100644 --- a/tests/json/test_extra_fields_with_no_extra_fields.cpp +++ b/tests/json/test_extra_fields_with_no_extra_fields.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_extra_fields_with_no_extra_fields { diff --git a/tests/json/test_field_variant.cpp b/tests/json/test_field_variant.cpp index f89363e27..5528fb0d5 100644 --- a/tests/json/test_field_variant.cpp +++ b/tests/json/test_field_variant.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_field_variant { diff --git a/tests/json/test_field_variant_std.cpp b/tests/json/test_field_variant_std.cpp index 0ea90f011..a182e79fe 100644 --- a/tests/json/test_field_variant_std.cpp +++ b/tests/json/test_field_variant_std.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_field_variant_std { diff --git a/tests/json/test_filepath.cpp b/tests/json/test_filepath.cpp index f264bcf22..7cfe4e5af 100644 --- a/tests/json/test_filepath.cpp +++ b/tests/json/test_filepath.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_filepath { diff --git a/tests/json/test_flag_enum1.cpp b/tests/json/test_flag_enum1.cpp index c141066f9..505e482b5 100644 --- a/tests/json/test_flag_enum1.cpp +++ b/tests/json/test_flag_enum1.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_flag_enum1 { diff --git a/tests/json/test_flag_enum2.cpp b/tests/json/test_flag_enum2.cpp index ef2f71f1f..d89a75d15 100644 --- a/tests/json/test_flag_enum2.cpp +++ b/tests/json/test_flag_enum2.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_flag_enum2 { diff --git a/tests/json/test_flag_enum_with_int.cpp b/tests/json/test_flag_enum_with_int.cpp index 5fa44e2da..bf7271b73 100644 --- a/tests/json/test_flag_enum_with_int.cpp +++ b/tests/json/test_flag_enum_with_int.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_flag_enum_with_int { diff --git a/tests/json/test_flatten.cpp b/tests/json/test_flatten.cpp index f8a5425d9..5eeeb6cbb 100644 --- a/tests/json/test_flatten.cpp +++ b/tests/json/test_flatten.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_flatten { diff --git a/tests/json/test_flatten_anonymous.cpp b/tests/json/test_flatten_anonymous.cpp index e0d900b9c..2428d6b26 100644 --- a/tests/json/test_flatten_anonymous.cpp +++ b/tests/json/test_flatten_anonymous.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_flatten_anonymous { diff --git a/tests/json/test_forward_list.cpp b/tests/json/test_forward_list.cpp index 7477d58a4..114ef5bfd 100644 --- a/tests/json/test_forward_list.cpp +++ b/tests/json/test_forward_list.cpp @@ -1,8 +1,13 @@ -#include -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl; +import rfl.json; + namespace test_forward_list { diff --git a/tests/json/test_generic.cpp b/tests/json/test_generic.cpp index 1fda1954a..7afcc7787 100644 --- a/tests/json/test_generic.cpp +++ b/tests/json/test_generic.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_generic { diff --git a/tests/json/test_generic2.cpp b/tests/json/test_generic2.cpp index 6830006d6..9da4e683a 100644 --- a/tests/json/test_generic2.cpp +++ b/tests/json/test_generic2.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_generic2 { diff --git a/tests/json/test_hex.cpp b/tests/json/test_hex.cpp index 4bd52689a..576d45a9e 100644 --- a/tests/json/test_hex.cpp +++ b/tests/json/test_hex.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_hex { diff --git a/tests/json/test_inside_function.cpp b/tests/json/test_inside_function.cpp index d27a7510d..a75e31841 100644 --- a/tests/json/test_inside_function.cpp +++ b/tests/json/test_inside_function.cpp @@ -1,9 +1,10 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_inside_function { diff --git a/tests/json/test_integers.cpp b/tests/json/test_integers.cpp index f0ebc4dd1..d151e4286 100644 --- a/tests/json/test_integers.cpp +++ b/tests/json/test_integers.cpp @@ -1,8 +1,9 @@ #include -#include -#include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_integers { diff --git a/tests/json/test_json_schema.cpp b/tests/json/test_json_schema.cpp index 80a029fe5..e9a966b6b 100644 --- a/tests/json/test_json_schema.cpp +++ b/tests/json/test_json_schema.cpp @@ -1,11 +1,12 @@ -#include -#include #include #include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_json_schema { diff --git a/tests/json/test_json_schema2.cpp b/tests/json/test_json_schema2.cpp index 183379d2b..416df088b 100644 --- a/tests/json/test_json_schema2.cpp +++ b/tests/json/test_json_schema2.cpp @@ -1,11 +1,12 @@ -#include -#include #include #include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_json_schema2 { diff --git a/tests/json/test_json_schema3.cpp b/tests/json/test_json_schema3.cpp index 8ddc7959f..34268a81f 100644 --- a/tests/json/test_json_schema3.cpp +++ b/tests/json/test_json_schema3.cpp @@ -1,11 +1,12 @@ -#include -#include #include #include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_json_schema3 { diff --git a/tests/json/test_json_schema4.cpp b/tests/json/test_json_schema4.cpp index 6ff498eca..1b4107bd5 100644 --- a/tests/json/test_json_schema4.cpp +++ b/tests/json/test_json_schema4.cpp @@ -1,11 +1,12 @@ -#include -#include #include #include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_json_schema4 { diff --git a/tests/json/test_json_schema5.cpp b/tests/json/test_json_schema5.cpp index 28e432ff7..3f753e7e4 100644 --- a/tests/json/test_json_schema5.cpp +++ b/tests/json/test_json_schema5.cpp @@ -1,7 +1,8 @@ #include -#include -#include #include +import rfl; +import rfl.json; + namespace test_json_schema5 { diff --git a/tests/json/test_json_schema6.cpp b/tests/json/test_json_schema6.cpp index df516f0c6..2bfe0c638 100644 --- a/tests/json/test_json_schema6.cpp +++ b/tests/json/test_json_schema6.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_json_schema6 { diff --git a/tests/json/test_json_schema7.cpp b/tests/json/test_json_schema7.cpp index f75443eae..565b52e70 100644 --- a/tests/json/test_json_schema7.cpp +++ b/tests/json/test_json_schema7.cpp @@ -1,5 +1,6 @@ -#include -#include +import rfl; +import rfl.json; + namespace test_json_schema7 { diff --git a/tests/json/test_json_schema_deprecation.cpp b/tests/json/test_json_schema_deprecation.cpp index cd232c2f8..2c3faed6a 100644 --- a/tests/json/test_json_schema_deprecation.cpp +++ b/tests/json/test_json_schema_deprecation.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_deprecated_schema { diff --git a/tests/json/test_json_schema_size_validation.cpp b/tests/json/test_json_schema_size_validation.cpp index 941ef0b41..f9c4378e2 100644 --- a/tests/json/test_json_schema_size_validation.cpp +++ b/tests/json/test_json_schema_size_validation.cpp @@ -1,10 +1,11 @@ -#include -#include #include #include #include #include "gtest/gtest.h" +import rfl; +import rfl.json; + namespace test_json_schema_size_validation { diff --git a/tests/json/test_leak.cpp b/tests/json/test_leak.cpp index 32275d8ed..f41a4a079 100644 --- a/tests/json/test_leak.cpp +++ b/tests/json/test_leak.cpp @@ -1,8 +1,11 @@ -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_leak { diff --git a/tests/json/test_leak_arr.cpp b/tests/json/test_leak_arr.cpp index 943df9dff..d0c98b2ad 100644 --- a/tests/json/test_leak_arr.cpp +++ b/tests/json/test_leak_arr.cpp @@ -1,8 +1,12 @@ -#include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.json; + namespace test_leak_arr { diff --git a/tests/json/test_leak_rfl_tup.cpp b/tests/json/test_leak_rfl_tup.cpp index 59a4ffe92..e4b6e4ed6 100644 --- a/tests/json/test_leak_rfl_tup.cpp +++ b/tests/json/test_leak_rfl_tup.cpp @@ -1,8 +1,11 @@ -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_leak_rfl_tup { diff --git a/tests/json/test_leak_tup.cpp b/tests/json/test_leak_tup.cpp index 82ce358af..26c984d5c 100644 --- a/tests/json/test_leak_tup.cpp +++ b/tests/json/test_leak_tup.cpp @@ -1,9 +1,12 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_leak_tup { diff --git a/tests/json/test_list.cpp b/tests/json/test_list.cpp index 2378658ba..6d8ff7b44 100644 --- a/tests/json/test_list.cpp +++ b/tests/json/test_list.cpp @@ -1,8 +1,13 @@ -#include -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl; +import rfl.json; + namespace test_list { diff --git a/tests/json/test_literal.cpp b/tests/json/test_literal.cpp index 372820c6c..b511bf90b 100644 --- a/tests/json/test_literal.cpp +++ b/tests/json/test_literal.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_literal { diff --git a/tests/json/test_literal_map.cpp b/tests/json/test_literal_map.cpp index 2c1f53427..b67e5a8b3 100644 --- a/tests/json/test_literal_map.cpp +++ b/tests/json/test_literal_map.cpp @@ -1,10 +1,11 @@ #include #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_literal_map { diff --git a/tests/json/test_literal_unordered_map.cpp b/tests/json/test_literal_unordered_map.cpp index 8cae2dea6..35012df03 100644 --- a/tests/json/test_literal_unordered_map.cpp +++ b/tests/json/test_literal_unordered_map.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_literal_unordered_map { diff --git a/tests/json/test_many_fields.cpp b/tests/json/test_many_fields.cpp index e552c012a..c4c43453f 100644 --- a/tests/json/test_many_fields.cpp +++ b/tests/json/test_many_fields.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_many_fields { diff --git a/tests/json/test_map.cpp b/tests/json/test_map.cpp index e4054a9f5..6f8045f3e 100644 --- a/tests/json/test_map.cpp +++ b/tests/json/test_map.cpp @@ -1,9 +1,13 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.json; + namespace test_map { diff --git a/tests/json/test_map_with_custom_less.cpp b/tests/json/test_map_with_custom_less.cpp index 89405f49c..b3790d3b8 100644 --- a/tests/json/test_map_with_custom_less.cpp +++ b/tests/json/test_map_with_custom_less.cpp @@ -1,10 +1,13 @@ #include #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_map_with_custom_less { diff --git a/tests/json/test_map_with_key_validation.cpp b/tests/json/test_map_with_key_validation.cpp index 36ad8290c..43ed5b52f 100644 --- a/tests/json/test_map_with_key_validation.cpp +++ b/tests/json/test_map_with_key_validation.cpp @@ -1,9 +1,13 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.json; + namespace test_map_with_key_validation { diff --git a/tests/json/test_meta_fields.cpp b/tests/json/test_meta_fields.cpp index 28e6a788d..fc30eab69 100644 --- a/tests/json/test_meta_fields.cpp +++ b/tests/json/test_meta_fields.cpp @@ -1,6 +1,10 @@ -#include #include +#include +#include + +import rfl; + namespace test_meta_fields { diff --git a/tests/json/test_monster_example.cpp b/tests/json/test_monster_example.cpp index 6a1a927b3..b577509c2 100644 --- a/tests/json/test_monster_example.cpp +++ b/tests/json/test_monster_example.cpp @@ -1,9 +1,12 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_monster_example { diff --git a/tests/json/test_movable.cpp b/tests/json/test_movable.cpp index 44565a5ac..86a208693 100644 --- a/tests/json/test_movable.cpp +++ b/tests/json/test_movable.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + struct MoveableType { @@ -23,4 +24,4 @@ TEST(json, test_moveable) { write_and_read( moveable, R"(2)"); -} \ No newline at end of file +} diff --git a/tests/json/test_move_replace.cpp b/tests/json/test_move_replace.cpp index fe95f2040..92e0801bf 100644 --- a/tests/json/test_move_replace.cpp +++ b/tests/json/test_move_replace.cpp @@ -1,10 +1,13 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_move_replace { diff --git a/tests/json/test_multimap.cpp b/tests/json/test_multimap.cpp index 8fad58531..e6cce680d 100644 --- a/tests/json/test_multimap.cpp +++ b/tests/json/test_multimap.cpp @@ -1,9 +1,13 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.json; + namespace test_multimap { diff --git a/tests/json/test_multiset.cpp b/tests/json/test_multiset.cpp index c303145f1..1366619db 100644 --- a/tests/json/test_multiset.cpp +++ b/tests/json/test_multiset.cpp @@ -1,8 +1,13 @@ -#include -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl; +import rfl.json; + namespace test_multiset { diff --git a/tests/json/test_named_tuple.cpp b/tests/json/test_named_tuple.cpp index 30cc7fa4b..d193eb26a 100644 --- a/tests/json/test_named_tuple.cpp +++ b/tests/json/test_named_tuple.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_named_tuple { diff --git a/tests/json/test_no_extra_fields.cpp b/tests/json/test_no_extra_fields.cpp index 7c668bd8a..8e25880e9 100644 --- a/tests/json/test_no_extra_fields.cpp +++ b/tests/json/test_no_extra_fields.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_no_extra_fields { diff --git a/tests/json/test_no_extra_fields_with_default.cpp b/tests/json/test_no_extra_fields_with_default.cpp index b2b87abda..10dad435c 100644 --- a/tests/json/test_no_extra_fields_with_default.cpp +++ b/tests/json/test_no_extra_fields_with_default.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_no_extra_fields_with_default { diff --git a/tests/json/test_no_optionals.cpp b/tests/json/test_no_optionals.cpp index 0617a0646..bf62e6939 100644 --- a/tests/json/test_no_optionals.cpp +++ b/tests/json/test_no_optionals.cpp @@ -1,9 +1,12 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_no_optionals { diff --git a/tests/json/test_object.cpp b/tests/json/test_object.cpp index bf43b74e8..522aa1ca8 100644 --- a/tests/json/test_object.cpp +++ b/tests/json/test_object.cpp @@ -1,6 +1,7 @@ -#include #include "write_and_read.hpp" +import rfl; + namespace test_object { diff --git a/tests/json/test_oct.cpp b/tests/json/test_oct.cpp index 2a75ef0a7..d4afba9c2 100644 --- a/tests/json/test_oct.cpp +++ b/tests/json/test_oct.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_oct { diff --git a/tests/json/test_one_of.cpp b/tests/json/test_one_of.cpp index 0c104cbbc..a0e1e1976 100644 --- a/tests/json/test_one_of.cpp +++ b/tests/json/test_one_of.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_one_of { diff --git a/tests/json/test_optional_fields.cpp b/tests/json/test_optional_fields.cpp index e7d183de5..65f602c5e 100644 --- a/tests/json/test_optional_fields.cpp +++ b/tests/json/test_optional_fields.cpp @@ -1,9 +1,12 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_optional_fields { diff --git a/tests/json/test_pointer_fields.cpp b/tests/json/test_pointer_fields.cpp index fabf5fd22..6a68eb0de 100644 --- a/tests/json/test_pointer_fields.cpp +++ b/tests/json/test_pointer_fields.cpp @@ -1,9 +1,12 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_pointer_fields { diff --git a/tests/json/test_positional_and_short.cpp b/tests/json/test_positional_and_short.cpp index 0dc3e84cd..76cd666ba 100644 --- a/tests/json/test_positional_and_short.cpp +++ b/tests/json/test_positional_and_short.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_positional_and_short_json { diff --git a/tests/json/test_readme_example.cpp b/tests/json/test_readme_example.cpp index 3dc5653dd..851cdb746 100644 --- a/tests/json/test_readme_example.cpp +++ b/tests/json/test_readme_example.cpp @@ -1,9 +1,10 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_readme_example { diff --git a/tests/json/test_ref.cpp b/tests/json/test_ref.cpp index 449065464..0f5a2be51 100644 --- a/tests/json/test_ref.cpp +++ b/tests/json/test_ref.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_ref { diff --git a/tests/json/test_reflector.cpp b/tests/json/test_reflector.cpp index 06813f7d1..a930b7b2a 100644 --- a/tests/json/test_reflector.cpp +++ b/tests/json/test_reflector.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_reflector { diff --git a/tests/json/test_reflector_read.cpp b/tests/json/test_reflector_read.cpp index bc74a6444..0e3620a32 100644 --- a/tests/json/test_reflector_read.cpp +++ b/tests/json/test_reflector_read.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_reflector_read { diff --git a/tests/json/test_reflector_schema.cpp b/tests/json/test_reflector_schema.cpp index 625400e66..b818927ab 100644 --- a/tests/json/test_reflector_schema.cpp +++ b/tests/json/test_reflector_schema.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_reflector_schema { diff --git a/tests/json/test_reflector_write.cpp b/tests/json/test_reflector_write.cpp index 58b5cb8e5..4c701bab2 100644 --- a/tests/json/test_reflector_write.cpp +++ b/tests/json/test_reflector_write.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_reflector_write { diff --git a/tests/json/test_regression_bugs.cpp b/tests/json/test_regression_bugs.cpp index a9c07e1c5..d4d2d4af3 100644 --- a/tests/json/test_regression_bugs.cpp +++ b/tests/json/test_regression_bugs.cpp @@ -1,10 +1,15 @@ #include +#include #include #include +#include + +import rfl; +import rfl.json; + + -#include -#include // transform_camel_case prepends '_' to names starting with uppercase // File: include/rfl/internal/transform_case.hpp:60-73 diff --git a/tests/json/test_replace.cpp b/tests/json/test_replace.cpp index cbeac6268..6624fa2bc 100644 --- a/tests/json/test_replace.cpp +++ b/tests/json/test_replace.cpp @@ -1,10 +1,13 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_replace { diff --git a/tests/json/test_replace2.cpp b/tests/json/test_replace2.cpp index 7a4d5a171..958b268e7 100644 --- a/tests/json/test_replace2.cpp +++ b/tests/json/test_replace2.cpp @@ -1,10 +1,13 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_replace2 { diff --git a/tests/json/test_replace_flatten.cpp b/tests/json/test_replace_flatten.cpp index b7ab41861..8f017c190 100644 --- a/tests/json/test_replace_flatten.cpp +++ b/tests/json/test_replace_flatten.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_replace_flatten { diff --git a/tests/json/test_replace_flatten2.cpp b/tests/json/test_replace_flatten2.cpp index 43c083016..b717e63f2 100644 --- a/tests/json/test_replace_flatten2.cpp +++ b/tests/json/test_replace_flatten2.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_replace_flatten2 { diff --git a/tests/json/test_replace_with_other_struct.cpp b/tests/json/test_replace_with_other_struct.cpp index e0f529c73..9e73e3078 100644 --- a/tests/json/test_replace_with_other_struct.cpp +++ b/tests/json/test_replace_with_other_struct.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_replace_with_other_struct { diff --git a/tests/json/test_replace_with_other_struct2.cpp b/tests/json/test_replace_with_other_struct2.cpp index bb576a35a..46d9662f3 100644 --- a/tests/json/test_replace_with_other_struct2.cpp +++ b/tests/json/test_replace_with_other_struct2.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_replace_with_other_struct2 { diff --git a/tests/json/test_result.cpp b/tests/json/test_result.cpp index ba47369cc..0080cb60e 100644 --- a/tests/json/test_result.cpp +++ b/tests/json/test_result.cpp @@ -1,9 +1,10 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_result { diff --git a/tests/json/test_rfl_tagged_union_visit_move_only.cpp b/tests/json/test_rfl_tagged_union_visit_move_only.cpp index 8e3e20156..38da75c4d 100644 --- a/tests/json/test_rfl_tagged_union_visit_move_only.cpp +++ b/tests/json/test_rfl_tagged_union_visit_move_only.cpp @@ -1,10 +1,10 @@ #include #include -#include -#include -#include "rfl/TaggedUnion.hpp" #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_rfl_tagged_union_visit_move_only { diff --git a/tests/json/test_rfl_tuple.cpp b/tests/json/test_rfl_tuple.cpp index 21cbe30aa..f777a085e 100644 --- a/tests/json/test_rfl_tuple.cpp +++ b/tests/json/test_rfl_tuple.cpp @@ -1,10 +1,13 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_rfl_tuple { diff --git a/tests/json/test_rfl_variant.cpp b/tests/json/test_rfl_variant.cpp index b1ac4d58b..7e2ce0a70 100644 --- a/tests/json/test_rfl_variant.cpp +++ b/tests/json/test_rfl_variant.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_rfl_variant { diff --git a/tests/json/test_rfl_variant_emplace.cpp b/tests/json/test_rfl_variant_emplace.cpp index fba28b183..3ff0970d8 100644 --- a/tests/json/test_rfl_variant_emplace.cpp +++ b/tests/json/test_rfl_variant_emplace.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_rfl_variant_emplace { diff --git a/tests/json/test_rfl_variant_get_if.cpp b/tests/json/test_rfl_variant_get_if.cpp index 893e1ce7b..ba4a3c17b 100644 --- a/tests/json/test_rfl_variant_get_if.cpp +++ b/tests/json/test_rfl_variant_get_if.cpp @@ -1,8 +1,11 @@ #include -#include -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_rfl_variant_get_if { diff --git a/tests/json/test_rfl_variant_holds_alternative.cpp b/tests/json/test_rfl_variant_holds_alternative.cpp index 6d2971b07..5f2d9fe7f 100644 --- a/tests/json/test_rfl_variant_holds_alternative.cpp +++ b/tests/json/test_rfl_variant_holds_alternative.cpp @@ -1,8 +1,11 @@ #include -#include -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_rfl_variant_holds_alternative { diff --git a/tests/json/test_rfl_variant_swap.cpp b/tests/json/test_rfl_variant_swap.cpp index 723d8c637..542340e94 100644 --- a/tests/json/test_rfl_variant_swap.cpp +++ b/tests/json/test_rfl_variant_swap.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_rfl_variant_swap { diff --git a/tests/json/test_rfl_variant_visit.cpp b/tests/json/test_rfl_variant_visit.cpp index 01859e6dc..c0497d167 100644 --- a/tests/json/test_rfl_variant_visit.cpp +++ b/tests/json/test_rfl_variant_visit.cpp @@ -1,8 +1,11 @@ #include -#include -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_rfl_variant_visit { diff --git a/tests/json/test_rfl_variant_visit_in_place.cpp b/tests/json/test_rfl_variant_visit_in_place.cpp index 43f672c3f..1b59f5331 100644 --- a/tests/json/test_rfl_variant_visit_in_place.cpp +++ b/tests/json/test_rfl_variant_visit_in_place.cpp @@ -1,8 +1,11 @@ #include -#include -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_rfl_variant_visit_in_place { diff --git a/tests/json/test_rfl_variant_visit_lvalues.cpp b/tests/json/test_rfl_variant_visit_lvalues.cpp index 0697fb1cf..0e40df2d2 100644 --- a/tests/json/test_rfl_variant_visit_lvalues.cpp +++ b/tests/json/test_rfl_variant_visit_lvalues.cpp @@ -1,8 +1,9 @@ #include -#include -#include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_rfl_variant_visit_lvalues { diff --git a/tests/json/test_rfl_variant_visit_move_only.cpp b/tests/json/test_rfl_variant_visit_move_only.cpp index 152e12e1a..8ecd7ff67 100644 --- a/tests/json/test_rfl_variant_visit_move_only.cpp +++ b/tests/json/test_rfl_variant_visit_move_only.cpp @@ -1,9 +1,10 @@ #include #include -#include -#include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_rfl_variant_visit_move_only { diff --git a/tests/json/test_save_load.cpp b/tests/json/test_save_load.cpp index eccd4e2aa..f010f0ceb 100644 --- a/tests/json/test_save_load.cpp +++ b/tests/json/test_save_load.cpp @@ -1,11 +1,12 @@ #include #include -#include -#include #include #include #include +import rfl; +import rfl.json; + namespace test_save_load { diff --git a/tests/json/test_segfault.cpp b/tests/json/test_segfault.cpp index 56137b5d8..c3b8e5d63 100644 --- a/tests/json/test_segfault.cpp +++ b/tests/json/test_segfault.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + // This example had led to a segfault on GCC 12. // To make sure this won't happen again, we include diff --git a/tests/json/test_set.cpp b/tests/json/test_set.cpp index 8afc04ec9..e48fc65cc 100644 --- a/tests/json/test_set.cpp +++ b/tests/json/test_set.cpp @@ -1,9 +1,13 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.json; + namespace test_set { diff --git a/tests/json/test_shared_ptr.cpp b/tests/json/test_shared_ptr.cpp index 7af635149..a6a0df337 100644 --- a/tests/json/test_shared_ptr.cpp +++ b/tests/json/test_shared_ptr.cpp @@ -1,10 +1,13 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_shared_ptr { diff --git a/tests/json/test_size.cpp b/tests/json/test_size.cpp index c7babbd59..b733e50c4 100644 --- a/tests/json/test_size.cpp +++ b/tests/json/test_size.cpp @@ -1,9 +1,10 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_size { diff --git a/tests/json/test_skip.cpp b/tests/json/test_skip.cpp index 802bb6e2a..00e83e95c 100644 --- a/tests/json/test_skip.cpp +++ b/tests/json/test_skip.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_skip { diff --git a/tests/json/test_skip2.cpp b/tests/json/test_skip2.cpp index 3c744936b..8efc6b59d 100644 --- a/tests/json/test_skip2.cpp +++ b/tests/json/test_skip2.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_skip2 { diff --git a/tests/json/test_snake_case_to_camel_case.cpp b/tests/json/test_snake_case_to_camel_case.cpp index cd8dfde0c..e6f7abc46 100644 --- a/tests/json/test_snake_case_to_camel_case.cpp +++ b/tests/json/test_snake_case_to_camel_case.cpp @@ -1,9 +1,10 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_snake_case_to_camel_case { diff --git a/tests/json/test_snake_case_to_camel_case_rename.cpp b/tests/json/test_snake_case_to_camel_case_rename.cpp index e5850b2c5..39ea2f180 100644 --- a/tests/json/test_snake_case_to_camel_case_rename.cpp +++ b/tests/json/test_snake_case_to_camel_case_rename.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_snake_case_to_camel_case_rename { diff --git a/tests/json/test_snake_case_to_pascal_case.cpp b/tests/json/test_snake_case_to_pascal_case.cpp index 2a88cec76..be59b6de8 100644 --- a/tests/json/test_snake_case_to_pascal_case.cpp +++ b/tests/json/test_snake_case_to_pascal_case.cpp @@ -1,9 +1,10 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_snake_case_to_pascal_case { diff --git a/tests/json/test_snake_case_to_pascal_case_rename.cpp b/tests/json/test_snake_case_to_pascal_case_rename.cpp index c4cda458f..819ee0505 100644 --- a/tests/json/test_snake_case_to_pascal_case_rename.cpp +++ b/tests/json/test_snake_case_to_pascal_case_rename.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_pascal_case_to_camel_case_rename { diff --git a/tests/json/test_span.cpp b/tests/json/test_span.cpp index a29e698f1..70ea18831 100644 --- a/tests/json/test_span.cpp +++ b/tests/json/test_span.cpp @@ -1,11 +1,12 @@ #include -#include -#include #include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_span { diff --git a/tests/json/test_std_ref.cpp b/tests/json/test_std_ref.cpp index 4ccb03107..46bdc7e4f 100644 --- a/tests/json/test_std_ref.cpp +++ b/tests/json/test_std_ref.cpp @@ -1,10 +1,11 @@ #include #include -#include -#include #include #include +import rfl; +import rfl.json; + namespace test_std_ref { diff --git a/tests/json/test_string_map.cpp b/tests/json/test_string_map.cpp index 84515c273..f2e464a6b 100644 --- a/tests/json/test_string_map.cpp +++ b/tests/json/test_string_map.cpp @@ -1,10 +1,11 @@ #include #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_string_map { TEST(json, test_string_map) { diff --git a/tests/json/test_string_unordered_map.cpp b/tests/json/test_string_unordered_map.cpp index 76658770d..07e05bd1e 100644 --- a/tests/json/test_string_unordered_map.cpp +++ b/tests/json/test_string_unordered_map.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_string_unordered_map { TEST(json, test_string_unordered_map) { diff --git a/tests/json/test_string_view.cpp b/tests/json/test_string_view.cpp index a92f25829..27edffc80 100644 --- a/tests/json/test_string_view.cpp +++ b/tests/json/test_string_view.cpp @@ -1,9 +1,12 @@ #include #include -#include -#include #include +#include + +import rfl; +import rfl.json; + namespace test_string_view { diff --git a/tests/json/test_strip_field_names.cpp b/tests/json/test_strip_field_names.cpp index eda633fca..d87e0ef2f 100644 --- a/tests/json/test_strip_field_names.cpp +++ b/tests/json/test_strip_field_names.cpp @@ -1,9 +1,10 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_strip_field_names { diff --git a/tests/json/test_tagged_union.cpp b/tests/json/test_tagged_union.cpp index 12f2098f5..c34f1b121 100644 --- a/tests/json/test_tagged_union.cpp +++ b/tests/json/test_tagged_union.cpp @@ -1,7 +1,8 @@ -#include -#include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_tagged_union { diff --git a/tests/json/test_tagged_union2.cpp b/tests/json/test_tagged_union2.cpp index a0d3a73d7..cb805ce3c 100644 --- a/tests/json/test_tagged_union2.cpp +++ b/tests/json/test_tagged_union2.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_tagged_union2 { diff --git a/tests/json/test_tagged_union3.cpp b/tests/json/test_tagged_union3.cpp index f0e2f4376..b96426323 100644 --- a/tests/json/test_tagged_union3.cpp +++ b/tests/json/test_tagged_union3.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_tagged_union3 { diff --git a/tests/json/test_tagged_union4.cpp b/tests/json/test_tagged_union4.cpp index a1ba70c62..340df3ec9 100644 --- a/tests/json/test_tagged_union4.cpp +++ b/tests/json/test_tagged_union4.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_tagged_union4 { diff --git a/tests/json/test_tagged_union5.cpp b/tests/json/test_tagged_union5.cpp index 27181cb14..a67e7a558 100644 --- a/tests/json/test_tagged_union5.cpp +++ b/tests/json/test_tagged_union5.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include +#include + +import rfl; +import rfl.json; + namespace test_tagged_union5 { diff --git a/tests/json/test_tagged_union_with_no_extra_fields.cpp b/tests/json/test_tagged_union_with_no_extra_fields.cpp index e2b2bc5c9..c15b7b7bd 100644 --- a/tests/json/test_tagged_union_with_no_extra_fields.cpp +++ b/tests/json/test_tagged_union_with_no_extra_fields.cpp @@ -1,7 +1,8 @@ -#include -#include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_tagged_union_with_no_extra_fields { diff --git a/tests/json/test_template.cpp b/tests/json/test_template.cpp index 93ddad658..5de96bbd6 100644 --- a/tests/json/test_template.cpp +++ b/tests/json/test_template.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_template { diff --git a/tests/json/test_time_point.cpp b/tests/json/test_time_point.cpp index 01f03260d..ddbcd1435 100644 --- a/tests/json/test_time_point.cpp +++ b/tests/json/test_time_point.cpp @@ -1,9 +1,10 @@ #include #include -#include -#include #include +import rfl; +import rfl.json; + namespace test_time_point { diff --git a/tests/json/test_timestamp.cpp b/tests/json/test_timestamp.cpp index 0c91fb744..da17eb702 100644 --- a/tests/json/test_timestamp.cpp +++ b/tests/json/test_timestamp.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_timestamp { diff --git a/tests/json/test_transform.cpp b/tests/json/test_transform.cpp index 4909720df..47516d223 100644 --- a/tests/json/test_transform.cpp +++ b/tests/json/test_transform.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_transform { diff --git a/tests/json/test_tuple.cpp b/tests/json/test_tuple.cpp index bc1216b4b..a7634185c 100644 --- a/tests/json/test_tuple.cpp +++ b/tests/json/test_tuple.cpp @@ -1,11 +1,14 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_tuple { diff --git a/tests/json/test_underlying_enums.cpp b/tests/json/test_underlying_enums.cpp index 3634a4d9d..db8a8b3d1 100644 --- a/tests/json/test_underlying_enums.cpp +++ b/tests/json/test_underlying_enums.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_underlying_enums { diff --git a/tests/json/test_unique_ptr.cpp b/tests/json/test_unique_ptr.cpp index 075505c14..4f4ebd09d 100644 --- a/tests/json/test_unique_ptr.cpp +++ b/tests/json/test_unique_ptr.cpp @@ -1,10 +1,13 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_unique_ptr { diff --git a/tests/json/test_unique_ptr2.cpp b/tests/json/test_unique_ptr2.cpp index 125dff51b..9dfa9428f 100644 --- a/tests/json/test_unique_ptr2.cpp +++ b/tests/json/test_unique_ptr2.cpp @@ -1,9 +1,13 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.json; + namespace test_unique_ptr2 { diff --git a/tests/json/test_unnamed_namespace.cpp b/tests/json/test_unnamed_namespace.cpp index 29d70efa3..7dcc3cb30 100644 --- a/tests/json/test_unnamed_namespace.cpp +++ b/tests/json/test_unnamed_namespace.cpp @@ -1,9 +1,10 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_unnamed_namespace { diff --git a/tests/json/test_unordered_map.cpp b/tests/json/test_unordered_map.cpp index 756ae3552..6a761631a 100644 --- a/tests/json/test_unordered_map.cpp +++ b/tests/json/test_unordered_map.cpp @@ -1,9 +1,13 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.json; + namespace test_unordered_map { diff --git a/tests/json/test_unordered_map_with_custom_hash.cpp b/tests/json/test_unordered_map_with_custom_hash.cpp index 7b57e3c08..2d3809961 100644 --- a/tests/json/test_unordered_map_with_custom_hash.cpp +++ b/tests/json/test_unordered_map_with_custom_hash.cpp @@ -1,9 +1,14 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl; +import rfl.json; + namespace test_unordered_map_with_custom_hash { diff --git a/tests/json/test_unordered_multimap.cpp b/tests/json/test_unordered_multimap.cpp index d405a9f80..e259e01f2 100644 --- a/tests/json/test_unordered_multimap.cpp +++ b/tests/json/test_unordered_multimap.cpp @@ -1,8 +1,13 @@ -#include -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl; +import rfl.json; + namespace test_unordered_multimap { diff --git a/tests/json/test_unordered_multiset.cpp b/tests/json/test_unordered_multiset.cpp index 656d65deb..2204d1aed 100644 --- a/tests/json/test_unordered_multiset.cpp +++ b/tests/json/test_unordered_multiset.cpp @@ -1,8 +1,13 @@ -#include -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl; +import rfl.json; + namespace test_unordered_multiset { diff --git a/tests/json/test_unordered_set.cpp b/tests/json/test_unordered_set.cpp index 1037dee24..628206bab 100644 --- a/tests/json/test_unordered_set.cpp +++ b/tests/json/test_unordered_set.cpp @@ -1,8 +1,13 @@ -#include -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl; +import rfl.json; + namespace test_unordered_set { diff --git a/tests/json/test_uuid.cpp b/tests/json/test_uuid.cpp index 56e8d2b20..60ae4eaf3 100644 --- a/tests/json/test_uuid.cpp +++ b/tests/json/test_uuid.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_uuid { diff --git a/tests/json/test_validation_with_fields.cpp b/tests/json/test_validation_with_fields.cpp index 380dc9c5e..ba45e33b3 100644 --- a/tests/json/test_validation_with_fields.cpp +++ b/tests/json/test_validation_with_fields.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.json; + namespace test_validation_with_fields { diff --git a/tests/json/test_variant.cpp b/tests/json/test_variant.cpp index c467cd532..77cb1ec4d 100644 --- a/tests/json/test_variant.cpp +++ b/tests/json/test_variant.cpp @@ -1,9 +1,13 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.json; + namespace test_variant { diff --git a/tests/json/test_view.cpp b/tests/json/test_view.cpp index 79c7e5f4b..e2875b540 100644 --- a/tests/json/test_view.cpp +++ b/tests/json/test_view.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_view { diff --git a/tests/json/test_wstring.cpp b/tests/json/test_wstring.cpp index 1f73080fb..beeac414f 100644 --- a/tests/json/test_wstring.cpp +++ b/tests/json/test_wstring.cpp @@ -1,9 +1,10 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.json; + namespace test_wstring { TEST(json, test_wstring) { diff --git a/tests/json/write_and_read.hpp b/tests/json/write_and_read.hpp index 830791f80..8b6d46c1e 100644 --- a/tests/json/write_and_read.hpp +++ b/tests/json/write_and_read.hpp @@ -4,9 +4,11 @@ #include #include -#include #include #include +import rfl.json; + + template auto write(const auto& _struct, const std::string& _expected) { diff --git a/tests/json_c_arrays_and_inheritance/CMakeLists.txt b/tests/json_c_arrays_and_inheritance/CMakeLists.txt index a7f7f7046..44aba6e43 100644 --- a/tests/json_c_arrays_and_inheritance/CMakeLists.txt +++ b/tests/json_c_arrays_and_inheritance/CMakeLists.txt @@ -6,11 +6,9 @@ add_executable( reflect-cpp-json-c-arrays-and-inheritance-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-json-c-arrays-and-inheritance-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-json-c-arrays-and-inheritance-tests PRIVATE ) -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DREFLECT_CPP_C_ARRAYS_OR_INHERITANCE") - target_include_directories(reflect-cpp-json-c-arrays-and-inheritance-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") target_link_libraries(reflect-cpp-json-c-arrays-and-inheritance-tests PRIVATE reflectcpp_tests_crt) diff --git a/tests/json_c_arrays_and_inheritance/test_inheritance.cpp b/tests/json_c_arrays_and_inheritance/test_inheritance.cpp index 88379ccf3..5657c9da5 100644 --- a/tests/json_c_arrays_and_inheritance/test_inheritance.cpp +++ b/tests/json_c_arrays_and_inheritance/test_inheritance.cpp @@ -1,7 +1,8 @@ #include #include -#include +import rfl.c_arrays_and_inheritance; + namespace test_inheritance { diff --git a/tests/json_c_arrays_and_inheritance/test_inheritance2.cpp b/tests/json_c_arrays_and_inheritance/test_inheritance2.cpp index e79b3541b..5860371f4 100644 --- a/tests/json_c_arrays_and_inheritance/test_inheritance2.cpp +++ b/tests/json_c_arrays_and_inheritance/test_inheritance2.cpp @@ -1,9 +1,9 @@ #include #include -#include +import rfl.c_arrays_and_inheritance; + -#include "rfl/num_fields.hpp" namespace test_inheritance2 { diff --git a/tests/json_c_arrays_and_inheritance/write_and_read.hpp b/tests/json_c_arrays_and_inheritance/write_and_read.hpp index 830791f80..8ccb294a1 100644 --- a/tests/json_c_arrays_and_inheritance/write_and_read.hpp +++ b/tests/json_c_arrays_and_inheritance/write_and_read.hpp @@ -4,9 +4,11 @@ #include #include -#include #include #include +import rfl.c_arrays_and_inheritance; + + template auto write(const auto& _struct, const std::string& _expected) { diff --git a/tests/msgpack/CMakeLists.txt b/tests/msgpack/CMakeLists.txt index 3c093dac0..e146eee0a 100644 --- a/tests/msgpack/CMakeLists.txt +++ b/tests/msgpack/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-msgpack-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-msgpack-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-msgpack-tests PRIVATE ) target_include_directories(reflect-cpp-msgpack-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") diff --git a/tests/msgpack/test_add_struct_name.cpp b/tests/msgpack/test_add_struct_name.cpp index 9b43f3970..16bb200ba 100644 --- a/tests/msgpack/test_add_struct_name.cpp +++ b/tests/msgpack/test_add_struct_name.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.msgpack; namespace test_add_struct_name { diff --git a/tests/msgpack/test_array.cpp b/tests/msgpack/test_array.cpp index bb694bb56..0e2295a54 100644 --- a/tests/msgpack/test_array.cpp +++ b/tests/msgpack/test_array.cpp @@ -1,13 +1,16 @@ #include #include -#include #include // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.msgpack; + namespace test_array { diff --git a/tests/msgpack/test_box.cpp b/tests/msgpack/test_box.cpp index bb2737c4e..c97b29a81 100644 --- a/tests/msgpack/test_box.cpp +++ b/tests/msgpack/test_box.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.msgpack; +import rfl; + namespace test_box { diff --git a/tests/msgpack/test_bytestring.cpp b/tests/msgpack/test_bytestring.cpp index efb1d68af..999983fee 100644 --- a/tests/msgpack/test_bytestring.cpp +++ b/tests/msgpack/test_bytestring.cpp @@ -1,6 +1,10 @@ -#include #include "write_and_read.hpp" +#include + +import rfl.msgpack; +import rfl; + namespace test_bytestring { diff --git a/tests/msgpack/test_combined_processors.cpp b/tests/msgpack/test_combined_processors.cpp index e2e2b7796..390e529ab 100644 --- a/tests/msgpack/test_combined_processors.cpp +++ b/tests/msgpack/test_combined_processors.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.msgpack; namespace test_combined_processors { diff --git a/tests/msgpack/test_custom_class1.cpp b/tests/msgpack/test_custom_class1.cpp index 69f86afaa..130c60b54 100644 --- a/tests/msgpack/test_custom_class1.cpp +++ b/tests/msgpack/test_custom_class1.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_custom_class1 { diff --git a/tests/msgpack/test_custom_class3.cpp b/tests/msgpack/test_custom_class3.cpp index 0b94d2391..1391d544a 100644 --- a/tests/msgpack/test_custom_class3.cpp +++ b/tests/msgpack/test_custom_class3.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_custom_class3 { diff --git a/tests/msgpack/test_custom_class4.cpp b/tests/msgpack/test_custom_class4.cpp index f944367d0..82774b735 100644 --- a/tests/msgpack/test_custom_class4.cpp +++ b/tests/msgpack/test_custom_class4.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_custom_class4 { diff --git a/tests/msgpack/test_default_values.cpp b/tests/msgpack/test_default_values.cpp index 582529a59..ecd332ef1 100644 --- a/tests/msgpack/test_default_values.cpp +++ b/tests/msgpack/test_default_values.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_default_values { diff --git a/tests/msgpack/test_deque.cpp b/tests/msgpack/test_deque.cpp index 4b8eae7c5..0ca2cebf6 100644 --- a/tests/msgpack/test_deque.cpp +++ b/tests/msgpack/test_deque.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.msgpack; +import rfl; + namespace test_deque { diff --git a/tests/msgpack/test_enum.cpp b/tests/msgpack/test_enum.cpp index dddbab8ec..b57224f19 100644 --- a/tests/msgpack/test_enum.cpp +++ b/tests/msgpack/test_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_enum { diff --git a/tests/msgpack/test_extra_fields.cpp b/tests/msgpack/test_extra_fields.cpp index 0633031e1..ea1459ad2 100644 --- a/tests/msgpack/test_extra_fields.cpp +++ b/tests/msgpack/test_extra_fields.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_extra_fields { diff --git a/tests/msgpack/test_field_variant.cpp b/tests/msgpack/test_field_variant.cpp index 06d44edfe..314ba74e9 100644 --- a/tests/msgpack/test_field_variant.cpp +++ b/tests/msgpack/test_field_variant.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_field_variant { diff --git a/tests/msgpack/test_flag_enum.cpp b/tests/msgpack/test_flag_enum.cpp index 25996b18d..bf5855ebf 100644 --- a/tests/msgpack/test_flag_enum.cpp +++ b/tests/msgpack/test_flag_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_flag_enum { diff --git a/tests/msgpack/test_flag_enum_with_int.cpp b/tests/msgpack/test_flag_enum_with_int.cpp index 46473a8a5..94324d746 100644 --- a/tests/msgpack/test_flag_enum_with_int.cpp +++ b/tests/msgpack/test_flag_enum_with_int.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/msgpack/test_flatten.cpp b/tests/msgpack/test_flatten.cpp index 07c5594a1..c52cee555 100644 --- a/tests/msgpack/test_flatten.cpp +++ b/tests/msgpack/test_flatten.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_flatten { diff --git a/tests/msgpack/test_flatten_anonymous.cpp b/tests/msgpack/test_flatten_anonymous.cpp index b25ec9ee0..de716eb61 100644 --- a/tests/msgpack/test_flatten_anonymous.cpp +++ b/tests/msgpack/test_flatten_anonymous.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/msgpack/test_forward_list.cpp b/tests/msgpack/test_forward_list.cpp index 880793960..8748fab73 100644 --- a/tests/msgpack/test_forward_list.cpp +++ b/tests/msgpack/test_forward_list.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.msgpack; +import rfl; + namespace test_forward_list { diff --git a/tests/msgpack/test_generic_float.cpp b/tests/msgpack/test_generic_float.cpp index c23f6756c..6a16d38a6 100644 --- a/tests/msgpack/test_generic_float.cpp +++ b/tests/msgpack/test_generic_float.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_generic_float { diff --git a/tests/msgpack/test_literal.cpp b/tests/msgpack/test_literal.cpp index 2eaf117cb..4cb46ea1e 100644 --- a/tests/msgpack/test_literal.cpp +++ b/tests/msgpack/test_literal.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_literal { diff --git a/tests/msgpack/test_literal_map.cpp b/tests/msgpack/test_literal_map.cpp index 5b0bf148d..6f26725a6 100644 --- a/tests/msgpack/test_literal_map.cpp +++ b/tests/msgpack/test_literal_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_literal_map { diff --git a/tests/msgpack/test_map.cpp b/tests/msgpack/test_map.cpp index 1736704a5..252909f41 100644 --- a/tests/msgpack/test_map.cpp +++ b/tests/msgpack/test_map.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl.msgpack; +import rfl; + namespace test_map { diff --git a/tests/msgpack/test_map_with_key_validation.cpp b/tests/msgpack/test_map_with_key_validation.cpp index 072b530b0..b91e9ca5b 100644 --- a/tests/msgpack/test_map_with_key_validation.cpp +++ b/tests/msgpack/test_map_with_key_validation.cpp @@ -1,8 +1,13 @@ #include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl.msgpack; +import rfl; + namespace test_map_with_key_validation { diff --git a/tests/msgpack/test_monster_example.cpp b/tests/msgpack/test_monster_example.cpp index 60def237f..f11c2c661 100644 --- a/tests/msgpack/test_monster_example.cpp +++ b/tests/msgpack/test_monster_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_monster_example { diff --git a/tests/msgpack/test_readme_example.cpp b/tests/msgpack/test_readme_example.cpp index ef57bf705..3e4d55a68 100644 --- a/tests/msgpack/test_readme_example.cpp +++ b/tests/msgpack/test_readme_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_readme_example { diff --git a/tests/msgpack/test_readme_example2.cpp b/tests/msgpack/test_readme_example2.cpp index 10633487f..9bb556be7 100644 --- a/tests/msgpack/test_readme_example2.cpp +++ b/tests/msgpack/test_readme_example2.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_readme_example2 { diff --git a/tests/msgpack/test_ref.cpp b/tests/msgpack/test_ref.cpp index f56e1cdda..6c35f5c4a 100644 --- a/tests/msgpack/test_ref.cpp +++ b/tests/msgpack/test_ref.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.msgpack; +import rfl; + namespace test_ref { diff --git a/tests/msgpack/test_regression_bugs.cpp b/tests/msgpack/test_regression_bugs.cpp index 04fb31837..954cdb420 100644 --- a/tests/msgpack/test_regression_bugs.cpp +++ b/tests/msgpack/test_regression_bugs.cpp @@ -6,9 +6,10 @@ #include #include #include +import rfl; +import rfl.msgpack; + -#include -#include // msgpack::read — ignores return value of msgpack_unpack // File: include/rfl/msgpack/read.hpp:35-36 diff --git a/tests/msgpack/test_save_load.cpp b/tests/msgpack/test_save_load.cpp index a5c34bf14..880cb9749 100644 --- a/tests/msgpack/test_save_load.cpp +++ b/tests/msgpack/test_save_load.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include +import rfl; +import rfl.msgpack; + namespace test_save_load { diff --git a/tests/msgpack/test_set.cpp b/tests/msgpack/test_set.cpp index 2115eeb83..3ff27289a 100644 --- a/tests/msgpack/test_set.cpp +++ b/tests/msgpack/test_set.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.msgpack; +import rfl; + namespace test_set { diff --git a/tests/msgpack/test_size.cpp b/tests/msgpack/test_size.cpp index d368ec621..857c0b658 100644 --- a/tests/msgpack/test_size.cpp +++ b/tests/msgpack/test_size.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_size { diff --git a/tests/msgpack/test_skip.cpp b/tests/msgpack/test_skip.cpp index 428df8603..d88cee46e 100644 --- a/tests/msgpack/test_skip.cpp +++ b/tests/msgpack/test_skip.cpp @@ -1,6 +1,7 @@ #include #include "write_and_read.hpp" +import rfl.msgpack; namespace test_skip { diff --git a/tests/msgpack/test_snake_case_to_camel_case.cpp b/tests/msgpack/test_snake_case_to_camel_case.cpp index ba65e5d4b..7baf173dd 100644 --- a/tests/msgpack/test_snake_case_to_camel_case.cpp +++ b/tests/msgpack/test_snake_case_to_camel_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.msgpack; namespace test_snake_case_to_camel_case { diff --git a/tests/msgpack/test_snake_case_to_pascal_case.cpp b/tests/msgpack/test_snake_case_to_pascal_case.cpp index c0cd8f105..b4f0e345a 100644 --- a/tests/msgpack/test_snake_case_to_pascal_case.cpp +++ b/tests/msgpack/test_snake_case_to_pascal_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.msgpack; namespace test_snake_case_to_pascal_case { diff --git a/tests/msgpack/test_string_map.cpp b/tests/msgpack/test_string_map.cpp index da6a46ef1..e17a15d71 100644 --- a/tests/msgpack/test_string_map.cpp +++ b/tests/msgpack/test_string_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_string_map { TEST(msgpack, test_string_map) { diff --git a/tests/msgpack/test_tagged_union.cpp b/tests/msgpack/test_tagged_union.cpp index 9d951400d..67ed23827 100644 --- a/tests/msgpack/test_tagged_union.cpp +++ b/tests/msgpack/test_tagged_union.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_tagged_union { diff --git a/tests/msgpack/test_tagged_union2.cpp b/tests/msgpack/test_tagged_union2.cpp index 5c5022cd5..e4ad1e5bb 100644 --- a/tests/msgpack/test_tagged_union2.cpp +++ b/tests/msgpack/test_tagged_union2.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_tagged_union2 { diff --git a/tests/msgpack/test_timestamp.cpp b/tests/msgpack/test_timestamp.cpp index ab2a81db3..5b9f06e33 100644 --- a/tests/msgpack/test_timestamp.cpp +++ b/tests/msgpack/test_timestamp.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_timestamp { diff --git a/tests/msgpack/test_unique_ptr.cpp b/tests/msgpack/test_unique_ptr.cpp index 5dff3ab29..02a981a76 100644 --- a/tests/msgpack/test_unique_ptr.cpp +++ b/tests/msgpack/test_unique_ptr.cpp @@ -1,9 +1,13 @@ #include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.msgpack; +import rfl; + namespace test_unique_ptr { diff --git a/tests/msgpack/test_unique_ptr2.cpp b/tests/msgpack/test_unique_ptr2.cpp index ec11bfcc5..a84002692 100644 --- a/tests/msgpack/test_unique_ptr2.cpp +++ b/tests/msgpack/test_unique_ptr2.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.msgpack; +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/msgpack/test_variant.cpp b/tests/msgpack/test_variant.cpp index 76353ed73..e0619d08f 100644 --- a/tests/msgpack/test_variant.cpp +++ b/tests/msgpack/test_variant.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.msgpack; +import rfl; + namespace test_variant { diff --git a/tests/msgpack/test_vectorstring.cpp b/tests/msgpack/test_vectorstring.cpp index 2a9dd7d43..360c4a9a8 100644 --- a/tests/msgpack/test_vectorstring.cpp +++ b/tests/msgpack/test_vectorstring.cpp @@ -1,6 +1,8 @@ -#include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + namespace test_vectorstring { @@ -14,4 +16,4 @@ TEST(msgpack, test_vectorstring) { write_and_read(test); } -} // namespace test_vectorstring \ No newline at end of file +} // namespace test_vectorstring diff --git a/tests/msgpack/test_wstring.cpp b/tests/msgpack/test_wstring.cpp index f69be6d1c..9ffb5dce7 100644 --- a/tests/msgpack/test_wstring.cpp +++ b/tests/msgpack/test_wstring.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.msgpack; +import rfl; + struct TestStruct { std::string theNormalString; diff --git a/tests/msgpack/write_and_read.hpp b/tests/msgpack/write_and_read.hpp index 23b62820f..a3fcfd9ad 100644 --- a/tests/msgpack/write_and_read.hpp +++ b/tests/msgpack/write_and_read.hpp @@ -2,8 +2,11 @@ #define WRITE_AND_READ_ #include +#include + +import rfl.msgpack; + -#include template void write_and_read(const auto& _struct) { diff --git a/tests/parquet/CMakeLists.txt b/tests/parquet/CMakeLists.txt index 12caaa93e..dc5103ff2 100644 --- a/tests/parquet/CMakeLists.txt +++ b/tests/parquet/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-parquet-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-parquet-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-parquet-tests PRIVATE ) target_include_directories(reflect-cpp-parquet-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") diff --git a/tests/parquet/test_boolean.cpp b/tests/parquet/test_boolean.cpp index 8f8d125f0..2594c0993 100644 --- a/tests/parquet/test_boolean.cpp +++ b/tests/parquet/test_boolean.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.parquet; + namespace test_boolean { diff --git a/tests/parquet/test_box.cpp b/tests/parquet/test_box.cpp index 2a468b6dc..d4e25d36f 100644 --- a/tests/parquet/test_box.cpp +++ b/tests/parquet/test_box.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.parquet; + namespace test_box { diff --git a/tests/parquet/test_bytestring.cpp b/tests/parquet/test_bytestring.cpp index 56d85f1ee..be2e2c318 100644 --- a/tests/parquet/test_bytestring.cpp +++ b/tests/parquet/test_bytestring.cpp @@ -1,7 +1,10 @@ -#include #include #include "write_and_read.hpp" +#include + +import rfl.parquet; + namespace test_bytestring { diff --git a/tests/parquet/test_camel_case.cpp b/tests/parquet/test_camel_case.cpp index c36cfde53..db809408c 100644 --- a/tests/parquet/test_camel_case.cpp +++ b/tests/parquet/test_camel_case.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.parquet; + namespace test_camel_case { diff --git a/tests/parquet/test_deque.cpp b/tests/parquet/test_deque.cpp index 6fd0a6370..2935f67e3 100644 --- a/tests/parquet/test_deque.cpp +++ b/tests/parquet/test_deque.cpp @@ -1,8 +1,9 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.parquet; + namespace test_deque { diff --git a/tests/parquet/test_enums.cpp b/tests/parquet/test_enums.cpp index cc512606b..22c2a3f73 100644 --- a/tests/parquet/test_enums.cpp +++ b/tests/parquet/test_enums.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.parquet; + namespace test_enums { diff --git a/tests/parquet/test_flatten.cpp b/tests/parquet/test_flatten.cpp index 93c7345f1..71d22d079 100644 --- a/tests/parquet/test_flatten.cpp +++ b/tests/parquet/test_flatten.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.parquet; + namespace test_flatten { diff --git a/tests/parquet/test_gzip.cpp b/tests/parquet/test_gzip.cpp index cf600d89d..f50c7b9d8 100644 --- a/tests/parquet/test_gzip.cpp +++ b/tests/parquet/test_gzip.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.parquet; + namespace test_gzip { diff --git a/tests/parquet/test_literal.cpp b/tests/parquet/test_literal.cpp index ad021fb74..1b77a3ad7 100644 --- a/tests/parquet/test_literal.cpp +++ b/tests/parquet/test_literal.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.parquet; + namespace test_literal { diff --git a/tests/parquet/test_optionals.cpp b/tests/parquet/test_optionals.cpp index a070494b4..f7665f5f0 100644 --- a/tests/parquet/test_optionals.cpp +++ b/tests/parquet/test_optionals.cpp @@ -1,9 +1,10 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.parquet; + namespace test_optionals { diff --git a/tests/parquet/test_readme_example.cpp b/tests/parquet/test_readme_example.cpp index 6a5b0db21..99acc4898 100644 --- a/tests/parquet/test_readme_example.cpp +++ b/tests/parquet/test_readme_example.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.parquet; + namespace test_readme_example { diff --git a/tests/parquet/test_ref.cpp b/tests/parquet/test_ref.cpp index a7e405b59..fca832c5e 100644 --- a/tests/parquet/test_ref.cpp +++ b/tests/parquet/test_ref.cpp @@ -1,8 +1,9 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.parquet; + namespace test_ref { diff --git a/tests/parquet/test_save_load.cpp b/tests/parquet/test_save_load.cpp index 3b5c0d41a..42fdebfe3 100644 --- a/tests/parquet/test_save_load.cpp +++ b/tests/parquet/test_save_load.cpp @@ -1,10 +1,11 @@ #include #include -#include -#include #include #include +import rfl; +import rfl.parquet; + namespace test_save_load { diff --git a/tests/parquet/test_shared_ptr.cpp b/tests/parquet/test_shared_ptr.cpp index dce923e77..fc5d92ea9 100644 --- a/tests/parquet/test_shared_ptr.cpp +++ b/tests/parquet/test_shared_ptr.cpp @@ -1,9 +1,10 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.parquet; + namespace test_shared_ptr { diff --git a/tests/parquet/test_unique_ptr.cpp b/tests/parquet/test_unique_ptr.cpp index 18b7a5047..725f38457 100644 --- a/tests/parquet/test_unique_ptr.cpp +++ b/tests/parquet/test_unique_ptr.cpp @@ -1,9 +1,10 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.parquet; + namespace test_unique_ptr { diff --git a/tests/parquet/write_and_read.hpp b/tests/parquet/write_and_read.hpp index 4ec554ea6..2fc2b0306 100644 --- a/tests/parquet/write_and_read.hpp +++ b/tests/parquet/write_and_read.hpp @@ -2,8 +2,11 @@ #define WRITE_AND_READ_ #include +#include + +import rfl.parquet; + -#include template void write_and_read(const auto& _vec, const rfl::parquet::Settings& _settings = diff --git a/tests/toml/CMakeLists.txt b/tests/toml/CMakeLists.txt index 994a60ca8..6b93a74a4 100644 --- a/tests/toml/CMakeLists.txt +++ b/tests/toml/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-toml-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-toml-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-toml-tests PRIVATE ) target_link_libraries(reflect-cpp-toml-tests PRIVATE reflectcpp_tests_crt) diff --git a/tests/toml/test_add_struct_name.cpp b/tests/toml/test_add_struct_name.cpp index de354e451..1c7d1f682 100644 --- a/tests/toml/test_add_struct_name.cpp +++ b/tests/toml/test_add_struct_name.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.toml; namespace test_add_struct_name { diff --git a/tests/toml/test_array.cpp b/tests/toml/test_array.cpp index 76b659610..4d96199da 100644 --- a/tests/toml/test_array.cpp +++ b/tests/toml/test_array.cpp @@ -1,13 +1,16 @@ #include #include -#include #include // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.toml; + namespace test_array { diff --git a/tests/toml/test_box.cpp b/tests/toml/test_box.cpp index 724986deb..01cc473fc 100644 --- a/tests/toml/test_box.cpp +++ b/tests/toml/test_box.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.toml; +import rfl; + namespace test_box { diff --git a/tests/toml/test_combined_processors.cpp b/tests/toml/test_combined_processors.cpp index 39aaf28be..4009fc5e3 100644 --- a/tests/toml/test_combined_processors.cpp +++ b/tests/toml/test_combined_processors.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.toml; namespace test_combined_processors { diff --git a/tests/toml/test_custom_class1.cpp b/tests/toml/test_custom_class1.cpp index e3109aedf..3bfb9eeb1 100644 --- a/tests/toml/test_custom_class1.cpp +++ b/tests/toml/test_custom_class1.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_custom_class1 { diff --git a/tests/toml/test_custom_class3.cpp b/tests/toml/test_custom_class3.cpp index c623f6f65..fda4a8e1d 100644 --- a/tests/toml/test_custom_class3.cpp +++ b/tests/toml/test_custom_class3.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_custom_class3 { diff --git a/tests/toml/test_custom_class4.cpp b/tests/toml/test_custom_class4.cpp index 89b8b6a24..22b86e578 100644 --- a/tests/toml/test_custom_class4.cpp +++ b/tests/toml/test_custom_class4.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_custom_class4 { diff --git a/tests/toml/test_default_values.cpp b/tests/toml/test_default_values.cpp index c68b8335f..d82724bc4 100644 --- a/tests/toml/test_default_values.cpp +++ b/tests/toml/test_default_values.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_default_values { diff --git a/tests/toml/test_deque.cpp b/tests/toml/test_deque.cpp index 8f6281881..b3929dd87 100644 --- a/tests/toml/test_deque.cpp +++ b/tests/toml/test_deque.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.toml; +import rfl; + namespace test_deque { diff --git a/tests/toml/test_enum.cpp b/tests/toml/test_enum.cpp index a556b5ed3..cea42ac51 100644 --- a/tests/toml/test_enum.cpp +++ b/tests/toml/test_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_enum { diff --git a/tests/toml/test_field_variant.cpp b/tests/toml/test_field_variant.cpp index a1bf430cc..09576af5d 100644 --- a/tests/toml/test_field_variant.cpp +++ b/tests/toml/test_field_variant.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_field_variant { diff --git a/tests/toml/test_flag_enum.cpp b/tests/toml/test_flag_enum.cpp index 6c8dd04b4..3654c2003 100644 --- a/tests/toml/test_flag_enum.cpp +++ b/tests/toml/test_flag_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_flag_enum { diff --git a/tests/toml/test_flag_enum_with_int.cpp b/tests/toml/test_flag_enum_with_int.cpp index b983d22f2..60f5fed7c 100644 --- a/tests/toml/test_flag_enum_with_int.cpp +++ b/tests/toml/test_flag_enum_with_int.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/toml/test_flatten.cpp b/tests/toml/test_flatten.cpp index 53f3df9fc..7aee5908d 100644 --- a/tests/toml/test_flatten.cpp +++ b/tests/toml/test_flatten.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_flatten { diff --git a/tests/toml/test_flatten_anonymous.cpp b/tests/toml/test_flatten_anonymous.cpp index f4040a63a..ca44a8592 100644 --- a/tests/toml/test_flatten_anonymous.cpp +++ b/tests/toml/test_flatten_anonymous.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/toml/test_forward_list.cpp b/tests/toml/test_forward_list.cpp index 6c9eba578..cc5bbef16 100644 --- a/tests/toml/test_forward_list.cpp +++ b/tests/toml/test_forward_list.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.toml; +import rfl; + namespace test_forward_list { diff --git a/tests/toml/test_literal.cpp b/tests/toml/test_literal.cpp index da59008d6..2dd8888db 100644 --- a/tests/toml/test_literal.cpp +++ b/tests/toml/test_literal.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_literal { diff --git a/tests/toml/test_literal_map.cpp b/tests/toml/test_literal_map.cpp index ee6c3f5a0..56d330308 100644 --- a/tests/toml/test_literal_map.cpp +++ b/tests/toml/test_literal_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_literal_map { diff --git a/tests/toml/test_map.cpp b/tests/toml/test_map.cpp index 7a42d8b4d..6bdd7cdd5 100644 --- a/tests/toml/test_map.cpp +++ b/tests/toml/test_map.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl.toml; +import rfl; + namespace test_map { diff --git a/tests/toml/test_map_with_key_validation.cpp b/tests/toml/test_map_with_key_validation.cpp index 205b5e73d..b07315987 100644 --- a/tests/toml/test_map_with_key_validation.cpp +++ b/tests/toml/test_map_with_key_validation.cpp @@ -1,8 +1,13 @@ #include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl.toml; +import rfl; + namespace test_map_with_key_validation { diff --git a/tests/toml/test_monster_example.cpp b/tests/toml/test_monster_example.cpp index 5d846df41..b39bec02b 100644 --- a/tests/toml/test_monster_example.cpp +++ b/tests/toml/test_monster_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_monster_example { diff --git a/tests/toml/test_readme_example.cpp b/tests/toml/test_readme_example.cpp index a9f00fbfe..752abd425 100644 --- a/tests/toml/test_readme_example.cpp +++ b/tests/toml/test_readme_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_readme_example { diff --git a/tests/toml/test_readme_example2.cpp b/tests/toml/test_readme_example2.cpp index b4407b483..b47dcc64f 100644 --- a/tests/toml/test_readme_example2.cpp +++ b/tests/toml/test_readme_example2.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_readme_example2 { diff --git a/tests/toml/test_ref.cpp b/tests/toml/test_ref.cpp index 7bec77f71..cf1461b44 100644 --- a/tests/toml/test_ref.cpp +++ b/tests/toml/test_ref.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.toml; +import rfl; + namespace test_ref { diff --git a/tests/toml/test_regression_bugs.cpp b/tests/toml/test_regression_bugs.cpp index 97b6065ba..297d025ee 100644 --- a/tests/toml/test_regression_bugs.cpp +++ b/tests/toml/test_regression_bugs.cpp @@ -2,9 +2,12 @@ #include #include +#include + +import rfl; +import rfl.toml; + -#include -#include // toml::Writer — at_path() may return invalid node, as_table()/as_array() // returns nullptr diff --git a/tests/toml/test_save_load.cpp b/tests/toml/test_save_load.cpp index 81dd09d5f..8ffa1e653 100644 --- a/tests/toml/test_save_load.cpp +++ b/tests/toml/test_save_load.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include +import rfl; +import rfl.toml; + namespace test_save_load { diff --git a/tests/toml/test_set.cpp b/tests/toml/test_set.cpp index 3814ac3da..c63ccffd9 100644 --- a/tests/toml/test_set.cpp +++ b/tests/toml/test_set.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.toml; +import rfl; + namespace test_set { diff --git a/tests/toml/test_size.cpp b/tests/toml/test_size.cpp index f045ab806..3b0205af3 100644 --- a/tests/toml/test_size.cpp +++ b/tests/toml/test_size.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_size { diff --git a/tests/toml/test_snake_case_to_camel_case.cpp b/tests/toml/test_snake_case_to_camel_case.cpp index 5aea8b53f..06f576cfd 100644 --- a/tests/toml/test_snake_case_to_camel_case.cpp +++ b/tests/toml/test_snake_case_to_camel_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.toml; namespace test_snake_case_to_camel_case { diff --git a/tests/toml/test_snake_case_to_pascal_case.cpp b/tests/toml/test_snake_case_to_pascal_case.cpp index 63e786b61..13b6d4881 100644 --- a/tests/toml/test_snake_case_to_pascal_case.cpp +++ b/tests/toml/test_snake_case_to_pascal_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.toml; namespace test_snake_case_to_pascal_case { diff --git a/tests/toml/test_string_map.cpp b/tests/toml/test_string_map.cpp index c7739a602..c67847782 100644 --- a/tests/toml/test_string_map.cpp +++ b/tests/toml/test_string_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_string_map { TEST(toml, test_string_map) { diff --git a/tests/toml/test_tagged_union.cpp b/tests/toml/test_tagged_union.cpp index 4b14c5432..bf0fca3d1 100644 --- a/tests/toml/test_tagged_union.cpp +++ b/tests/toml/test_tagged_union.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_tagged_union { diff --git a/tests/toml/test_timestamp.cpp b/tests/toml/test_timestamp.cpp index b8fb0c3fc..379003e48 100644 --- a/tests/toml/test_timestamp.cpp +++ b/tests/toml/test_timestamp.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + namespace test_timestamp { diff --git a/tests/toml/test_unique_ptr.cpp b/tests/toml/test_unique_ptr.cpp index f1ab2cad5..7d2d31f61 100644 --- a/tests/toml/test_unique_ptr.cpp +++ b/tests/toml/test_unique_ptr.cpp @@ -1,9 +1,13 @@ #include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.toml; +import rfl; + namespace test_unique_ptr { diff --git a/tests/toml/test_unique_ptr2.cpp b/tests/toml/test_unique_ptr2.cpp index 294e3b2af..6953e9d81 100644 --- a/tests/toml/test_unique_ptr2.cpp +++ b/tests/toml/test_unique_ptr2.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.toml; +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/toml/test_variant.cpp b/tests/toml/test_variant.cpp index 5812a5d5c..7d9afd408 100644 --- a/tests/toml/test_variant.cpp +++ b/tests/toml/test_variant.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.toml; +import rfl; + namespace test_variant { diff --git a/tests/toml/test_wstring.cpp b/tests/toml/test_wstring.cpp index 6dccf6901..933c031c9 100644 --- a/tests/toml/test_wstring.cpp +++ b/tests/toml/test_wstring.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.toml; +import rfl; + struct TestStruct { std::string theNormalString; diff --git a/tests/toml/write_and_read.hpp b/tests/toml/write_and_read.hpp index c7c53c840..6d2e98e83 100644 --- a/tests/toml/write_and_read.hpp +++ b/tests/toml/write_and_read.hpp @@ -2,8 +2,12 @@ #define WRITE_AND_READ_ #include +#include +#include + +import rfl.toml; + -#include template void write_and_read(const auto& _struct) { diff --git a/tests/ubjson/CMakeLists.txt b/tests/ubjson/CMakeLists.txt index ed5ffcac0..35a7b81f0 100644 --- a/tests/ubjson/CMakeLists.txt +++ b/tests/ubjson/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-ubjson-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-ubjson-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-ubjson-tests PRIVATE ) target_link_libraries(reflect-cpp-ubjson-tests PRIVATE reflectcpp_tests_crt) diff --git a/tests/ubjson/test_add_struct_name.cpp b/tests/ubjson/test_add_struct_name.cpp index 08faff5e3..b182a280f 100644 --- a/tests/ubjson/test_add_struct_name.cpp +++ b/tests/ubjson/test_add_struct_name.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.ubjson; namespace test_add_struct_name { diff --git a/tests/ubjson/test_array.cpp b/tests/ubjson/test_array.cpp index 5c6808868..6a9ba91fb 100644 --- a/tests/ubjson/test_array.cpp +++ b/tests/ubjson/test_array.cpp @@ -1,13 +1,16 @@ #include #include -#include #include // Make sure things still compile when // rfl.hpp is included after rfl/ubjson.hpp. -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.ubjson; + namespace test_array { diff --git a/tests/ubjson/test_box.cpp b/tests/ubjson/test_box.cpp index 13431adcc..8663b9313 100644 --- a/tests/ubjson/test_box.cpp +++ b/tests/ubjson/test_box.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.ubjson; +import rfl; + namespace test_box { diff --git a/tests/ubjson/test_bytestring.cpp b/tests/ubjson/test_bytestring.cpp index a0eb74bbd..cd52cc4b4 100644 --- a/tests/ubjson/test_bytestring.cpp +++ b/tests/ubjson/test_bytestring.cpp @@ -1,6 +1,10 @@ -#include #include "write_and_read.hpp" +#include + +import rfl.ubjson; +import rfl; + namespace test_bytestring { diff --git a/tests/ubjson/test_combined_processors.cpp b/tests/ubjson/test_combined_processors.cpp index 2ad0e5af8..ae4b5e034 100644 --- a/tests/ubjson/test_combined_processors.cpp +++ b/tests/ubjson/test_combined_processors.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.ubjson; namespace test_combined_processors { diff --git a/tests/ubjson/test_custom_class1.cpp b/tests/ubjson/test_custom_class1.cpp index b187e1f71..213eb6615 100644 --- a/tests/ubjson/test_custom_class1.cpp +++ b/tests/ubjson/test_custom_class1.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_custom_class1 { diff --git a/tests/ubjson/test_custom_class3.cpp b/tests/ubjson/test_custom_class3.cpp index 4dd84fe31..661350619 100644 --- a/tests/ubjson/test_custom_class3.cpp +++ b/tests/ubjson/test_custom_class3.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_custom_class3 { diff --git a/tests/ubjson/test_custom_class4.cpp b/tests/ubjson/test_custom_class4.cpp index e3aacdf1a..d005287ec 100644 --- a/tests/ubjson/test_custom_class4.cpp +++ b/tests/ubjson/test_custom_class4.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_custom_class4 { diff --git a/tests/ubjson/test_default_values.cpp b/tests/ubjson/test_default_values.cpp index 4d8899805..44b69f6fa 100644 --- a/tests/ubjson/test_default_values.cpp +++ b/tests/ubjson/test_default_values.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_default_values { diff --git a/tests/ubjson/test_deque.cpp b/tests/ubjson/test_deque.cpp index 00021f2e2..2d6f227cc 100644 --- a/tests/ubjson/test_deque.cpp +++ b/tests/ubjson/test_deque.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.ubjson; +import rfl; + namespace test_deque { diff --git a/tests/ubjson/test_enum.cpp b/tests/ubjson/test_enum.cpp index cdfda67fe..2d58eef69 100644 --- a/tests/ubjson/test_enum.cpp +++ b/tests/ubjson/test_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_enum { diff --git a/tests/ubjson/test_error_messages.cpp b/tests/ubjson/test_error_messages.cpp index 6d19f2567..b48b66a68 100644 --- a/tests/ubjson/test_error_messages.cpp +++ b/tests/ubjson/test_error_messages.cpp @@ -1,10 +1,11 @@ #include -#include -#include -#include #include #include +import rfl; +import rfl.json; +import rfl.ubjson; + namespace test_error_messages { diff --git a/tests/ubjson/test_extra_fields.cpp b/tests/ubjson/test_extra_fields.cpp index 04cc5b76e..a4725cf55 100644 --- a/tests/ubjson/test_extra_fields.cpp +++ b/tests/ubjson/test_extra_fields.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_extra_fields { diff --git a/tests/ubjson/test_field_variant.cpp b/tests/ubjson/test_field_variant.cpp index 041ec2eba..90f0e43d0 100644 --- a/tests/ubjson/test_field_variant.cpp +++ b/tests/ubjson/test_field_variant.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_field_variant { diff --git a/tests/ubjson/test_flag_enum.cpp b/tests/ubjson/test_flag_enum.cpp index 580979fca..4abacda5d 100644 --- a/tests/ubjson/test_flag_enum.cpp +++ b/tests/ubjson/test_flag_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_flag_enum { diff --git a/tests/ubjson/test_flag_enum_with_int.cpp b/tests/ubjson/test_flag_enum_with_int.cpp index 15da8931a..64cdc685f 100644 --- a/tests/ubjson/test_flag_enum_with_int.cpp +++ b/tests/ubjson/test_flag_enum_with_int.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/ubjson/test_flatten.cpp b/tests/ubjson/test_flatten.cpp index 75eb6ec93..a970c680f 100644 --- a/tests/ubjson/test_flatten.cpp +++ b/tests/ubjson/test_flatten.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_flatten { diff --git a/tests/ubjson/test_flatten_anonymous.cpp b/tests/ubjson/test_flatten_anonymous.cpp index 56e82cc25..b5e38d5b0 100644 --- a/tests/ubjson/test_flatten_anonymous.cpp +++ b/tests/ubjson/test_flatten_anonymous.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/ubjson/test_forward_list.cpp b/tests/ubjson/test_forward_list.cpp index 12282ffdf..40f8c5963 100644 --- a/tests/ubjson/test_forward_list.cpp +++ b/tests/ubjson/test_forward_list.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.ubjson; +import rfl; + namespace test_forward_list { diff --git a/tests/ubjson/test_literal.cpp b/tests/ubjson/test_literal.cpp index cb096741b..ddc2d02c6 100644 --- a/tests/ubjson/test_literal.cpp +++ b/tests/ubjson/test_literal.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_literal { diff --git a/tests/ubjson/test_literal_map.cpp b/tests/ubjson/test_literal_map.cpp index 27e4a609a..53cc7d3bb 100644 --- a/tests/ubjson/test_literal_map.cpp +++ b/tests/ubjson/test_literal_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_literal_map { diff --git a/tests/ubjson/test_map.cpp b/tests/ubjson/test_map.cpp index 309638bfe..ff68e3436 100644 --- a/tests/ubjson/test_map.cpp +++ b/tests/ubjson/test_map.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl.ubjson; +import rfl; + namespace test_map { diff --git a/tests/ubjson/test_map_with_key_validation.cpp b/tests/ubjson/test_map_with_key_validation.cpp index fc6a26353..00cb0f3b0 100644 --- a/tests/ubjson/test_map_with_key_validation.cpp +++ b/tests/ubjson/test_map_with_key_validation.cpp @@ -1,8 +1,13 @@ #include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl.ubjson; +import rfl; + namespace test_map_with_key_validation { diff --git a/tests/ubjson/test_monster_example.cpp b/tests/ubjson/test_monster_example.cpp index 0de32ead8..d87f75913 100644 --- a/tests/ubjson/test_monster_example.cpp +++ b/tests/ubjson/test_monster_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_monster_example { diff --git a/tests/ubjson/test_read_byte_containers.cpp b/tests/ubjson/test_read_byte_containers.cpp index ee78a3fe2..bdd5746b0 100644 --- a/tests/ubjson/test_read_byte_containers.cpp +++ b/tests/ubjson/test_read_byte_containers.cpp @@ -1,12 +1,17 @@ #include #include -#include #include +#include +#include +#include + +import rfl; +import rfl.ubjson; + // Make sure things still compile when // rfl.hpp is included after rfl/ubjson.hpp. -#include namespace test_read_byte_containers { diff --git a/tests/ubjson/test_readme_example.cpp b/tests/ubjson/test_readme_example.cpp index a64bfe954..f9cc8f779 100644 --- a/tests/ubjson/test_readme_example.cpp +++ b/tests/ubjson/test_readme_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_readme_example { diff --git a/tests/ubjson/test_readme_example2.cpp b/tests/ubjson/test_readme_example2.cpp index 0cf3bcb36..6139e5a62 100644 --- a/tests/ubjson/test_readme_example2.cpp +++ b/tests/ubjson/test_readme_example2.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_readme_example2 { diff --git a/tests/ubjson/test_ref.cpp b/tests/ubjson/test_ref.cpp index ca7a15c0a..36288ae5e 100644 --- a/tests/ubjson/test_ref.cpp +++ b/tests/ubjson/test_ref.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.ubjson; +import rfl; + namespace test_ref { diff --git a/tests/ubjson/test_save_load.cpp b/tests/ubjson/test_save_load.cpp index 28159abb4..05d3e45fc 100644 --- a/tests/ubjson/test_save_load.cpp +++ b/tests/ubjson/test_save_load.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include +import rfl; +import rfl.ubjson; + namespace test_save_load { diff --git a/tests/ubjson/test_set.cpp b/tests/ubjson/test_set.cpp index 8da87e05c..c90d545fe 100644 --- a/tests/ubjson/test_set.cpp +++ b/tests/ubjson/test_set.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.ubjson; +import rfl; + namespace test_set { diff --git a/tests/ubjson/test_size.cpp b/tests/ubjson/test_size.cpp index 67d1ad00d..1cb472cab 100644 --- a/tests/ubjson/test_size.cpp +++ b/tests/ubjson/test_size.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_size { diff --git a/tests/ubjson/test_snake_case_to_camel_case.cpp b/tests/ubjson/test_snake_case_to_camel_case.cpp index 58a4c923b..bd0df7858 100644 --- a/tests/ubjson/test_snake_case_to_camel_case.cpp +++ b/tests/ubjson/test_snake_case_to_camel_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.ubjson; namespace test_snake_case_to_camel_case { diff --git a/tests/ubjson/test_snake_case_to_pascal_case.cpp b/tests/ubjson/test_snake_case_to_pascal_case.cpp index 88142619f..a21053324 100644 --- a/tests/ubjson/test_snake_case_to_pascal_case.cpp +++ b/tests/ubjson/test_snake_case_to_pascal_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.ubjson; namespace test_snake_case_to_pascal_case { diff --git a/tests/ubjson/test_string_map.cpp b/tests/ubjson/test_string_map.cpp index 5803989a6..2b757a3a1 100644 --- a/tests/ubjson/test_string_map.cpp +++ b/tests/ubjson/test_string_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_string_map { TEST(ubjson, test_string_map) { diff --git a/tests/ubjson/test_tagged_union.cpp b/tests/ubjson/test_tagged_union.cpp index 654b5cd15..177a6a214 100644 --- a/tests/ubjson/test_tagged_union.cpp +++ b/tests/ubjson/test_tagged_union.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_tagged_union { diff --git a/tests/ubjson/test_tagged_union2.cpp b/tests/ubjson/test_tagged_union2.cpp index 906ee14e8..2556074f0 100644 --- a/tests/ubjson/test_tagged_union2.cpp +++ b/tests/ubjson/test_tagged_union2.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_tagged_union2 { diff --git a/tests/ubjson/test_timestamp.cpp b/tests/ubjson/test_timestamp.cpp index 26f3ad105..eaa35a6b3 100644 --- a/tests/ubjson/test_timestamp.cpp +++ b/tests/ubjson/test_timestamp.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_timestamp { diff --git a/tests/ubjson/test_unique_ptr.cpp b/tests/ubjson/test_unique_ptr.cpp index 04594545b..7098742ec 100644 --- a/tests/ubjson/test_unique_ptr.cpp +++ b/tests/ubjson/test_unique_ptr.cpp @@ -1,9 +1,13 @@ #include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.ubjson; +import rfl; + namespace test_unique_ptr { diff --git a/tests/ubjson/test_unique_ptr2.cpp b/tests/ubjson/test_unique_ptr2.cpp index fa9d48c71..aeb98469c 100644 --- a/tests/ubjson/test_unique_ptr2.cpp +++ b/tests/ubjson/test_unique_ptr2.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.ubjson; +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/ubjson/test_variant.cpp b/tests/ubjson/test_variant.cpp index 604ffbf02..c2227a4db 100644 --- a/tests/ubjson/test_variant.cpp +++ b/tests/ubjson/test_variant.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.ubjson; +import rfl; + namespace test_variant { diff --git a/tests/ubjson/test_vectorstring.cpp b/tests/ubjson/test_vectorstring.cpp index 4e1f6a367..2d800ad24 100644 --- a/tests/ubjson/test_vectorstring.cpp +++ b/tests/ubjson/test_vectorstring.cpp @@ -1,6 +1,8 @@ -#include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + namespace test_vectorstring { @@ -14,4 +16,4 @@ TEST(ubjson, test_vectorstring) { write_and_read(test); } -} // namespace test_vectorstring \ No newline at end of file +} // namespace test_vectorstring diff --git a/tests/ubjson/test_wstring.cpp b/tests/ubjson/test_wstring.cpp index 07bbe3fd0..77cab113f 100644 --- a/tests/ubjson/test_wstring.cpp +++ b/tests/ubjson/test_wstring.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.ubjson; +import rfl; + struct TestStruct { std::string theNormalString; diff --git a/tests/ubjson/write_and_read.hpp b/tests/ubjson/write_and_read.hpp index dd9aed63c..b5f4462f3 100644 --- a/tests/ubjson/write_and_read.hpp +++ b/tests/ubjson/write_and_read.hpp @@ -2,8 +2,11 @@ #define WRITE_AND_READ_ #include +#include + +import rfl.ubjson; + -#include template void write_and_read(const auto& _struct) { diff --git a/tests/xml/CMakeLists.txt b/tests/xml/CMakeLists.txt index 522c07156..07daacd7a 100644 --- a/tests/xml/CMakeLists.txt +++ b/tests/xml/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-xml-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-xml-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-xml-tests PRIVATE ) target_include_directories(reflect-cpp-xml-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") diff --git a/tests/xml/test_add_struct_name.cpp b/tests/xml/test_add_struct_name.cpp index 0f0819fac..96e9c36c9 100644 --- a/tests/xml/test_add_struct_name.cpp +++ b/tests/xml/test_add_struct_name.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.xml; namespace test_add_struct_name { diff --git a/tests/xml/test_array.cpp b/tests/xml/test_array.cpp index 8d5f6f1fb..5d8de57cc 100644 --- a/tests/xml/test_array.cpp +++ b/tests/xml/test_array.cpp @@ -1,13 +1,16 @@ #include #include -#include #include // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.xml; + namespace test_array { diff --git a/tests/xml/test_attribute_rename.cpp b/tests/xml/test_attribute_rename.cpp index 22be8e9a8..c6f80db2a 100644 --- a/tests/xml/test_attribute_rename.cpp +++ b/tests/xml/test_attribute_rename.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_attribute_rename { diff --git a/tests/xml/test_box.cpp b/tests/xml/test_box.cpp index 969b2d2f6..785af5bda 100644 --- a/tests/xml/test_box.cpp +++ b/tests/xml/test_box.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.xml; +import rfl; + namespace test_box { diff --git a/tests/xml/test_combined_processors.cpp b/tests/xml/test_combined_processors.cpp index 38022a385..26e398cad 100644 --- a/tests/xml/test_combined_processors.cpp +++ b/tests/xml/test_combined_processors.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.xml; namespace test_combined_processors { diff --git a/tests/xml/test_comment.cpp b/tests/xml/test_comment.cpp index 5416ad530..414a334a9 100644 --- a/tests/xml/test_comment.cpp +++ b/tests/xml/test_comment.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_comment { diff --git a/tests/xml/test_custom_class1.cpp b/tests/xml/test_custom_class1.cpp index a3b708875..bd110c12f 100644 --- a/tests/xml/test_custom_class1.cpp +++ b/tests/xml/test_custom_class1.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_custom_class1 { diff --git a/tests/xml/test_custom_class3.cpp b/tests/xml/test_custom_class3.cpp index 88c529699..a33a7f4e8 100644 --- a/tests/xml/test_custom_class3.cpp +++ b/tests/xml/test_custom_class3.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_custom_class3 { diff --git a/tests/xml/test_custom_class4.cpp b/tests/xml/test_custom_class4.cpp index 493b58c11..9c534ca13 100644 --- a/tests/xml/test_custom_class4.cpp +++ b/tests/xml/test_custom_class4.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_custom_class4 { diff --git a/tests/xml/test_default_if_missing.cpp b/tests/xml/test_default_if_missing.cpp index 36c3bbb9a..6d8f6503e 100644 --- a/tests/xml/test_default_if_missing.cpp +++ b/tests/xml/test_default_if_missing.cpp @@ -1,10 +1,12 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; +import rfl.json; + namespace test_default_if_missing { diff --git a/tests/xml/test_default_values.cpp b/tests/xml/test_default_values.cpp index 19e8da67e..c738b2203 100644 --- a/tests/xml/test_default_values.cpp +++ b/tests/xml/test_default_values.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_default_values { diff --git a/tests/xml/test_deque.cpp b/tests/xml/test_deque.cpp index 57876ed8b..c65b3b2a2 100644 --- a/tests/xml/test_deque.cpp +++ b/tests/xml/test_deque.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.xml; +import rfl; + namespace test_deque { diff --git a/tests/xml/test_enum.cpp b/tests/xml/test_enum.cpp index 662ecf676..d741cc0c4 100644 --- a/tests/xml/test_enum.cpp +++ b/tests/xml/test_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_enum { diff --git a/tests/xml/test_field_variant.cpp b/tests/xml/test_field_variant.cpp index c6d85a8cf..ca1d8112b 100644 --- a/tests/xml/test_field_variant.cpp +++ b/tests/xml/test_field_variant.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_field_variant { diff --git a/tests/xml/test_flag_enum.cpp b/tests/xml/test_flag_enum.cpp index 4bb39c8a3..d8d423f3b 100644 --- a/tests/xml/test_flag_enum.cpp +++ b/tests/xml/test_flag_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_flag_enum { diff --git a/tests/xml/test_flag_enum_with_int.cpp b/tests/xml/test_flag_enum_with_int.cpp index 410ecd5aa..7ae02731b 100644 --- a/tests/xml/test_flag_enum_with_int.cpp +++ b/tests/xml/test_flag_enum_with_int.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/xml/test_flatten.cpp b/tests/xml/test_flatten.cpp index a144acae8..e9aaf5365 100644 --- a/tests/xml/test_flatten.cpp +++ b/tests/xml/test_flatten.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_flatten { diff --git a/tests/xml/test_flatten_anonymous.cpp b/tests/xml/test_flatten_anonymous.cpp index 04bab2b2e..22f7beeeb 100644 --- a/tests/xml/test_flatten_anonymous.cpp +++ b/tests/xml/test_flatten_anonymous.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/xml/test_forward_list.cpp b/tests/xml/test_forward_list.cpp index e2294378e..6ac1ef67a 100644 --- a/tests/xml/test_forward_list.cpp +++ b/tests/xml/test_forward_list.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.xml; +import rfl; + namespace test_forward_list { diff --git a/tests/xml/test_generic.cpp b/tests/xml/test_generic.cpp index eac439bb7..3f5a28d47 100644 --- a/tests/xml/test_generic.cpp +++ b/tests/xml/test_generic.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_generic { diff --git a/tests/xml/test_literal.cpp b/tests/xml/test_literal.cpp index cf37158fb..eaeaa1394 100644 --- a/tests/xml/test_literal.cpp +++ b/tests/xml/test_literal.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_literal { diff --git a/tests/xml/test_literal_map.cpp b/tests/xml/test_literal_map.cpp index 170da0946..063183c3d 100644 --- a/tests/xml/test_literal_map.cpp +++ b/tests/xml/test_literal_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_literal_map { diff --git a/tests/xml/test_map.cpp b/tests/xml/test_map.cpp index de38548d4..0b153a39c 100644 --- a/tests/xml/test_map.cpp +++ b/tests/xml/test_map.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl.xml; +import rfl; + namespace test_map { diff --git a/tests/xml/test_map_with_key_validation.cpp b/tests/xml/test_map_with_key_validation.cpp index 646ecb033..a87c4445d 100644 --- a/tests/xml/test_map_with_key_validation.cpp +++ b/tests/xml/test_map_with_key_validation.cpp @@ -1,8 +1,13 @@ #include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl.xml; +import rfl; + namespace test_map_with_key_validation { diff --git a/tests/xml/test_monster_example.cpp b/tests/xml/test_monster_example.cpp index 910b76e52..0e351c522 100644 --- a/tests/xml/test_monster_example.cpp +++ b/tests/xml/test_monster_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_monster_example { diff --git a/tests/xml/test_readme_example.cpp b/tests/xml/test_readme_example.cpp index 8ef27abcd..7e24bb10a 100644 --- a/tests/xml/test_readme_example.cpp +++ b/tests/xml/test_readme_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_readme_example { diff --git a/tests/xml/test_readme_example2.cpp b/tests/xml/test_readme_example2.cpp index b16b7b6de..2856565ad 100644 --- a/tests/xml/test_readme_example2.cpp +++ b/tests/xml/test_readme_example2.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_readme_example2 { diff --git a/tests/xml/test_ref.cpp b/tests/xml/test_ref.cpp index 320ce0692..2ed9a03ea 100644 --- a/tests/xml/test_ref.cpp +++ b/tests/xml/test_ref.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.xml; +import rfl; + namespace test_ref { diff --git a/tests/xml/test_regression_bugs.cpp b/tests/xml/test_regression_bugs.cpp index aa089a422..9c2c72fd3 100644 --- a/tests/xml/test_regression_bugs.cpp +++ b/tests/xml/test_regression_bugs.cpp @@ -3,9 +3,10 @@ #include #include #include +import rfl; +import rfl.xml; + -#include -#include // xml::Reader::to_basic_type uses std::stoi for all integral types // File: include/rfl/xml/Reader.hpp:99-105 diff --git a/tests/xml/test_save_load.cpp b/tests/xml/test_save_load.cpp index c1a7ad566..dfbf3c897 100644 --- a/tests/xml/test_save_load.cpp +++ b/tests/xml/test_save_load.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include +import rfl; +import rfl.xml; + namespace test_save_load { diff --git a/tests/xml/test_set.cpp b/tests/xml/test_set.cpp index 49025c958..d6e8d7d66 100644 --- a/tests/xml/test_set.cpp +++ b/tests/xml/test_set.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.xml; +import rfl; + namespace test_set { diff --git a/tests/xml/test_size.cpp b/tests/xml/test_size.cpp index 30429a90e..2120e1788 100644 --- a/tests/xml/test_size.cpp +++ b/tests/xml/test_size.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_size { diff --git a/tests/xml/test_snake_case_to_camel_case.cpp b/tests/xml/test_snake_case_to_camel_case.cpp index 8fb5f6b80..b1f0641f2 100644 --- a/tests/xml/test_snake_case_to_camel_case.cpp +++ b/tests/xml/test_snake_case_to_camel_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.xml; namespace test_snake_case_to_camel_case { diff --git a/tests/xml/test_snake_case_to_pascal_case.cpp b/tests/xml/test_snake_case_to_pascal_case.cpp index 86cd8ef24..33791aaed 100644 --- a/tests/xml/test_snake_case_to_pascal_case.cpp +++ b/tests/xml/test_snake_case_to_pascal_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.xml; namespace test_snake_case_to_pascal_case { diff --git a/tests/xml/test_string_map.cpp b/tests/xml/test_string_map.cpp index 1cb5f2809..6a94c292e 100644 --- a/tests/xml/test_string_map.cpp +++ b/tests/xml/test_string_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_string_map { TEST(xml, test_string_map) { diff --git a/tests/xml/test_tagged_union.cpp b/tests/xml/test_tagged_union.cpp index 5c3c8348b..812164e6d 100644 --- a/tests/xml/test_tagged_union.cpp +++ b/tests/xml/test_tagged_union.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_tagged_union { diff --git a/tests/xml/test_timestamp.cpp b/tests/xml/test_timestamp.cpp index 2566596cf..186124996 100644 --- a/tests/xml/test_timestamp.cpp +++ b/tests/xml/test_timestamp.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + namespace test_timestamp { diff --git a/tests/xml/test_unique_ptr.cpp b/tests/xml/test_unique_ptr.cpp index 41e9d46f1..95ffde01b 100644 --- a/tests/xml/test_unique_ptr.cpp +++ b/tests/xml/test_unique_ptr.cpp @@ -1,9 +1,13 @@ #include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.xml; +import rfl; + namespace test_unique_ptr { diff --git a/tests/xml/test_unique_ptr2.cpp b/tests/xml/test_unique_ptr2.cpp index 2d209d4e6..0d0122491 100644 --- a/tests/xml/test_unique_ptr2.cpp +++ b/tests/xml/test_unique_ptr2.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.xml; +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/xml/test_variant.cpp b/tests/xml/test_variant.cpp index a61eedaac..309b4ea77 100644 --- a/tests/xml/test_variant.cpp +++ b/tests/xml/test_variant.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.xml; +import rfl; + namespace test_variant { diff --git a/tests/xml/test_wstring.cpp b/tests/xml/test_wstring.cpp index c855a9131..a80d6ed9b 100644 --- a/tests/xml/test_wstring.cpp +++ b/tests/xml/test_wstring.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; + struct TestStruct { std::string theNormalString; diff --git a/tests/xml/test_xml_content.cpp b/tests/xml/test_xml_content.cpp index c9ec3ef0b..3f0740e6d 100644 --- a/tests/xml/test_xml_content.cpp +++ b/tests/xml/test_xml_content.cpp @@ -1,9 +1,11 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; +import rfl.json; + namespace test_xml_content { diff --git a/tests/xml/test_xml_content2.cpp b/tests/xml/test_xml_content2.cpp index 0a4d74ab6..87fd0309a 100644 --- a/tests/xml/test_xml_content2.cpp +++ b/tests/xml/test_xml_content2.cpp @@ -1,9 +1,11 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl.xml; +import rfl; +import rfl.json; + namespace test_xml_content2 { diff --git a/tests/xml/write_and_read.hpp b/tests/xml/write_and_read.hpp index 3c6c4717a..7234c79a4 100644 --- a/tests/xml/write_and_read.hpp +++ b/tests/xml/write_and_read.hpp @@ -2,9 +2,12 @@ #define WRITE_AND_READ_ #include +#include + +import rfl; +import rfl.xml; + -#include -#include template void write_and_read(const auto& _struct) { diff --git a/tests/yaml/CMakeLists.txt b/tests/yaml/CMakeLists.txt index 3f32abd6f..ba4a30234 100644 --- a/tests/yaml/CMakeLists.txt +++ b/tests/yaml/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-yaml-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-yaml-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-yaml-tests PRIVATE ) target_include_directories(reflect-cpp-yaml-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") diff --git a/tests/yaml/test_add_struct_name.cpp b/tests/yaml/test_add_struct_name.cpp index 172532ab6..6299d77f2 100644 --- a/tests/yaml/test_add_struct_name.cpp +++ b/tests/yaml/test_add_struct_name.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.yaml; namespace test_add_struct_name { diff --git a/tests/yaml/test_array.cpp b/tests/yaml/test_array.cpp index 98318a10e..831485ee6 100644 --- a/tests/yaml/test_array.cpp +++ b/tests/yaml/test_array.cpp @@ -1,13 +1,16 @@ #include #include -#include #include // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.yaml; + namespace test_array { diff --git a/tests/yaml/test_box.cpp b/tests/yaml/test_box.cpp index fc04dceca..0e303c4f5 100644 --- a/tests/yaml/test_box.cpp +++ b/tests/yaml/test_box.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.yaml; +import rfl; + namespace test_box { diff --git a/tests/yaml/test_combined_processors.cpp b/tests/yaml/test_combined_processors.cpp index b66b13bfe..e2401d4fa 100644 --- a/tests/yaml/test_combined_processors.cpp +++ b/tests/yaml/test_combined_processors.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.yaml; namespace test_combined_processors { diff --git a/tests/yaml/test_comment.cpp b/tests/yaml/test_comment.cpp index f57ad7c62..4940c75d1 100644 --- a/tests/yaml/test_comment.cpp +++ b/tests/yaml/test_comment.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_comment { diff --git a/tests/yaml/test_comment_optional_array.cpp b/tests/yaml/test_comment_optional_array.cpp index 5b6d7e86d..98faf56bf 100644 --- a/tests/yaml/test_comment_optional_array.cpp +++ b/tests/yaml/test_comment_optional_array.cpp @@ -2,10 +2,11 @@ #include #include -#include -#include #include "write_and_read.hpp" +import rfl; +import rfl.yaml; + namespace test_comment_optional_array { diff --git a/tests/yaml/test_custom_class1.cpp b/tests/yaml/test_custom_class1.cpp index cd361a009..eb127b8a7 100644 --- a/tests/yaml/test_custom_class1.cpp +++ b/tests/yaml/test_custom_class1.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_custom_class1 { diff --git a/tests/yaml/test_custom_class3.cpp b/tests/yaml/test_custom_class3.cpp index d5e44b8ce..c54fd2c61 100644 --- a/tests/yaml/test_custom_class3.cpp +++ b/tests/yaml/test_custom_class3.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_custom_class3 { diff --git a/tests/yaml/test_custom_class4.cpp b/tests/yaml/test_custom_class4.cpp index e1209fb15..d4d792041 100644 --- a/tests/yaml/test_custom_class4.cpp +++ b/tests/yaml/test_custom_class4.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_custom_class4 { diff --git a/tests/yaml/test_default_values.cpp b/tests/yaml/test_default_values.cpp index 2653a4a54..36a052c19 100644 --- a/tests/yaml/test_default_values.cpp +++ b/tests/yaml/test_default_values.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_default_values { diff --git a/tests/yaml/test_deque.cpp b/tests/yaml/test_deque.cpp index c48d7af2b..2570653a9 100644 --- a/tests/yaml/test_deque.cpp +++ b/tests/yaml/test_deque.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.yaml; +import rfl; + namespace test_deque { diff --git a/tests/yaml/test_double.cpp b/tests/yaml/test_double.cpp index 7a6d5e262..3b39cd552 100644 --- a/tests/yaml/test_double.cpp +++ b/tests/yaml/test_double.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_double { diff --git a/tests/yaml/test_enum.cpp b/tests/yaml/test_enum.cpp index da149a90d..3b5afddf0 100644 --- a/tests/yaml/test_enum.cpp +++ b/tests/yaml/test_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_enum { diff --git a/tests/yaml/test_field_variant.cpp b/tests/yaml/test_field_variant.cpp index 8d23b0574..02e8a0446 100644 --- a/tests/yaml/test_field_variant.cpp +++ b/tests/yaml/test_field_variant.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_field_variant { diff --git a/tests/yaml/test_flag_enum.cpp b/tests/yaml/test_flag_enum.cpp index 91c80c372..4d2419964 100644 --- a/tests/yaml/test_flag_enum.cpp +++ b/tests/yaml/test_flag_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_flag_enum { diff --git a/tests/yaml/test_flag_enum_with_int.cpp b/tests/yaml/test_flag_enum_with_int.cpp index 44411b943..1c70bfb2c 100644 --- a/tests/yaml/test_flag_enum_with_int.cpp +++ b/tests/yaml/test_flag_enum_with_int.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/yaml/test_flatten.cpp b/tests/yaml/test_flatten.cpp index b5b5f6f27..2d482355d 100644 --- a/tests/yaml/test_flatten.cpp +++ b/tests/yaml/test_flatten.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_flatten { diff --git a/tests/yaml/test_flatten_anonymous.cpp b/tests/yaml/test_flatten_anonymous.cpp index 456ebb159..fd9814c61 100644 --- a/tests/yaml/test_flatten_anonymous.cpp +++ b/tests/yaml/test_flatten_anonymous.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/yaml/test_forward_list.cpp b/tests/yaml/test_forward_list.cpp index 60255cbbd..092a16f7f 100644 --- a/tests/yaml/test_forward_list.cpp +++ b/tests/yaml/test_forward_list.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.yaml; +import rfl; + namespace test_forward_list { diff --git a/tests/yaml/test_literal.cpp b/tests/yaml/test_literal.cpp index d9804cac1..5365a7042 100644 --- a/tests/yaml/test_literal.cpp +++ b/tests/yaml/test_literal.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_literal { diff --git a/tests/yaml/test_literal_map.cpp b/tests/yaml/test_literal_map.cpp index f811c833f..223652340 100644 --- a/tests/yaml/test_literal_map.cpp +++ b/tests/yaml/test_literal_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_literal_map { diff --git a/tests/yaml/test_map.cpp b/tests/yaml/test_map.cpp index 25319f42b..70645984b 100644 --- a/tests/yaml/test_map.cpp +++ b/tests/yaml/test_map.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl.yaml; +import rfl; + namespace test_map { diff --git a/tests/yaml/test_map_with_key_validation.cpp b/tests/yaml/test_map_with_key_validation.cpp index a154583f4..dab96e0ef 100644 --- a/tests/yaml/test_map_with_key_validation.cpp +++ b/tests/yaml/test_map_with_key_validation.cpp @@ -1,8 +1,13 @@ #include -#include #include #include "write_and_read.hpp" +#include +#include + +import rfl.yaml; +import rfl; + namespace test_map_with_key_validation { diff --git a/tests/yaml/test_monster_example.cpp b/tests/yaml/test_monster_example.cpp index f80f1a90e..964d794a4 100644 --- a/tests/yaml/test_monster_example.cpp +++ b/tests/yaml/test_monster_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_monster_example { diff --git a/tests/yaml/test_multiline.cpp b/tests/yaml/test_multiline.cpp index e6afa3fab..176ab3a15 100644 --- a/tests/yaml/test_multiline.cpp +++ b/tests/yaml/test_multiline.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + struct MultilineTestStruct { std::string normal_string; diff --git a/tests/yaml/test_read_null.cpp b/tests/yaml/test_read_null.cpp index b03fd1dbd..87d85b0e8 100644 --- a/tests/yaml/test_read_null.cpp +++ b/tests/yaml/test_read_null.cpp @@ -3,9 +3,12 @@ #include #include #include -#include #include #include +#include + +import rfl.yaml; + namespace test_read_null { diff --git a/tests/yaml/test_readme_example.cpp b/tests/yaml/test_readme_example.cpp index 35ec709b6..16cf91bf9 100644 --- a/tests/yaml/test_readme_example.cpp +++ b/tests/yaml/test_readme_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_readme_example { diff --git a/tests/yaml/test_readme_example2.cpp b/tests/yaml/test_readme_example2.cpp index 7a6d487e1..4b8918d17 100644 --- a/tests/yaml/test_readme_example2.cpp +++ b/tests/yaml/test_readme_example2.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_readme_example2 { diff --git a/tests/yaml/test_ref.cpp b/tests/yaml/test_ref.cpp index 558b23ee5..202298107 100644 --- a/tests/yaml/test_ref.cpp +++ b/tests/yaml/test_ref.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.yaml; +import rfl; + namespace test_ref { diff --git a/tests/yaml/test_save_load.cpp b/tests/yaml/test_save_load.cpp index c6e50420c..0002b3e75 100644 --- a/tests/yaml/test_save_load.cpp +++ b/tests/yaml/test_save_load.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include +import rfl; +import rfl.yaml; + namespace test_save_load { diff --git a/tests/yaml/test_set.cpp b/tests/yaml/test_set.cpp index e40dacc26..38029c6c5 100644 --- a/tests/yaml/test_set.cpp +++ b/tests/yaml/test_set.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.yaml; +import rfl; + namespace test_set { diff --git a/tests/yaml/test_size.cpp b/tests/yaml/test_size.cpp index 46efa2a39..b1dd5a4a0 100644 --- a/tests/yaml/test_size.cpp +++ b/tests/yaml/test_size.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_size { diff --git a/tests/yaml/test_skip.cpp b/tests/yaml/test_skip.cpp index d6af8a92a..0afa89912 100644 --- a/tests/yaml/test_skip.cpp +++ b/tests/yaml/test_skip.cpp @@ -1,8 +1,10 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; +import rfl.json; + namespace test_skip { diff --git a/tests/yaml/test_snake_case_to_camel_case.cpp b/tests/yaml/test_snake_case_to_camel_case.cpp index 04a369fc7..c8cd5c96e 100644 --- a/tests/yaml/test_snake_case_to_camel_case.cpp +++ b/tests/yaml/test_snake_case_to_camel_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.yaml; namespace test_snake_case_to_camel_case { diff --git a/tests/yaml/test_snake_case_to_pascal_case.cpp b/tests/yaml/test_snake_case_to_pascal_case.cpp index 6c412456e..24677e152 100644 --- a/tests/yaml/test_snake_case_to_pascal_case.cpp +++ b/tests/yaml/test_snake_case_to_pascal_case.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.yaml; namespace test_snake_case_to_pascal_case { diff --git a/tests/yaml/test_string_map.cpp b/tests/yaml/test_string_map.cpp index d8a602d8c..fd14cfaf3 100644 --- a/tests/yaml/test_string_map.cpp +++ b/tests/yaml/test_string_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_string_map { TEST(yaml, test_string_map) { diff --git a/tests/yaml/test_tagged_union.cpp b/tests/yaml/test_tagged_union.cpp index fd1760fbf..6e23d3dc3 100644 --- a/tests/yaml/test_tagged_union.cpp +++ b/tests/yaml/test_tagged_union.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_tagged_union { diff --git a/tests/yaml/test_timestamp.cpp b/tests/yaml/test_timestamp.cpp index 9ef4a4a1a..d231171d3 100644 --- a/tests/yaml/test_timestamp.cpp +++ b/tests/yaml/test_timestamp.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + namespace test_timestamp { diff --git a/tests/yaml/test_unique_ptr.cpp b/tests/yaml/test_unique_ptr.cpp index a04322879..078a1af6b 100644 --- a/tests/yaml/test_unique_ptr.cpp +++ b/tests/yaml/test_unique_ptr.cpp @@ -1,9 +1,13 @@ #include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.yaml; +import rfl; + namespace test_unique_ptr { diff --git a/tests/yaml/test_unique_ptr2.cpp b/tests/yaml/test_unique_ptr2.cpp index b2a43a5b1..fa32908c5 100644 --- a/tests/yaml/test_unique_ptr2.cpp +++ b/tests/yaml/test_unique_ptr2.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.yaml; +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/yaml/test_variant.cpp b/tests/yaml/test_variant.cpp index 53f831f5f..28848113b 100644 --- a/tests/yaml/test_variant.cpp +++ b/tests/yaml/test_variant.cpp @@ -1,6 +1,11 @@ -#include #include "write_and_read.hpp" +#include +#include + +import rfl.yaml; +import rfl; + namespace test_variant { diff --git a/tests/yaml/test_wstring.cpp b/tests/yaml/test_wstring.cpp index ea796bfc1..30c683322 100644 --- a/tests/yaml/test_wstring.cpp +++ b/tests/yaml/test_wstring.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.yaml; +import rfl; + struct TestStruct { std::string theNormalString; diff --git a/tests/yaml/write_and_read.hpp b/tests/yaml/write_and_read.hpp index bda619a4d..e481d9eae 100644 --- a/tests/yaml/write_and_read.hpp +++ b/tests/yaml/write_and_read.hpp @@ -2,8 +2,12 @@ #define WRITE_AND_READ_ #include +#include +#include + +import rfl.yaml; + -#include template void write_and_read(const auto& _struct, rfl::yaml::Writer::Flags _flags = rfl::yaml::Writer::Flags::no_flags) { diff --git a/tests/yas/CMakeLists.txt b/tests/yas/CMakeLists.txt index 63f10fadc..6a15d1c19 100644 --- a/tests/yas/CMakeLists.txt +++ b/tests/yas/CMakeLists.txt @@ -6,7 +6,7 @@ add_executable( reflect-cpp-yas-tests ${SOURCES} ) -target_precompile_headers(reflect-cpp-yas-tests PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-yas-tests PRIVATE ) target_link_libraries(reflect-cpp-yas-tests PRIVATE reflectcpp_tests_crt) diff --git a/tests/yas/test_add_struct_name.cpp b/tests/yas/test_add_struct_name.cpp index e96e996df..1d55fb544 100644 --- a/tests/yas/test_add_struct_name.cpp +++ b/tests/yas/test_add_struct_name.cpp @@ -2,6 +2,7 @@ #include #include "write_and_read.hpp" +import rfl.yas; namespace test_add_struct_name { diff --git a/tests/yas/test_array.cpp b/tests/yas/test_array.cpp index 3d2fc779a..2c94c1b0a 100644 --- a/tests/yas/test_array.cpp +++ b/tests/yas/test_array.cpp @@ -1,11 +1,14 @@ #include #include -#include #include -#include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.yas; + namespace test_array { diff --git a/tests/yas/test_box.cpp b/tests/yas/test_box.cpp index be52e9f67..3037065dd 100644 --- a/tests/yas/test_box.cpp +++ b/tests/yas/test_box.cpp @@ -1,10 +1,13 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.yas; + namespace test_box { diff --git a/tests/yas/test_bytestring.cpp b/tests/yas/test_bytestring.cpp index 07ee527a5..a04538211 100644 --- a/tests/yas/test_bytestring.cpp +++ b/tests/yas/test_bytestring.cpp @@ -1,6 +1,10 @@ -#include #include "write_and_read.hpp" +#include + +import rfl.yas; +import rfl; + namespace test_bytestring { diff --git a/tests/yas/test_custom_class1.cpp b/tests/yas/test_custom_class1.cpp index 99723a9a9..974465958 100644 --- a/tests/yas/test_custom_class1.cpp +++ b/tests/yas/test_custom_class1.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + namespace test_custom_class1 { diff --git a/tests/yas/test_custom_class3.cpp b/tests/yas/test_custom_class3.cpp index 074239f86..b833818a7 100644 --- a/tests/yas/test_custom_class3.cpp +++ b/tests/yas/test_custom_class3.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + namespace test_custom_class3 { diff --git a/tests/yas/test_custom_class4.cpp b/tests/yas/test_custom_class4.cpp index 60d595378..bbafa1d9c 100644 --- a/tests/yas/test_custom_class4.cpp +++ b/tests/yas/test_custom_class4.cpp @@ -1,8 +1,12 @@ #include -#include #include #include "write_and_read.hpp" +#include + +import rfl.yas; +import rfl; + namespace test_custom_class4 { diff --git a/tests/yas/test_default_values.cpp b/tests/yas/test_default_values.cpp index aebdf5b9d..468b9cac5 100644 --- a/tests/yas/test_default_values.cpp +++ b/tests/yas/test_default_values.cpp @@ -1,9 +1,11 @@ #include -#include #include #include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + namespace test_default_values { diff --git a/tests/yas/test_deque.cpp b/tests/yas/test_deque.cpp index f7603ad8f..0c1d0e7dd 100644 --- a/tests/yas/test_deque.cpp +++ b/tests/yas/test_deque.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.yas; +import rfl; + namespace test_deque { diff --git a/tests/yas/test_enum.cpp b/tests/yas/test_enum.cpp index 7e3072452..5492325ee 100644 --- a/tests/yas/test_enum.cpp +++ b/tests/yas/test_enum.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.yas; + namespace test_enum { diff --git a/tests/yas/test_field_variant.cpp b/tests/yas/test_field_variant.cpp index ebc40b10a..167d013b4 100644 --- a/tests/yas/test_field_variant.cpp +++ b/tests/yas/test_field_variant.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + namespace test_field_variant { diff --git a/tests/yas/test_field_variant_std.cpp b/tests/yas/test_field_variant_std.cpp index 97631f8a6..4ad1a063c 100644 --- a/tests/yas/test_field_variant_std.cpp +++ b/tests/yas/test_field_variant_std.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.yas; +import rfl; + namespace test_field_variant_std { diff --git a/tests/yas/test_flag_enum.cpp b/tests/yas/test_flag_enum.cpp index 2bb5e3760..dff771d37 100644 --- a/tests/yas/test_flag_enum.cpp +++ b/tests/yas/test_flag_enum.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + namespace test_flag_enum { diff --git a/tests/yas/test_flag_enum_with_int.cpp b/tests/yas/test_flag_enum_with_int.cpp index e1abc18c4..fc06db3f4 100644 --- a/tests/yas/test_flag_enum_with_int.cpp +++ b/tests/yas/test_flag_enum_with_int.cpp @@ -1,7 +1,9 @@ #include -#include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + namespace test_flag_enum_with_int { diff --git a/tests/yas/test_flatten.cpp b/tests/yas/test_flatten.cpp index 050979a97..5aaa2dda8 100644 --- a/tests/yas/test_flatten.cpp +++ b/tests/yas/test_flatten.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + namespace test_flatten { diff --git a/tests/yas/test_flatten_anonymous.cpp b/tests/yas/test_flatten_anonymous.cpp index 209f3491d..dd40f99ab 100644 --- a/tests/yas/test_flatten_anonymous.cpp +++ b/tests/yas/test_flatten_anonymous.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + namespace test_flatten_anonymous { diff --git a/tests/yas/test_forward_list.cpp b/tests/yas/test_forward_list.cpp index 300585ff1..a0e680318 100644 --- a/tests/yas/test_forward_list.cpp +++ b/tests/yas/test_forward_list.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.yas; +import rfl; + namespace test_forward_list { diff --git a/tests/yas/test_generic.cpp b/tests/yas/test_generic.cpp index 738cc8331..f32eac1b5 100644 --- a/tests/yas/test_generic.cpp +++ b/tests/yas/test_generic.cpp @@ -1,8 +1,9 @@ -#include -#include #include #include "write_and_read.hpp" +import rfl; +import rfl.yas; + namespace test_generic { diff --git a/tests/yas/test_literal.cpp b/tests/yas/test_literal.cpp index f3a0f137e..76a512e48 100644 --- a/tests/yas/test_literal.cpp +++ b/tests/yas/test_literal.cpp @@ -1,9 +1,11 @@ #include -#include -#include #include #include "write_and_read.hpp" +import rfl.yas; +import rfl; +import rfl.json; + namespace test_literal { diff --git a/tests/yas/test_literal_map.cpp b/tests/yas/test_literal_map.cpp index 88f456bc5..9978b6ccf 100644 --- a/tests/yas/test_literal_map.cpp +++ b/tests/yas/test_literal_map.cpp @@ -1,9 +1,11 @@ #include #include -#include #include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + namespace test_literal_map { diff --git a/tests/yas/test_map.cpp b/tests/yas/test_map.cpp index 5ab127b2d..3fd9d2f93 100644 --- a/tests/yas/test_map.cpp +++ b/tests/yas/test_map.cpp @@ -1,11 +1,15 @@ #include #include -#include -#include #include #include #include "write_and_read.hpp" +#include +#include + +import rfl; +import rfl.yas; + namespace test_map { diff --git a/tests/yas/test_map2.cpp b/tests/yas/test_map2.cpp index 0a64e7f93..d1d7010a7 100644 --- a/tests/yas/test_map2.cpp +++ b/tests/yas/test_map2.cpp @@ -1,9 +1,13 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl.yas; +import rfl; +import rfl.json; + namespace test_map2 { diff --git a/tests/yas/test_monster_example.cpp b/tests/yas/test_monster_example.cpp index da129f2a7..66bed74a8 100644 --- a/tests/yas/test_monster_example.cpp +++ b/tests/yas/test_monster_example.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + namespace test_monster_example { diff --git a/tests/yas/test_optional_fields.cpp b/tests/yas/test_optional_fields.cpp index 63f6ac13c..d51a327da 100644 --- a/tests/yas/test_optional_fields.cpp +++ b/tests/yas/test_optional_fields.cpp @@ -1,9 +1,12 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.yas; + namespace test_optional_fields { diff --git a/tests/yas/test_optionals_in_vectors.cpp b/tests/yas/test_optionals_in_vectors.cpp index 5a32ce1ca..39e49fd75 100644 --- a/tests/yas/test_optionals_in_vectors.cpp +++ b/tests/yas/test_optionals_in_vectors.cpp @@ -1,9 +1,13 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.yas; +import rfl; +import rfl.json; + namespace test_optionals_in_vectors { diff --git a/tests/yas/test_person.cpp b/tests/yas/test_person.cpp index 600ed688a..3a833ee3f 100644 --- a/tests/yas/test_person.cpp +++ b/tests/yas/test_person.cpp @@ -1,11 +1,12 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.yas; + namespace test_person { diff --git a/tests/yas/test_readme_example.cpp b/tests/yas/test_readme_example.cpp index f37c7a64d..ab452f446 100644 --- a/tests/yas/test_readme_example.cpp +++ b/tests/yas/test_readme_example.cpp @@ -1,9 +1,10 @@ -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.yas; + namespace test_readme_example { diff --git a/tests/yas/test_readme_example2.cpp b/tests/yas/test_readme_example2.cpp index dee13a10a..7a6430812 100644 --- a/tests/yas/test_readme_example2.cpp +++ b/tests/yas/test_readme_example2.cpp @@ -1,7 +1,9 @@ -#include #include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + namespace test_readme_example2 { diff --git a/tests/yas/test_readme_example3.cpp b/tests/yas/test_readme_example3.cpp index 12d668373..f622249b0 100644 --- a/tests/yas/test_readme_example3.cpp +++ b/tests/yas/test_readme_example3.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + namespace test_readme_example3 { diff --git a/tests/yas/test_ref.cpp b/tests/yas/test_ref.cpp index 4835530fa..a8ff4a2de 100644 --- a/tests/yas/test_ref.cpp +++ b/tests/yas/test_ref.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.yas; +import rfl; + namespace test_ref { diff --git a/tests/yas/test_rfl_tuple.cpp b/tests/yas/test_rfl_tuple.cpp index 1e325e6d0..592cf6cc2 100644 --- a/tests/yas/test_rfl_tuple.cpp +++ b/tests/yas/test_rfl_tuple.cpp @@ -1,10 +1,14 @@ #include -#include -#include #include #include "write_and_read.hpp" +#include + +import rfl.yas; +import rfl; +import rfl.json; + namespace test_rfl_tuple { diff --git a/tests/yas/test_rfl_variant.cpp b/tests/yas/test_rfl_variant.cpp index a341022de..e8ff600cb 100644 --- a/tests/yas/test_rfl_variant.cpp +++ b/tests/yas/test_rfl_variant.cpp @@ -1,7 +1,11 @@ #include -#include #include "write_and_read.hpp" +#include + +import rfl.yas; +import rfl; + namespace test_variant { diff --git a/tests/yas/test_save_load.cpp b/tests/yas/test_save_load.cpp index 8c26cc6be..d3029f470 100644 --- a/tests/yas/test_save_load.cpp +++ b/tests/yas/test_save_load.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.yas; + namespace test_save_load { struct Person { diff --git a/tests/yas/test_set.cpp b/tests/yas/test_set.cpp index 202c5d19e..bc49df85e 100644 --- a/tests/yas/test_set.cpp +++ b/tests/yas/test_set.cpp @@ -1,7 +1,13 @@ -#include #include #include "write_and_read.hpp" +#include +#include +#include + +import rfl.yas; +import rfl; + namespace test_set { diff --git a/tests/yas/test_shared_ptr.cpp b/tests/yas/test_shared_ptr.cpp index 72fdaf4b0..5d0966a79 100644 --- a/tests/yas/test_shared_ptr.cpp +++ b/tests/yas/test_shared_ptr.cpp @@ -1,10 +1,14 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.yas; +import rfl; +import rfl.json; + namespace test_shared_ptr { diff --git a/tests/yas/test_size.cpp b/tests/yas/test_size.cpp index 8ef4c40d8..7334169c6 100644 --- a/tests/yas/test_size.cpp +++ b/tests/yas/test_size.cpp @@ -1,8 +1,10 @@ -#include #include #include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + namespace test_size { diff --git a/tests/yas/test_string_map.cpp b/tests/yas/test_string_map.cpp index e2ef2d518..d76ac9797 100644 --- a/tests/yas/test_string_map.cpp +++ b/tests/yas/test_string_map.cpp @@ -1,10 +1,12 @@ #include #include -#include -#include #include #include "write_and_read.hpp" +import rfl.yas; +import rfl; +import rfl.json; + namespace test_string_map { diff --git a/tests/yas/test_tagged_union.cpp b/tests/yas/test_tagged_union.cpp index 43e55b39e..35fbf82b3 100644 --- a/tests/yas/test_tagged_union.cpp +++ b/tests/yas/test_tagged_union.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.yas; + namespace test_tagged_union { diff --git a/tests/yas/test_timestamp.cpp b/tests/yas/test_timestamp.cpp index 8a594f93c..b57dfe4a2 100644 --- a/tests/yas/test_timestamp.cpp +++ b/tests/yas/test_timestamp.cpp @@ -1,10 +1,11 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.yas; + namespace test_timestamp { diff --git a/tests/yas/test_tuple.cpp b/tests/yas/test_tuple.cpp index e95efb98f..a87e3305d 100644 --- a/tests/yas/test_tuple.cpp +++ b/tests/yas/test_tuple.cpp @@ -1,11 +1,12 @@ #include -#include -#include #include #include #include #include "write_and_read.hpp" +import rfl; +import rfl.yas; + namespace test_tuple { diff --git a/tests/yas/test_unique_ptr.cpp b/tests/yas/test_unique_ptr.cpp index f047a34d5..8a3a35c16 100644 --- a/tests/yas/test_unique_ptr.cpp +++ b/tests/yas/test_unique_ptr.cpp @@ -1,11 +1,14 @@ #include #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.yas; + namespace test_unique_ptr { diff --git a/tests/yas/test_unique_ptr2.cpp b/tests/yas/test_unique_ptr2.cpp index 70ace8845..b0ae476a1 100644 --- a/tests/yas/test_unique_ptr2.cpp +++ b/tests/yas/test_unique_ptr2.cpp @@ -1,7 +1,12 @@ #include -#include #include "write_and_read.hpp" +#include +#include + +import rfl.yas; +import rfl; + namespace test_unique_ptr2 { diff --git a/tests/yas/test_variant.cpp b/tests/yas/test_variant.cpp index 31f96dabe..b633aadbe 100644 --- a/tests/yas/test_variant.cpp +++ b/tests/yas/test_variant.cpp @@ -1,10 +1,13 @@ #include -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl; +import rfl.yas; + namespace test_variant { diff --git a/tests/yas/test_variants_in_vectors.cpp b/tests/yas/test_variants_in_vectors.cpp index 0ef491948..4d8c2a9eb 100644 --- a/tests/yas/test_variants_in_vectors.cpp +++ b/tests/yas/test_variants_in_vectors.cpp @@ -1,9 +1,13 @@ -#include -#include #include #include #include "write_and_read.hpp" +#include + +import rfl.yas; +import rfl; +import rfl.json; + namespace test_variants_in_vectors { diff --git a/tests/yas/test_wstring.cpp b/tests/yas/test_wstring.cpp index 128123cc2..a2b67ed77 100644 --- a/tests/yas/test_wstring.cpp +++ b/tests/yas/test_wstring.cpp @@ -1,8 +1,10 @@ #include -#include #include #include "write_and_read.hpp" +import rfl.yas; +import rfl; + struct TestStruct { std::string theNormalString; diff --git a/tests/yas/write_and_read.hpp b/tests/yas/write_and_read.hpp index db8e4a080..981dd7082 100644 --- a/tests/yas/write_and_read.hpp +++ b/tests/yas/write_and_read.hpp @@ -2,9 +2,12 @@ #define WRITE_AND_READ_ #include +#include + +import rfl.json; +import rfl.yas; + -#include -#include template void write_and_read(const auto& _struct) { From 32e93c6edf6b012208e6a1dc99e1ecaba41843c5 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Sat, 17 Oct 2026 18:34:24 +0800 Subject: [PATCH 08/18] Fix module boundaries and preserve header compatibility Generate shared test adapters for header and module builds, encapsulate CTRE and yyjson implementation details, and require Clang 19 for modules while retaining PCH. Add a local Linux CI runner and reproducible Clang 19-22 PCH checks. Verified JSON/CLI module tests on Clang 19-22 with PCH enabled (341 passed, one locale skip per version), GCC 16 modules, and older GCC header builds. --- .github/workflows/linux.yaml | 37 ++++- CMakeLists.txt | 61 +++++-- include/rfl/PatternValidator.hpp | 11 +- include/rfl/cli/Reader.hpp | 4 +- include/rfl/internal/ctre_std.hpp | 22 +++ include/rfl/internal/field_index_from_ptm.hpp | 2 +- include/rfl/internal/get_fake_object.hpp | 1 + include/rfl/internal/make_tag.hpp | 2 +- include/rfl/internal/num_fields.hpp | 2 + .../internal/variant/is_alternative_type.hpp | 2 +- .../internal/variant/is_convertible_to.hpp | 2 +- include/rfl/json/Reader.hpp | 48 +++--- include/rfl/json/Writer.hpp | 24 ++- include/rfl/json/read.hpp | 12 +- include/rfl/json/yyjson_helpers.hpp | 83 ++++++++++ include/rfl/parsing/is_empty.hpp | 2 +- include/rfl/parsing/make_type_name.hpp | 2 +- modules/rfl.ctre.cppm | 20 +++ scripts/check_pch_modules.py | 90 +++++++++++ scripts/ci/Containerfile | 29 ++++ scripts/ci/README.md | 111 +++++++++++++ scripts/ci_matrix.py | 152 ++++++++++++++++++ src/reflectcpp_yyjson_helpers.cpp | 125 ++++++++++++++ tests/CMakeLists.txt | 19 +++ tests/avro/test_add_struct_name.cpp | 2 +- tests/avro/test_array.cpp | 7 +- tests/avro/test_box.cpp | 7 +- tests/avro/test_bytestring.cpp | 7 +- tests/avro/test_combined_processors.cpp | 2 +- tests/avro/test_custom_class1.cpp | 4 +- tests/avro/test_custom_class3.cpp | 4 +- tests/avro/test_custom_class4.cpp | 4 +- tests/avro/test_default_values.cpp | 4 +- tests/avro/test_deque.cpp | 7 +- tests/avro/test_enum.cpp | 6 +- tests/avro/test_field_variant.cpp | 4 +- tests/avro/test_field_variant_std.cpp | 7 +- tests/avro/test_flag_enum.cpp | 4 +- tests/avro/test_flag_enum_with_int.cpp | 4 +- tests/avro/test_flatten.cpp | 4 +- tests/avro/test_flatten_anonymous.cpp | 4 +- tests/avro/test_float_and_int.cpp | 2 +- tests/avro/test_forward_list.cpp | 7 +- tests/avro/test_literal.cpp | 6 +- tests/avro/test_literal_map.cpp | 4 +- tests/avro/test_map.cpp | 9 +- tests/avro/test_map2.cpp | 9 +- tests/avro/test_monster_example.cpp | 4 +- tests/avro/test_optional_fields.cpp | 9 +- tests/avro/test_readme_example.cpp | 4 +- tests/avro/test_readme_example2.cpp | 4 +- tests/avro/test_readme_example3.cpp | 4 +- tests/avro/test_ref.cpp | 7 +- tests/avro/test_regression_bugs.cpp | 4 +- tests/avro/test_rfl_tuple.cpp | 9 +- tests/avro/test_rfl_variant.cpp | 7 +- tests/avro/test_save_load.cpp | 4 +- tests/avro/test_set.cpp | 7 +- tests/avro/test_shared_ptr.cpp | 9 +- tests/avro/test_size.cpp | 4 +- tests/avro/test_snake_case_to_camel_case.cpp | 2 +- tests/avro/test_snake_case_to_pascal_case.cpp | 2 +- tests/avro/test_string_map.cpp | 6 +- tests/avro/test_tagged_union.cpp | 4 +- tests/avro/test_timestamp.cpp | 4 +- tests/avro/test_tuple.cpp | 9 +- tests/avro/test_tutorial_example.cpp | 4 +- ...test_tutorial_example_automated_schema.cpp | 4 +- tests/avro/test_unique_ptr.cpp | 9 +- tests/avro/test_unique_ptr2.cpp | 7 +- tests/avro/test_variant.cpp | 7 +- tests/avro/test_wstring.cpp | 4 +- tests/avro/write_and_read.hpp | 4 +- .../test_add_struct_name.cpp | 2 +- tests/boost_serialization/test_array.cpp | 7 +- tests/boost_serialization/test_box.cpp | 7 +- .../test_combined_processors.cpp | 2 +- .../test_custom_class1.cpp | 4 +- .../test_custom_class3.cpp | 4 +- .../test_custom_class4.cpp | 4 +- .../test_default_values.cpp | 4 +- tests/boost_serialization/test_deque.cpp | 7 +- tests/boost_serialization/test_enum.cpp | 4 +- .../test_field_variant.cpp | 4 +- tests/boost_serialization/test_flag_enum.cpp | 4 +- .../test_flag_enum_with_int.cpp | 4 +- tests/boost_serialization/test_flatten.cpp | 4 +- .../test_flatten_anonymous.cpp | 4 +- .../boost_serialization/test_forward_list.cpp | 7 +- tests/boost_serialization/test_generic.cpp | 4 +- tests/boost_serialization/test_literal.cpp | 4 +- .../boost_serialization/test_literal_map.cpp | 4 +- tests/boost_serialization/test_map.cpp | 7 +- .../test_map_with_key_validation.cpp | 7 +- .../test_monster_example.cpp | 4 +- .../test_readme_example.cpp | 4 +- .../test_readme_example2.cpp | 4 +- tests/boost_serialization/test_ref.cpp | 7 +- tests/boost_serialization/test_save_load.cpp | 4 +- tests/boost_serialization/test_set.cpp | 7 +- tests/boost_serialization/test_size.cpp | 4 +- .../test_snake_case_to_camel_case.cpp | 2 +- .../test_snake_case_to_pascal_case.cpp | 2 +- tests/boost_serialization/test_string_map.cpp | 4 +- .../boost_serialization/test_tagged_union.cpp | 4 +- tests/boost_serialization/test_timestamp.cpp | 4 +- tests/boost_serialization/test_unique_ptr.cpp | 7 +- .../boost_serialization/test_unique_ptr2.cpp | 7 +- tests/boost_serialization/test_variant.cpp | 7 +- tests/boost_serialization/write_and_read.hpp | 4 +- tests/bson/test_add_struct_name.cpp | 2 +- tests/bson/test_array.cpp | 7 +- tests/bson/test_box.cpp | 7 +- tests/bson/test_bytestring.cpp | 7 +- tests/bson/test_combined_processors.cpp | 2 +- tests/bson/test_custom_class1.cpp | 4 +- tests/bson/test_custom_class3.cpp | 4 +- tests/bson/test_custom_class4.cpp | 4 +- tests/bson/test_default_values.cpp | 4 +- tests/bson/test_deque.cpp | 7 +- tests/bson/test_enum.cpp | 4 +- tests/bson/test_field_variant.cpp | 4 +- tests/bson/test_flag_enum.cpp | 4 +- tests/bson/test_flag_enum_with_int.cpp | 4 +- tests/bson/test_flatten.cpp | 4 +- tests/bson/test_flatten_anonymous.cpp | 4 +- tests/bson/test_forward_list.cpp | 7 +- tests/bson/test_literal.cpp | 4 +- tests/bson/test_literal_map.cpp | 4 +- tests/bson/test_map.cpp | 7 +- tests/bson/test_map_with_key_validation.cpp | 7 +- tests/bson/test_monster_example.cpp | 4 +- tests/bson/test_oid.cpp | 7 +- tests/bson/test_readme_example.cpp | 4 +- tests/bson/test_readme_example2.cpp | 4 +- tests/bson/test_ref.cpp | 7 +- tests/bson/test_regression_bugs.cpp | 4 +- tests/bson/test_save_load.cpp | 4 +- tests/bson/test_set.cpp | 7 +- tests/bson/test_size.cpp | 4 +- tests/bson/test_snake_case_to_camel_case.cpp | 2 +- tests/bson/test_snake_case_to_pascal_case.cpp | 2 +- tests/bson/test_string_map.cpp | 4 +- tests/bson/test_tagged_union.cpp | 4 +- tests/bson/test_timestamp.cpp | 4 +- tests/bson/test_unique_ptr.cpp | 7 +- tests/bson/test_unique_ptr2.cpp | 7 +- tests/bson/test_variant.cpp | 7 +- tests/bson/test_vectorstring.cpp | 4 +- tests/bson/test_wstring.cpp | 4 +- tests/bson/write_and_read.hpp | 2 +- .../capnproto_read_istream_schema.cpp | 4 +- tests/capnproto/test_add_struct_name.cpp | 2 +- tests/capnproto/test_array.cpp | 7 +- tests/capnproto/test_box.cpp | 7 +- tests/capnproto/test_bytestring.cpp | 7 +- tests/capnproto/test_custom_class1.cpp | 4 +- tests/capnproto/test_custom_class3.cpp | 4 +- tests/capnproto/test_custom_class4.cpp | 7 +- tests/capnproto/test_default_values.cpp | 4 +- tests/capnproto/test_deque.cpp | 7 +- tests/capnproto/test_enum.cpp | 6 +- tests/capnproto/test_field_variant.cpp | 4 +- tests/capnproto/test_field_variant_std.cpp | 7 +- tests/capnproto/test_flag_enum.cpp | 4 +- tests/capnproto/test_flag_enum_with_int.cpp | 4 +- tests/capnproto/test_flatten.cpp | 4 +- tests/capnproto/test_flatten_anonymous.cpp | 4 +- tests/capnproto/test_forward_list.cpp | 7 +- tests/capnproto/test_literal.cpp | 6 +- tests/capnproto/test_literal_map.cpp | 4 +- tests/capnproto/test_map.cpp | 9 +- tests/capnproto/test_map2.cpp | 9 +- tests/capnproto/test_map_value_types.cpp | 7 +- tests/capnproto/test_monster_example.cpp | 4 +- tests/capnproto/test_optional_fields.cpp | 9 +- tests/capnproto/test_optionals_in_vectors.cpp | 9 +- tests/capnproto/test_person.cpp | 4 +- tests/capnproto/test_readme_example.cpp | 4 +- tests/capnproto/test_readme_example2.cpp | 4 +- tests/capnproto/test_readme_example3.cpp | 4 +- tests/capnproto/test_ref.cpp | 7 +- tests/capnproto/test_rfl_tuple.cpp | 9 +- tests/capnproto/test_rfl_variant.cpp | 7 +- tests/capnproto/test_save_load.cpp | 4 +- tests/capnproto/test_set.cpp | 7 +- tests/capnproto/test_shared_ptr.cpp | 9 +- tests/capnproto/test_size.cpp | 4 +- tests/capnproto/test_string_map.cpp | 6 +- tests/capnproto/test_tagged_union.cpp | 4 +- tests/capnproto/test_timestamp.cpp | 4 +- tests/capnproto/test_tuple.cpp | 9 +- tests/capnproto/test_tutorial_example.cpp | 4 +- tests/capnproto/test_uint64.cpp | 4 +- tests/capnproto/test_unique_ptr.cpp | 9 +- tests/capnproto/test_unique_ptr2.cpp | 7 +- tests/capnproto/test_variant.cpp | 7 +- tests/capnproto/test_variants_in_vectors.cpp | 9 +- tests/capnproto/test_wstring.cpp | 4 +- tests/capnproto/write_and_read.hpp | 2 +- tests/cbor/test_add_struct_name.cpp | 2 +- tests/cbor/test_array.cpp | 7 +- tests/cbor/test_box.cpp | 7 +- tests/cbor/test_bytestring.cpp | 7 +- tests/cbor/test_combined_processors.cpp | 2 +- tests/cbor/test_custom_class1.cpp | 4 +- tests/cbor/test_custom_class3.cpp | 4 +- tests/cbor/test_custom_class4.cpp | 4 +- tests/cbor/test_default_values.cpp | 4 +- tests/cbor/test_deque.cpp | 7 +- tests/cbor/test_enum.cpp | 4 +- tests/cbor/test_error_messages.cpp | 6 +- tests/cbor/test_extra_fields.cpp | 4 +- tests/cbor/test_field_variant.cpp | 4 +- tests/cbor/test_flag_enum.cpp | 4 +- tests/cbor/test_flag_enum_with_int.cpp | 4 +- tests/cbor/test_flatten.cpp | 4 +- tests/cbor/test_flatten_anonymous.cpp | 4 +- tests/cbor/test_forward_list.cpp | 7 +- tests/cbor/test_integers.cpp | 2 +- tests/cbor/test_literal.cpp | 4 +- tests/cbor/test_literal_map.cpp | 4 +- tests/cbor/test_map.cpp | 7 +- tests/cbor/test_map_with_key_validation.cpp | 7 +- tests/cbor/test_monster_example.cpp | 4 +- tests/cbor/test_no_optionals.cpp | 7 +- tests/cbor/test_optional_fields.cpp | 7 +- tests/cbor/test_read_byte_containers.cpp | 4 +- tests/cbor/test_readme_example.cpp | 4 +- tests/cbor/test_readme_example2.cpp | 4 +- tests/cbor/test_ref.cpp | 7 +- tests/cbor/test_save_load.cpp | 4 +- tests/cbor/test_set.cpp | 7 +- tests/cbor/test_size.cpp | 4 +- tests/cbor/test_snake_case_to_camel_case.cpp | 2 +- tests/cbor/test_snake_case_to_pascal_case.cpp | 2 +- tests/cbor/test_string_map.cpp | 4 +- tests/cbor/test_tagged_union.cpp | 4 +- tests/cbor/test_tagged_union2.cpp | 4 +- tests/cbor/test_timestamp.cpp | 4 +- tests/cbor/test_unique_ptr.cpp | 7 +- tests/cbor/test_unique_ptr2.cpp | 7 +- tests/cbor/test_variant.cpp | 7 +- tests/cbor/test_variant_auto_tagging.cpp | 7 +- tests/cbor/test_vectorstring.cpp | 4 +- tests/cbor/test_wstring.cpp | 4 +- tests/cbor/write_and_read.hpp | 2 +- tests/cereal/test_add_struct_name.cpp | 2 +- tests/cereal/test_array.cpp | 7 +- tests/cereal/test_box.cpp | 7 +- tests/cereal/test_bytestring.cpp | 7 +- tests/cereal/test_custom_class1.cpp | 4 +- tests/cereal/test_custom_class3.cpp | 4 +- tests/cereal/test_custom_class4.cpp | 7 +- tests/cereal/test_default_values.cpp | 4 +- tests/cereal/test_deque.cpp | 7 +- tests/cereal/test_enum.cpp | 4 +- tests/cereal/test_field_variant.cpp | 4 +- tests/cereal/test_field_variant_std.cpp | 7 +- tests/cereal/test_flag_enum.cpp | 4 +- tests/cereal/test_flag_enum_with_int.cpp | 4 +- tests/cereal/test_flatten.cpp | 4 +- tests/cereal/test_flatten_anonymous.cpp | 4 +- tests/cereal/test_forward_list.cpp | 7 +- tests/cereal/test_generic.cpp | 4 +- tests/cereal/test_literal.cpp | 6 +- tests/cereal/test_literal_map.cpp | 4 +- tests/cereal/test_map.cpp | 7 +- tests/cereal/test_map2.cpp | 9 +- tests/cereal/test_monster_example.cpp | 4 +- tests/cereal/test_optional_fields.cpp | 7 +- tests/cereal/test_optionals_in_vectors.cpp | 9 +- tests/cereal/test_person.cpp | 4 +- tests/cereal/test_readme_example.cpp | 4 +- tests/cereal/test_readme_example2.cpp | 4 +- tests/cereal/test_readme_example3.cpp | 4 +- tests/cereal/test_ref.cpp | 7 +- tests/cereal/test_rfl_tuple.cpp | 9 +- tests/cereal/test_rfl_variant.cpp | 7 +- tests/cereal/test_save_load.cpp | 4 +- tests/cereal/test_set.cpp | 7 +- tests/cereal/test_shared_ptr.cpp | 9 +- tests/cereal/test_size.cpp | 4 +- tests/cereal/test_string_map.cpp | 6 +- tests/cereal/test_tagged_union.cpp | 4 +- tests/cereal/test_timestamp.cpp | 4 +- tests/cereal/test_tuple.cpp | 4 +- tests/cereal/test_unique_ptr.cpp | 7 +- tests/cereal/test_unique_ptr2.cpp | 7 +- tests/cereal/test_variant.cpp | 7 +- tests/cereal/test_variants_in_vectors.cpp | 9 +- tests/cereal/test_wstring.cpp | 4 +- tests/cereal/write_and_read.hpp | 2 +- tests/cli/test_basic.cpp | 4 +- tests/cli/test_bool_short_positional.cpp | 4 +- tests/cli/test_enum.cpp | 4 +- tests/cli/test_errors.cpp | 4 +- tests/cli/test_flatten.cpp | 4 +- tests/cli/test_kebab_case.cpp | 4 +- tests/cli/test_nested.cpp | 4 +- tests/cli/test_optional.cpp | 4 +- tests/cli/test_positional.cpp | 4 +- tests/cli/test_positional_and_short.cpp | 4 +- tests/cli/test_regression_bugs.cpp | 4 +- tests/cli/test_rename.cpp | 4 +- tests/cli/test_settings_macro.cpp | 2 +- tests/cli/test_short.cpp | 4 +- tests/cli/test_vector.cpp | 4 +- tests/csv/test_boolean.cpp | 2 +- tests/csv/test_box.cpp | 2 +- tests/csv/test_bytestring.cpp | 5 +- tests/csv/test_camel_case.cpp | 2 +- tests/csv/test_deque.cpp | 2 +- tests/csv/test_enums.cpp | 2 +- tests/csv/test_flatten.cpp | 2 +- tests/csv/test_literal.cpp | 2 +- tests/csv/test_optionals.cpp | 2 +- tests/csv/test_readme_example.cpp | 2 +- tests/csv/test_ref.cpp | 2 +- tests/csv/test_save_load.cpp | 4 +- tests/csv/test_settings.cpp | 2 +- tests/csv/test_shared_ptr.cpp | 2 +- tests/csv/test_unique_ptr.cpp | 2 +- tests/csv/write_and_read.hpp | 2 +- tests/flexbuffers/test_add_struct_name.cpp | 2 +- tests/flexbuffers/test_array.cpp | 7 +- tests/flexbuffers/test_box.cpp | 7 +- tests/flexbuffers/test_bytestring.cpp | 7 +- .../flexbuffers/test_combined_processors.cpp | 2 +- tests/flexbuffers/test_custom_class1.cpp | 4 +- tests/flexbuffers/test_custom_class3.cpp | 4 +- tests/flexbuffers/test_custom_class4.cpp | 4 +- tests/flexbuffers/test_default_values.cpp | 4 +- tests/flexbuffers/test_deque.cpp | 7 +- tests/flexbuffers/test_enum.cpp | 4 +- tests/flexbuffers/test_field_variant.cpp | 4 +- tests/flexbuffers/test_flag_enum.cpp | 4 +- tests/flexbuffers/test_flag_enum_with_int.cpp | 4 +- tests/flexbuffers/test_flatten.cpp | 4 +- tests/flexbuffers/test_flatten_anonymous.cpp | 4 +- tests/flexbuffers/test_forward_list.cpp | 7 +- tests/flexbuffers/test_literal.cpp | 4 +- tests/flexbuffers/test_literal_map.cpp | 4 +- tests/flexbuffers/test_map.cpp | 7 +- .../test_map_with_key_validation.cpp | 7 +- tests/flexbuffers/test_monster_example.cpp | 4 +- tests/flexbuffers/test_readme_example.cpp | 4 +- tests/flexbuffers/test_readme_example2.cpp | 4 +- tests/flexbuffers/test_ref.cpp | 7 +- tests/flexbuffers/test_save_load.cpp | 4 +- tests/flexbuffers/test_set.cpp | 7 +- tests/flexbuffers/test_size.cpp | 4 +- .../test_snake_case_to_camel_case.cpp | 2 +- .../test_snake_case_to_pascal_case.cpp | 2 +- tests/flexbuffers/test_string_map.cpp | 4 +- tests/flexbuffers/test_tagged_union.cpp | 4 +- tests/flexbuffers/test_tagged_union2.cpp | 4 +- tests/flexbuffers/test_timestamp.cpp | 4 +- tests/flexbuffers/test_unique_ptr.cpp | 7 +- tests/flexbuffers/test_unique_ptr2.cpp | 7 +- tests/flexbuffers/test_variant.cpp | 7 +- tests/flexbuffers/test_wstring.cpp | 4 +- tests/flexbuffers/write_and_read.hpp | 2 +- .../flatten_cross_type_move_assign.cpp | 2 +- tests/generic/test_array.cpp | 5 +- tests/generic/test_bad_access_error.cpp | 2 +- tests/generic/test_box.cpp | 5 +- tests/generic/test_byte_containers.cpp | 5 +- tests/generic/test_custom_class1.cpp | 2 +- tests/generic/test_custom_class3.cpp | 2 +- tests/generic/test_custom_class4.cpp | 2 +- tests/generic/test_default_values.cpp | 2 +- tests/generic/test_deque.cpp | 5 +- tests/generic/test_enum.cpp | 2 +- tests/generic/test_enum_range.cpp | 2 +- tests/generic/test_enum_range_min_max.cpp | 2 +- tests/generic/test_enum_range_size.cpp | 2 +- tests/generic/test_field.cpp | 5 +- tests/generic/test_field_variant.cpp | 2 +- tests/generic/test_flag_enum.cpp | 2 +- tests/generic/test_flag_enum_with_int.cpp | 2 +- tests/generic/test_flatten.cpp | 7 +- tests/generic/test_flatten_anonymous.cpp | 2 +- tests/generic/test_forward_list.cpp | 5 +- tests/generic/test_generic.cpp | 2 +- tests/generic/test_literal.cpp | 2 +- tests/generic/test_literal_map.cpp | 2 +- tests/generic/test_map.cpp | 5 +- .../generic/test_map_with_key_validation.cpp | 5 +- tests/generic/test_monster_example.cpp | 2 +- tests/generic/test_object.cpp | 2 +- tests/generic/test_optional.cpp | 2 +- tests/generic/test_readme_example.cpp | 2 +- tests/generic/test_readme_example2.cpp | 2 +- tests/generic/test_ref.cpp | 5 +- tests/generic/test_result.cpp | 2 +- tests/generic/test_set.cpp | 5 +- tests/generic/test_size.cpp | 2 +- tests/generic/test_skip.cpp | 5 +- tests/generic/test_string_map.cpp | 2 +- tests/generic/test_tagged_union.cpp | 5 +- tests/generic/test_timestamp.cpp | 2 +- tests/generic/test_tuple.cpp | 2 +- tests/generic/test_unique_ptr.cpp | 5 +- tests/generic/test_unique_ptr2.cpp | 5 +- tests/generic/test_variant.cpp | 5 +- tests/generic/test_wstring.cpp | 2 +- tests/generic/write_and_read.hpp | 2 +- ...st_add_namespaced_tags_to_rfl_variants.cpp | 7 +- .../test_add_namespaced_tags_to_variants.cpp | 4 +- tests/json/test_add_struct_name.cpp | 4 +- tests/json/test_add_tags_to_rfl_variants.cpp | 4 +- tests/json/test_add_tags_to_variants.cpp | 4 +- tests/json/test_all_of.cpp | 4 +- tests/json/test_alphanumeric_map.cpp | 4 +- .../json/test_alphanumeric_unordered_map.cpp | 4 +- tests/json/test_and_then.cpp | 4 +- tests/json/test_anonymous_fields.cpp | 4 +- tests/json/test_any_of.cpp | 4 +- tests/json/test_apply.cpp | 4 +- tests/json/test_apply_on_named_tuple.cpp | 4 +- tests/json/test_array.cpp | 7 +- tests/json/test_array2.cpp | 2 +- tests/json/test_as.cpp | 7 +- tests/json/test_as2.cpp | 7 +- tests/json/test_as_flatten.cpp | 7 +- tests/json/test_atomic.cpp | 7 +- tests/json/test_atomic_array.cpp | 7 +- tests/json/test_atomic_box.cpp | 7 +- tests/json/test_atomic_negative.cpp | 4 +- tests/json/test_atomic_ref.cpp | 7 +- tests/json/test_atomic_shared_ptr.cpp | 7 +- tests/json/test_atomic_unique_ptr.cpp | 7 +- tests/json/test_binary.cpp | 4 +- tests/json/test_box.cpp | 7 +- tests/json/test_box2.cpp | 4 +- .../test_camel_case_to_snake_case_rename.cpp | 4 +- tests/json/test_chrono_duration.cpp | 4 +- tests/json/test_combined_processors.cpp | 4 +- tests/json/test_const_fields.cpp | 4 +- tests/json/test_custom_class1.cpp | 4 +- tests/json/test_custom_class2.cpp | 4 +- tests/json/test_custom_class3.cpp | 4 +- tests/json/test_custom_class4.cpp | 4 +- tests/json/test_custom_constructor.cpp | 7 +- tests/json/test_custom_enum1.cpp | 4 +- tests/json/test_deep_nested.cpp | 4 +- tests/json/test_default_if_missing.cpp | 4 +- ...test_default_if_missing_no_field_names.cpp | 4 +- tests/json/test_default_val.cpp | 4 +- .../json/test_default_val_no_field_names.cpp | 4 +- tests/json/test_default_values.cpp | 4 +- tests/json/test_deque.cpp | 7 +- tests/json/test_duration.cpp | 4 +- tests/json/test_duration_conversion.cpp | 4 +- tests/json/test_duration_default.cpp | 4 +- tests/json/test_email.cpp | 4 +- tests/json/test_empty_object.cpp | 4 +- tests/json/test_enum1.cpp | 4 +- tests/json/test_enum2.cpp | 4 +- tests/json/test_enum3.cpp | 4 +- tests/json/test_enum4.cpp | 4 +- tests/json/test_enum5.cpp | 4 +- tests/json/test_enum6.cpp | 4 +- tests/json/test_enum7.cpp | 4 +- tests/json/test_enum8.cpp | 4 +- tests/json/test_enum_descriptions.cpp | 4 +- tests/json/test_enum_error_messages.cpp | 4 +- tests/json/test_enum_underlying.cpp | 2 +- tests/json/test_error_messages.cpp | 4 +- tests/json/test_extra_fields.cpp | 4 +- ...test_extra_fields_with_no_extra_fields.cpp | 4 +- tests/json/test_field_variant.cpp | 4 +- tests/json/test_field_variant_std.cpp | 7 +- tests/json/test_filepath.cpp | 4 +- tests/json/test_flag_enum1.cpp | 4 +- tests/json/test_flag_enum2.cpp | 4 +- tests/json/test_flag_enum_with_int.cpp | 4 +- tests/json/test_flatten.cpp | 4 +- tests/json/test_flatten_anonymous.cpp | 4 +- tests/json/test_forward_list.cpp | 7 +- tests/json/test_generic.cpp | 4 +- tests/json/test_generic2.cpp | 4 +- tests/json/test_hex.cpp | 4 +- tests/json/test_inside_function.cpp | 4 +- tests/json/test_integers.cpp | 4 +- tests/json/test_json_schema.cpp | 4 +- tests/json/test_json_schema2.cpp | 4 +- tests/json/test_json_schema3.cpp | 4 +- tests/json/test_json_schema4.cpp | 4 +- tests/json/test_json_schema5.cpp | 6 +- tests/json/test_json_schema6.cpp | 4 +- tests/json/test_json_schema7.cpp | 6 +- tests/json/test_json_schema_default_vals.cpp | 7 +- tests/json/test_json_schema_deprecation.cpp | 4 +- .../json/test_json_schema_size_validation.cpp | 4 +- tests/json/test_leak.cpp | 7 +- tests/json/test_leak_arr.cpp | 7 +- tests/json/test_leak_rfl_tup.cpp | 7 +- tests/json/test_leak_tup.cpp | 7 +- tests/json/test_list.cpp | 7 +- tests/json/test_literal.cpp | 4 +- tests/json/test_literal_map.cpp | 4 +- tests/json/test_literal_unordered_map.cpp | 4 +- tests/json/test_many_fields.cpp | 4 +- tests/json/test_map.cpp | 7 +- tests/json/test_map_with_custom_less.cpp | 7 +- tests/json/test_map_with_key_validation.cpp | 7 +- tests/json/test_meta_fields.cpp | 2 +- tests/json/test_monster_example.cpp | 7 +- tests/json/test_movable.cpp | 4 +- tests/json/test_move_replace.cpp | 7 +- tests/json/test_multimap.cpp | 7 +- tests/json/test_multiset.cpp | 7 +- tests/json/test_named_tuple.cpp | 4 +- tests/json/test_no_extra_fields.cpp | 4 +- .../test_no_extra_fields_with_default.cpp | 4 +- tests/json/test_no_optionals.cpp | 7 +- tests/json/test_object.cpp | 2 +- tests/json/test_oct.cpp | 4 +- tests/json/test_one_of.cpp | 4 +- tests/json/test_optional_fields.cpp | 7 +- tests/json/test_pointer_fields.cpp | 7 +- tests/json/test_positional_and_short.cpp | 4 +- tests/json/test_readme_example.cpp | 4 +- tests/json/test_ref.cpp | 7 +- tests/json/test_reflector.cpp | 4 +- tests/json/test_reflector_read.cpp | 4 +- tests/json/test_reflector_schema.cpp | 4 +- tests/json/test_reflector_write.cpp | 4 +- tests/json/test_regression_bugs.cpp | 4 +- tests/json/test_replace.cpp | 7 +- tests/json/test_replace2.cpp | 7 +- tests/json/test_replace_flatten.cpp | 7 +- tests/json/test_replace_flatten2.cpp | 7 +- tests/json/test_replace_with_other_struct.cpp | 4 +- .../json/test_replace_with_other_struct2.cpp | 4 +- tests/json/test_result.cpp | 4 +- .../test_rfl_tagged_union_visit_move_only.cpp | 4 +- tests/json/test_rfl_tuple.cpp | 7 +- tests/json/test_rfl_variant.cpp | 7 +- tests/json/test_rfl_variant_emplace.cpp | 7 +- tests/json/test_rfl_variant_get_if.cpp | 7 +- .../test_rfl_variant_holds_alternative.cpp | 7 +- tests/json/test_rfl_variant_swap.cpp | 7 +- tests/json/test_rfl_variant_visit.cpp | 7 +- .../json/test_rfl_variant_visit_in_place.cpp | 7 +- tests/json/test_rfl_variant_visit_lvalues.cpp | 4 +- .../json/test_rfl_variant_visit_move_only.cpp | 4 +- tests/json/test_save_load.cpp | 4 +- tests/json/test_segfault.cpp | 4 +- tests/json/test_set.cpp | 7 +- tests/json/test_shared_ptr.cpp | 7 +- tests/json/test_size.cpp | 4 +- tests/json/test_skip.cpp | 4 +- tests/json/test_skip2.cpp | 4 +- tests/json/test_snake_case_to_camel_case.cpp | 4 +- .../test_snake_case_to_camel_case_rename.cpp | 4 +- tests/json/test_snake_case_to_pascal_case.cpp | 4 +- .../test_snake_case_to_pascal_case_rename.cpp | 4 +- tests/json/test_span.cpp | 4 +- tests/json/test_std_ref.cpp | 4 +- tests/json/test_string_map.cpp | 4 +- tests/json/test_string_unordered_map.cpp | 4 +- tests/json/test_string_view.cpp | 4 +- tests/json/test_strip_field_names.cpp | 4 +- tests/json/test_tagged_union.cpp | 4 +- tests/json/test_tagged_union2.cpp | 4 +- tests/json/test_tagged_union3.cpp | 4 +- tests/json/test_tagged_union4.cpp | 4 +- tests/json/test_tagged_union5.cpp | 4 +- ...test_tagged_union_with_no_extra_fields.cpp | 4 +- tests/json/test_template.cpp | 4 +- tests/json/test_time_point.cpp | 4 +- tests/json/test_timestamp.cpp | 4 +- tests/json/test_transform.cpp | 4 +- tests/json/test_tuple.cpp | 7 +- tests/json/test_underlying_enums.cpp | 4 +- tests/json/test_unique_ptr.cpp | 7 +- tests/json/test_unique_ptr2.cpp | 7 +- tests/json/test_unnamed_namespace.cpp | 4 +- tests/json/test_unordered_map.cpp | 7 +- .../test_unordered_map_with_custom_hash.cpp | 7 +- tests/json/test_unordered_multimap.cpp | 7 +- tests/json/test_unordered_multiset.cpp | 7 +- tests/json/test_unordered_set.cpp | 7 +- tests/json/test_uuid.cpp | 4 +- tests/json/test_validation_with_fields.cpp | 7 +- tests/json/test_variant.cpp | 7 +- tests/json/test_view.cpp | 4 +- tests/json/test_wstring.cpp | 4 +- tests/json/write_and_read.hpp | 2 +- .../CMakeLists.txt | 4 + .../test_inheritance.cpp | 2 +- .../test_inheritance2.cpp | 2 +- .../write_and_read.hpp | 2 +- tests/msgpack/test_add_struct_name.cpp | 2 +- tests/msgpack/test_array.cpp | 7 +- tests/msgpack/test_box.cpp | 7 +- tests/msgpack/test_bytestring.cpp | 7 +- tests/msgpack/test_combined_processors.cpp | 2 +- tests/msgpack/test_custom_class1.cpp | 4 +- tests/msgpack/test_custom_class3.cpp | 4 +- tests/msgpack/test_custom_class4.cpp | 4 +- tests/msgpack/test_default_values.cpp | 4 +- tests/msgpack/test_deque.cpp | 7 +- tests/msgpack/test_enum.cpp | 4 +- tests/msgpack/test_extra_fields.cpp | 4 +- tests/msgpack/test_field_variant.cpp | 4 +- tests/msgpack/test_flag_enum.cpp | 4 +- tests/msgpack/test_flag_enum_with_int.cpp | 4 +- tests/msgpack/test_flatten.cpp | 4 +- tests/msgpack/test_flatten_anonymous.cpp | 4 +- tests/msgpack/test_forward_list.cpp | 7 +- tests/msgpack/test_generic_float.cpp | 4 +- tests/msgpack/test_literal.cpp | 4 +- tests/msgpack/test_literal_map.cpp | 4 +- tests/msgpack/test_map.cpp | 7 +- .../msgpack/test_map_with_key_validation.cpp | 7 +- tests/msgpack/test_monster_example.cpp | 4 +- tests/msgpack/test_readme_example.cpp | 4 +- tests/msgpack/test_readme_example2.cpp | 4 +- tests/msgpack/test_ref.cpp | 7 +- tests/msgpack/test_regression_bugs.cpp | 4 +- tests/msgpack/test_save_load.cpp | 4 +- tests/msgpack/test_set.cpp | 7 +- tests/msgpack/test_size.cpp | 4 +- tests/msgpack/test_skip.cpp | 2 +- .../msgpack/test_snake_case_to_camel_case.cpp | 2 +- .../test_snake_case_to_pascal_case.cpp | 2 +- tests/msgpack/test_string_map.cpp | 4 +- tests/msgpack/test_tagged_union.cpp | 4 +- tests/msgpack/test_tagged_union2.cpp | 4 +- tests/msgpack/test_timestamp.cpp | 4 +- tests/msgpack/test_unique_ptr.cpp | 7 +- tests/msgpack/test_unique_ptr2.cpp | 7 +- tests/msgpack/test_variant.cpp | 7 +- tests/msgpack/test_vectorstring.cpp | 4 +- tests/msgpack/test_wstring.cpp | 4 +- tests/msgpack/write_and_read.hpp | 2 +- tests/parquet/test_boolean.cpp | 2 +- tests/parquet/test_box.cpp | 2 +- tests/parquet/test_bytestring.cpp | 5 +- tests/parquet/test_camel_case.cpp | 2 +- tests/parquet/test_deque.cpp | 2 +- tests/parquet/test_enums.cpp | 2 +- tests/parquet/test_flatten.cpp | 2 +- tests/parquet/test_gzip.cpp | 2 +- tests/parquet/test_literal.cpp | 2 +- tests/parquet/test_optionals.cpp | 2 +- tests/parquet/test_readme_example.cpp | 2 +- tests/parquet/test_ref.cpp | 2 +- tests/parquet/test_save_load.cpp | 4 +- tests/parquet/test_shared_ptr.cpp | 2 +- tests/parquet/test_unique_ptr.cpp | 2 +- tests/parquet/write_and_read.hpp | 2 +- tests/test_rfl.hpp.in | 3 + tests/toml/test_add_struct_name.cpp | 2 +- tests/toml/test_array.cpp | 7 +- tests/toml/test_box.cpp | 7 +- tests/toml/test_combined_processors.cpp | 2 +- tests/toml/test_custom_class1.cpp | 4 +- tests/toml/test_custom_class3.cpp | 4 +- tests/toml/test_custom_class4.cpp | 4 +- tests/toml/test_default_values.cpp | 4 +- tests/toml/test_deque.cpp | 7 +- tests/toml/test_enum.cpp | 4 +- tests/toml/test_field_variant.cpp | 4 +- tests/toml/test_flag_enum.cpp | 4 +- tests/toml/test_flag_enum_with_int.cpp | 4 +- tests/toml/test_flatten.cpp | 4 +- tests/toml/test_flatten_anonymous.cpp | 4 +- tests/toml/test_forward_list.cpp | 7 +- tests/toml/test_literal.cpp | 4 +- tests/toml/test_literal_map.cpp | 4 +- tests/toml/test_map.cpp | 7 +- tests/toml/test_map_with_key_validation.cpp | 7 +- tests/toml/test_monster_example.cpp | 4 +- tests/toml/test_readme_example.cpp | 4 +- tests/toml/test_readme_example2.cpp | 4 +- tests/toml/test_ref.cpp | 7 +- tests/toml/test_regression_bugs.cpp | 4 +- tests/toml/test_save_load.cpp | 4 +- tests/toml/test_set.cpp | 7 +- tests/toml/test_size.cpp | 4 +- tests/toml/test_snake_case_to_camel_case.cpp | 2 +- tests/toml/test_snake_case_to_pascal_case.cpp | 2 +- tests/toml/test_string_map.cpp | 4 +- tests/toml/test_tagged_union.cpp | 4 +- tests/toml/test_timestamp.cpp | 4 +- tests/toml/test_unique_ptr.cpp | 7 +- tests/toml/test_unique_ptr2.cpp | 7 +- tests/toml/test_variant.cpp | 7 +- tests/toml/test_wstring.cpp | 4 +- tests/toml/write_and_read.hpp | 2 +- tests/ubjson/test_add_struct_name.cpp | 2 +- tests/ubjson/test_array.cpp | 7 +- tests/ubjson/test_box.cpp | 7 +- tests/ubjson/test_bytestring.cpp | 7 +- tests/ubjson/test_combined_processors.cpp | 2 +- tests/ubjson/test_custom_class1.cpp | 4 +- tests/ubjson/test_custom_class3.cpp | 4 +- tests/ubjson/test_custom_class4.cpp | 4 +- tests/ubjson/test_default_values.cpp | 4 +- tests/ubjson/test_deque.cpp | 7 +- tests/ubjson/test_enum.cpp | 4 +- tests/ubjson/test_error_messages.cpp | 6 +- tests/ubjson/test_extra_fields.cpp | 4 +- tests/ubjson/test_field_variant.cpp | 4 +- tests/ubjson/test_flag_enum.cpp | 4 +- tests/ubjson/test_flag_enum_with_int.cpp | 4 +- tests/ubjson/test_flatten.cpp | 4 +- tests/ubjson/test_flatten_anonymous.cpp | 4 +- tests/ubjson/test_forward_list.cpp | 7 +- tests/ubjson/test_literal.cpp | 4 +- tests/ubjson/test_literal_map.cpp | 4 +- tests/ubjson/test_map.cpp | 7 +- tests/ubjson/test_map_with_key_validation.cpp | 7 +- tests/ubjson/test_monster_example.cpp | 4 +- tests/ubjson/test_read_byte_containers.cpp | 4 +- tests/ubjson/test_readme_example.cpp | 4 +- tests/ubjson/test_readme_example2.cpp | 4 +- tests/ubjson/test_ref.cpp | 7 +- tests/ubjson/test_save_load.cpp | 4 +- tests/ubjson/test_set.cpp | 7 +- tests/ubjson/test_size.cpp | 4 +- .../ubjson/test_snake_case_to_camel_case.cpp | 2 +- .../ubjson/test_snake_case_to_pascal_case.cpp | 2 +- tests/ubjson/test_string_map.cpp | 4 +- tests/ubjson/test_tagged_union.cpp | 4 +- tests/ubjson/test_tagged_union2.cpp | 4 +- tests/ubjson/test_timestamp.cpp | 4 +- tests/ubjson/test_unique_ptr.cpp | 7 +- tests/ubjson/test_unique_ptr2.cpp | 7 +- tests/ubjson/test_variant.cpp | 7 +- tests/ubjson/test_vectorstring.cpp | 4 +- tests/ubjson/test_wstring.cpp | 4 +- tests/ubjson/write_and_read.hpp | 2 +- tests/xml/test_add_struct_name.cpp | 2 +- tests/xml/test_array.cpp | 7 +- tests/xml/test_attribute_rename.cpp | 4 +- tests/xml/test_box.cpp | 7 +- tests/xml/test_combined_processors.cpp | 2 +- tests/xml/test_comment.cpp | 4 +- tests/xml/test_custom_class1.cpp | 4 +- tests/xml/test_custom_class3.cpp | 4 +- tests/xml/test_custom_class4.cpp | 4 +- tests/xml/test_default_if_missing.cpp | 5 +- tests/xml/test_default_values.cpp | 4 +- tests/xml/test_deque.cpp | 7 +- tests/xml/test_enum.cpp | 4 +- tests/xml/test_field_variant.cpp | 4 +- tests/xml/test_flag_enum.cpp | 4 +- tests/xml/test_flag_enum_with_int.cpp | 4 +- tests/xml/test_flatten.cpp | 4 +- tests/xml/test_flatten_anonymous.cpp | 4 +- tests/xml/test_forward_list.cpp | 7 +- tests/xml/test_generic.cpp | 4 +- tests/xml/test_literal.cpp | 4 +- tests/xml/test_literal_map.cpp | 4 +- tests/xml/test_map.cpp | 7 +- tests/xml/test_map_with_key_validation.cpp | 7 +- tests/xml/test_monster_example.cpp | 4 +- tests/xml/test_readme_example.cpp | 4 +- tests/xml/test_readme_example2.cpp | 4 +- tests/xml/test_ref.cpp | 7 +- tests/xml/test_regression_bugs.cpp | 4 +- tests/xml/test_save_load.cpp | 4 +- tests/xml/test_set.cpp | 7 +- tests/xml/test_size.cpp | 4 +- tests/xml/test_snake_case_to_camel_case.cpp | 2 +- tests/xml/test_snake_case_to_pascal_case.cpp | 2 +- tests/xml/test_string_map.cpp | 4 +- tests/xml/test_tagged_union.cpp | 4 +- tests/xml/test_timestamp.cpp | 4 +- tests/xml/test_unique_ptr.cpp | 7 +- tests/xml/test_unique_ptr2.cpp | 7 +- tests/xml/test_variant.cpp | 7 +- tests/xml/test_wstring.cpp | 4 +- tests/xml/test_xml_content.cpp | 5 +- tests/xml/test_xml_content2.cpp | 5 +- tests/xml/write_and_read.hpp | 4 +- tests/yaml/test_add_struct_name.cpp | 2 +- tests/yaml/test_array.cpp | 7 +- tests/yaml/test_box.cpp | 7 +- tests/yaml/test_combined_processors.cpp | 2 +- tests/yaml/test_comment.cpp | 4 +- tests/yaml/test_comment_optional_array.cpp | 4 +- tests/yaml/test_custom_class1.cpp | 4 +- tests/yaml/test_custom_class3.cpp | 4 +- tests/yaml/test_custom_class4.cpp | 4 +- tests/yaml/test_default_values.cpp | 4 +- tests/yaml/test_deque.cpp | 7 +- tests/yaml/test_double.cpp | 4 +- tests/yaml/test_enum.cpp | 4 +- tests/yaml/test_field_variant.cpp | 4 +- tests/yaml/test_flag_enum.cpp | 4 +- tests/yaml/test_flag_enum_with_int.cpp | 4 +- tests/yaml/test_flatten.cpp | 4 +- tests/yaml/test_flatten_anonymous.cpp | 4 +- tests/yaml/test_forward_list.cpp | 7 +- tests/yaml/test_literal.cpp | 4 +- tests/yaml/test_literal_map.cpp | 4 +- tests/yaml/test_map.cpp | 7 +- tests/yaml/test_map_with_key_validation.cpp | 7 +- tests/yaml/test_monster_example.cpp | 4 +- tests/yaml/test_multiline.cpp | 4 +- tests/yaml/test_read_null.cpp | 2 +- tests/yaml/test_readme_example.cpp | 4 +- tests/yaml/test_readme_example2.cpp | 4 +- tests/yaml/test_ref.cpp | 7 +- tests/yaml/test_save_load.cpp | 4 +- tests/yaml/test_set.cpp | 7 +- tests/yaml/test_size.cpp | 4 +- tests/yaml/test_skip.cpp | 5 +- tests/yaml/test_snake_case_to_camel_case.cpp | 2 +- tests/yaml/test_snake_case_to_pascal_case.cpp | 2 +- tests/yaml/test_string_map.cpp | 4 +- tests/yaml/test_tagged_union.cpp | 4 +- tests/yaml/test_timestamp.cpp | 4 +- tests/yaml/test_unique_ptr.cpp | 7 +- tests/yaml/test_unique_ptr2.cpp | 7 +- tests/yaml/test_variant.cpp | 7 +- tests/yaml/test_wstring.cpp | 4 +- tests/yaml/write_and_read.hpp | 2 +- tests/yas/test_add_struct_name.cpp | 2 +- tests/yas/test_array.cpp | 7 +- tests/yas/test_box.cpp | 7 +- tests/yas/test_bytestring.cpp | 7 +- tests/yas/test_custom_class1.cpp | 4 +- tests/yas/test_custom_class3.cpp | 4 +- tests/yas/test_custom_class4.cpp | 7 +- tests/yas/test_default_values.cpp | 4 +- tests/yas/test_deque.cpp | 7 +- tests/yas/test_enum.cpp | 4 +- tests/yas/test_field_variant.cpp | 4 +- tests/yas/test_field_variant_std.cpp | 7 +- tests/yas/test_flag_enum.cpp | 4 +- tests/yas/test_flag_enum_with_int.cpp | 4 +- tests/yas/test_flatten.cpp | 4 +- tests/yas/test_flatten_anonymous.cpp | 4 +- tests/yas/test_forward_list.cpp | 7 +- tests/yas/test_generic.cpp | 4 +- tests/yas/test_literal.cpp | 6 +- tests/yas/test_literal_map.cpp | 4 +- tests/yas/test_map.cpp | 7 +- tests/yas/test_map2.cpp | 9 +- tests/yas/test_monster_example.cpp | 4 +- tests/yas/test_optional_fields.cpp | 7 +- tests/yas/test_optionals_in_vectors.cpp | 9 +- tests/yas/test_person.cpp | 4 +- tests/yas/test_readme_example.cpp | 4 +- tests/yas/test_readme_example2.cpp | 4 +- tests/yas/test_readme_example3.cpp | 4 +- tests/yas/test_ref.cpp | 7 +- tests/yas/test_rfl_tuple.cpp | 9 +- tests/yas/test_rfl_variant.cpp | 7 +- tests/yas/test_save_load.cpp | 4 +- tests/yas/test_set.cpp | 7 +- tests/yas/test_shared_ptr.cpp | 9 +- tests/yas/test_size.cpp | 4 +- tests/yas/test_string_map.cpp | 6 +- tests/yas/test_tagged_union.cpp | 4 +- tests/yas/test_timestamp.cpp | 4 +- tests/yas/test_tuple.cpp | 4 +- tests/yas/test_unique_ptr.cpp | 7 +- tests/yas/test_unique_ptr2.cpp | 7 +- tests/yas/test_variant.cpp | 7 +- tests/yas/test_variants_in_vectors.cpp | 9 +- tests/yas/test_wstring.cpp | 4 +- tests/yas/write_and_read.hpp | 4 +- 871 files changed, 2909 insertions(+), 1936 deletions(-) create mode 100644 include/rfl/internal/ctre_std.hpp create mode 100644 include/rfl/json/yyjson_helpers.hpp create mode 100644 modules/rfl.ctre.cppm create mode 100644 scripts/check_pch_modules.py create mode 100644 scripts/ci/Containerfile create mode 100644 scripts/ci/README.md create mode 100644 scripts/ci_matrix.py create mode 100644 src/reflectcpp_yyjson_helpers.cpp create mode 100644 tests/test_rfl.hpp.in diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 5ee5d7daf..a2d951e05 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -12,15 +12,36 @@ jobs: matrix: format: ["JSON", "AVRO", "BOOST_SERIALIZATION", "CAPNPROTO", "CBOR", "CEREAL", "FLEXBUFFERS", "MSGPACK", "PARQUET", "TOML", "UBJSON", "XML", "YAML", "benchmarks", "headers"] compiler: [llvm, gcc] - compiler-version: [11, 12, 13, 14, 16, 17, 18] + compiler-version: [11, 12, 13, 14, 16, 17, 18, 19] cxx: [20, 23] + modules: ["OFF", "ON"] exclude: + - compiler: llvm + compiler-version: 16 + modules: "ON" + - compiler: llvm + compiler-version: 17 + modules: "ON" + - compiler: llvm + compiler-version: 18 + modules: "ON" + - compiler: gcc + compiler-version: 11 + modules: "ON" + - compiler: gcc + compiler-version: 12 + modules: "ON" + - compiler: gcc + compiler-version: 13 + modules: "ON" - compiler: gcc compiler-version: 16 - compiler: gcc compiler-version: 17 - compiler: gcc compiler-version: 18 + - compiler: gcc + compiler-version: 19 - compiler: llvm compiler-version: 11 - compiler: llvm @@ -41,9 +62,9 @@ jobs: - compiler: llvm compiler-version: 17 cxx: 23 - name: "${{ github.job }} (${{ matrix.format }}-C++${{ matrix.cxx }}-${{ matrix.compiler }}-${{ matrix.compiler-version }})" + name: "${{ github.job }} (${{ matrix.format }}-C++${{ matrix.cxx }}-${{ matrix.compiler }}-${{ matrix.compiler-version }}-modules-${{ matrix.modules }})" concurrency: - group: "linux-${{ github.ref }}-${{ github.job }}-${{ matrix.format }}-C++${{ matrix.cxx }}-${{ matrix.compiler }}-${{ matrix.compiler-version }}" + group: "linux-${{ github.ref }}-${{ github.job }}-${{ matrix.format }}-C++${{ matrix.cxx }}-${{ matrix.compiler }}-${{ matrix.compiler-version }}-modules-${{ matrix.modules }}" cancel-in-progress: true runs-on: ubuntu-24.04 steps: @@ -65,6 +86,8 @@ jobs: sudo apt update if [[ "${{ matrix.compiler-version }}" == 11 ]]; then sudo apt install -y ninja-build g++-11 + elif [[ "${{ matrix.compiler }}" == "llvm" && "${{ matrix.compiler-version }}" == 19 ]]; then + sudo apt install -y ninja-build clang-19 clang-tools-19 else sudo apt install -y ninja-build fi @@ -79,13 +102,13 @@ jobs: fi $CXX --version if [[ "${{ matrix.format }}" == "JSON" ]]; then - cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} -DCMAKE_CXX_STANDARD=20 -DREFLECTCPP_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} -DREFLECTCPP_BUILD_MODULES=${{ matrix.modules }} -DREFLECTCPP_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release elif [[ "${{ matrix.format }}" == "benchmarks" ]]; then - cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} -DCMAKE_CXX_STANDARD=20 -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_ALL_FORMATS=ON -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} -DREFLECTCPP_BUILD_MODULES=${{ matrix.modules }} -DREFLECTCPP_BUILD_BENCHMARKS=ON -DREFLECTCPP_ALL_FORMATS=ON -DCMAKE_BUILD_TYPE=Release elif [[ "${{ matrix.format }}" == "headers" ]]; then - cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} -DCMAKE_CXX_STANDARD=20 -DREFLECTCPP_CHECK_HEADERS=ON -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} -DREFLECTCPP_BUILD_MODULES=${{ matrix.modules }} -DREFLECTCPP_CHECK_HEADERS=ON -DCMAKE_BUILD_TYPE=Release else - cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} -DCMAKE_CXX_STANDARD=20 -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_JSON=OFF -DREFLECTCPP_${{ matrix.format }}=ON -DCMAKE_BUILD_TYPE=Release + cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=${{ matrix.cxx }} -DREFLECTCPP_BUILD_MODULES=${{ matrix.modules }} -DREFLECTCPP_BUILD_TESTS=ON -DREFLECTCPP_JSON=OFF -DREFLECTCPP_${{ matrix.format }}=ON -DCMAKE_BUILD_TYPE=Release fi cmake --build build -j4 - name: Run tests diff --git a/CMakeLists.txt b/CMakeLists.txt index 65e154b5a..326b2d290 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ option(REFLECTCPP_BOOST_SERIALIZATION "Enable Boost.Serialization support" ${REF option(REFLECTCPP_BUILD_BENCHMARKS "Build benchmarks" OFF) option(REFLECTCPP_BUILD_TESTS "Build tests" OFF) option(REFLECTCPP_CHECK_HEADERS "Make sure that all headers are self-contained" OFF) +option(REFLECTCPP_BUILD_MODULES "Build experimental C++20 module interfaces" OFF) set(REFLECTCPP_ENUM_RANGE_MIN "-256" CACHE STRING "Minimum value scanned during enum reflection") @@ -184,6 +185,19 @@ endif () project(reflectcpp VERSION 0.25.0 LANGUAGES CXX) +if(REFLECTCPP_BUILD_MODULES) + if(NOT CMAKE_GENERATOR MATCHES "Ninja|Visual Studio") + message(FATAL_ERROR "REFLECTCPP_BUILD_MODULES requires Ninja or Visual Studio") + endif() + if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14) + OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)) + message(FATAL_ERROR "REFLECTCPP_BUILD_MODULES requires GCC 14+ or Clang 19+; use headers with older compilers") + endif() +else() + # Keep ordinary header builds working with older compilers and generators. + set(CMAKE_CXX_SCAN_FOR_MODULES OFF) +endif() + find_package(ament_cmake QUIET) if (PROJECT_IS_TOP_LEVEL) @@ -249,6 +263,7 @@ set(REFLECT_CPP_SOURCES ) set(REFLECT_CPP_MODULES + modules/rfl.ctre.cppm modules/rfl.cppm ) @@ -276,6 +291,9 @@ else () endif () if (_REFLECTCPP_NEEDS_JSON_IMPL) + if(REFLECTCPP_BUILD_MODULES) + list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_yyjson_helpers.cpp) + endif() list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_json.cpp ) @@ -497,27 +515,38 @@ if (REFLECTCPP_CLI OR REFLECTCPP_CHECK_HEADERS) list(APPEND REFLECT_CPP_MODULES modules/rfl.cli.cppm) endif () -set_source_files_properties( - ${REFLECT_CPP_MODULES} - PROPERTIES - LANGUAGE CXX - SKIP_PRECOMPILE_HEADERS ON -) - -set_target_properties(reflectcpp PROPERTIES LINKER_LANGUAGE CXX) target_sources(reflectcpp PRIVATE ${REFLECT_CPP_SOURCES}) -target_sources(reflectcpp - PUBLIC - FILE_SET rfl_modules - TYPE CXX_MODULES - BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/modules - FILES ${REFLECT_CPP_MODULES} -) -target_precompile_headers(reflectcpp PRIVATE [["rfl.hpp"]] ) +if(REFLECTCPP_BUILD_MODULES) + target_compile_definitions(reflectcpp PUBLIC REFLECTCPP_BUILD_MODULES) + # Older Clang BMIs do not preserve enchantum's diagnostic suppression when + # its enum-probing templates are instantiated by an importing translation unit. + if(CMAKE_CXX_COMPILER_ID MATCHES "^(Clang|AppleClang)$" + AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 20) + target_compile_options(reflectcpp PUBLIC -Wno-enum-constexpr-conversion) + endif() + set_source_files_properties( + ${REFLECT_CPP_MODULES} + PROPERTIES + LANGUAGE CXX + SKIP_PRECOMPILE_HEADERS ON + ) + target_sources(reflectcpp + PUBLIC + FILE_SET rfl_modules + TYPE CXX_MODULES + BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/modules + FILES ${REFLECT_CPP_MODULES} + ) +endif() +target_precompile_headers(reflectcpp PRIVATE ) +if(NOT REFLECTCPP_BUILD_MODULES) + target_precompile_headers(reflectcpp PRIVATE [["rfl.hpp"]]) +endif() if (REFLECTCPP_BUILD_TESTS) add_library(reflectcpp_tests_crt INTERFACE) target_link_libraries(reflectcpp_tests_crt INTERFACE reflectcpp GTest::gtest_main) + target_include_directories(reflectcpp_tests_crt INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/tests) enable_testing() find_package(GTest CONFIG REQUIRED) diff --git a/include/rfl/PatternValidator.hpp b/include/rfl/PatternValidator.hpp index 6c74d7095..f2499ef24 100644 --- a/include/rfl/PatternValidator.hpp +++ b/include/rfl/PatternValidator.hpp @@ -4,7 +4,10 @@ #include #include -#if __has_include() +#ifdef REFLECTCPP_BUILD_MODULES +#include "internal/ctre_std.hpp" +import rfl.ctre; +#elif __has_include() #include #else #include "thirdparty/ctre.hpp" @@ -30,8 +33,12 @@ struct PatternValidator { /// @param _str The string to validate /// @return Result containing the string if it matches, or an error if it doesn't static Result validate(const std::string& _str) noexcept { +#ifdef REFLECTCPP_BUILD_MODULES + if (internal::ctre_match<_regex>(_str)) { +#else if (ctre::match{ - ctll::construct_from_pointer, _regex.arr_.data()}>(_str)) { + ctll::construct_from_pointer_t{}, _regex.arr_.data()}>(_str)) { +#endif return _str; } else { std::stringstream stream; diff --git a/include/rfl/cli/Reader.hpp b/include/rfl/cli/Reader.hpp index 1d46e5d6e..6d62f5626 100644 --- a/include/rfl/cli/Reader.hpp +++ b/include/rfl/cli/Reader.hpp @@ -20,11 +20,11 @@ namespace rfl::cli { /// Character used to separate nested field names in CLI arguments. /// Example: `--database.host` for nested field `database::host`. -static constexpr char path_separator = '.'; +inline constexpr char path_separator = '.'; /// Character used to delimit array elements in CLI argument values. /// Example: `--ports=8080,8081,8082` for an array of ports. -static constexpr char array_delimiter = ','; +inline constexpr char array_delimiter = ','; /// Represents a CLI variable that can be a direct value or a path in the argument map. /// The `path` represents the hierarchical key (e.g., "database.host"). diff --git a/include/rfl/internal/ctre_std.hpp b/include/rfl/internal/ctre_std.hpp new file mode 100644 index 000000000..73f5d4ea7 --- /dev/null +++ b/include/rfl/internal/ctre_std.hpp @@ -0,0 +1,22 @@ +#ifndef RFL_INTERNAL_CTRE_STD_HPP_ +#define RFL_INTERNAL_CTRE_STD_HPP_ + +// Parse CTRE's standard-library dependencies before importing its module. +// This also avoids compiler bugs when headers are included after an import. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/rfl/internal/field_index_from_ptm.hpp b/include/rfl/internal/field_index_from_ptm.hpp index 5377d5817..398c7d696 100644 --- a/include/rfl/internal/field_index_from_ptm.hpp +++ b/include/rfl/internal/field_index_from_ptm.hpp @@ -52,7 +52,7 @@ consteval std::size_t field_index_from_ptm_impl(std::index_sequence) { const void* target = static_cast(&(get_fake_object().*FieldPtr)); std::size_t result = static_cast(-1); - ((static_cast(get_ith_field_from_fake_object()) == target + (void)((static_cast(get_ith_field_from_fake_object()) == target ? (result = Is, true) : false) || ...); diff --git a/include/rfl/internal/get_fake_object.hpp b/include/rfl/internal/get_fake_object.hpp index 27f7fc5b4..35650a540 100644 --- a/include/rfl/internal/get_fake_object.hpp +++ b/include/rfl/internal/get_fake_object.hpp @@ -11,6 +11,7 @@ namespace internal { #endif #ifdef __clang__ +#pragma clang system_header #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wundefined-var-template" #pragma clang diagnostic ignored "-Wundefined-internal" diff --git a/include/rfl/internal/make_tag.hpp b/include/rfl/internal/make_tag.hpp index 6c5d12ddf..46e2027ee 100644 --- a/include/rfl/internal/make_tag.hpp +++ b/include/rfl/internal/make_tag.hpp @@ -14,7 +14,7 @@ namespace rfl::internal { template -static inline auto make_tag(const T& _t) noexcept { +inline auto make_tag(const T& _t) noexcept { if constexpr (internal::has_reflection_type_v) { return make_tag<_discriminator>(_t.reflection()); } else if constexpr (named_tuple_t::Names::template contains< diff --git a/include/rfl/internal/num_fields.hpp b/include/rfl/internal/num_fields.hpp index 39de8b4a8..705851448 100644 --- a/include/rfl/internal/num_fields.hpp +++ b/include/rfl/internal/num_fields.hpp @@ -40,6 +40,8 @@ This is the purpose of get_nested_array_size(). #endif #ifdef __clang__ +// Preserve suppression for the declaration-only probes after module import. +#pragma clang system_header #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wundefined-var-template" #pragma clang diagnostic ignored "-Wundefined-inline" diff --git a/include/rfl/internal/variant/is_alternative_type.hpp b/include/rfl/internal/variant/is_alternative_type.hpp index 2342e2116..15ae8ac87 100644 --- a/include/rfl/internal/variant/is_alternative_type.hpp +++ b/include/rfl/internal/variant/is_alternative_type.hpp @@ -8,7 +8,7 @@ namespace rfl::internal::variant { template -static constexpr bool is_alternative_type() { +constexpr bool is_alternative_type() { return internal::element_index, std::remove_cvref_t...>() != -1; diff --git a/include/rfl/internal/variant/is_convertible_to.hpp b/include/rfl/internal/variant/is_convertible_to.hpp index 8121bf74f..763412eca 100644 --- a/include/rfl/internal/variant/is_convertible_to.hpp +++ b/include/rfl/internal/variant/is_convertible_to.hpp @@ -8,7 +8,7 @@ namespace rfl::internal::variant { template -static constexpr bool is_convertible_to() { +constexpr bool is_convertible_to() { return std::disjunction_v...>; } diff --git a/include/rfl/json/Reader.hpp b/include/rfl/json/Reader.hpp index 0c2f7ad35..75750595d 100644 --- a/include/rfl/json/Reader.hpp +++ b/include/rfl/json/Reader.hpp @@ -1,11 +1,7 @@ #ifndef RFL_JSON_READER_HPP_ #define RFL_JSON_READER_HPP_ -#if __has_include() -#include -#else -#include "../thirdparty/yyjson.h" -#endif +#include "yyjson_helpers.hpp" #include #include @@ -62,7 +58,7 @@ struct Reader { /// @return Result containing the element value, or an error if index is out of bounds rfl::Result get_field_from_array( const size_t _idx, const InputArrayType _arr) const noexcept { - const auto var = InputVarType(yyjson_arr_get(_arr.val_, _idx)); + const auto var = InputVarType(yyjson_detail::yyjson_arr_get(_arr.val_, _idx)); if (!var.val_) { return error("Index " + std::to_string(_idx) + " of of bounds."); } @@ -75,7 +71,7 @@ struct Reader { /// @return Result containing the field value, or an error if field is not found rfl::Result get_field_from_object( const std::string& _name, const InputObjectType _obj) const noexcept { - const auto var = InputVarType(yyjson_obj_get(_obj.val_, _name.c_str())); + const auto var = InputVarType(yyjson_detail::yyjson_obj_get(_obj.val_, _name.c_str())); if (!var.val_) { return error("Object contains no field named '" + _name + "'."); } @@ -86,7 +82,7 @@ struct Reader { /// @param _var The JSON value to check /// @return true if the value is null or not set, false otherwise bool is_empty(const InputVarType _var) const noexcept { - return !_var.val_ || yyjson_is_null(_var.val_); + return !_var.val_ || yyjson_detail::yyjson_is_null(_var.val_); } /// Reads all elements from a JSON array using a provided array reader. @@ -100,8 +96,8 @@ struct Reader { const InputArrayType& _arr) const noexcept { yyjson_val* val; yyjson_arr_iter iter; - yyjson_arr_iter_init(_arr.val_, &iter); - while ((val = yyjson_arr_iter_next(&iter))) { + yyjson_detail::yyjson_arr_iter_init(_arr.val_, &iter); + while ((val = yyjson_detail::yyjson_arr_iter_next(&iter))) { const auto err = _array_reader.read(InputVarType(val)); if (err) { return err; @@ -120,12 +116,12 @@ struct Reader { std::optional read_object(const ObjectReader& _object_reader, const InputObjectType& _obj) const noexcept { yyjson_obj_iter iter; - yyjson_obj_iter_init(_obj.val_, &iter); + yyjson_detail::yyjson_obj_iter_init(_obj.val_, &iter); yyjson_val* key; - while ((key = yyjson_obj_iter_next(&iter))) { + while ((key = yyjson_detail::yyjson_obj_iter_next(&iter))) { const auto name = - std::string_view(yyjson_get_str(key), yyjson_get_len(key)); - _object_reader.read(name, InputVarType(yyjson_obj_iter_get_val(key))); + std::string_view(yyjson_detail::yyjson_get_str(key), yyjson_detail::yyjson_get_len(key)); + _object_reader.read(name, InputVarType(yyjson_detail::yyjson_obj_iter_get_val(key))); } return std::nullopt; } @@ -138,35 +134,35 @@ struct Reader { template rfl::Result to_basic_type(const InputVarType _var) const noexcept { if constexpr (std::is_same, std::string>()) { - const auto r = yyjson_get_str(_var.val_); + const auto r = yyjson_detail::yyjson_get_str(_var.val_); if (r == NULL) { return error("Could not cast to string."); } - return std::string(r, yyjson_get_len(_var.val_)); + return std::string(r, yyjson_detail::yyjson_get_len(_var.val_)); } else if constexpr (std::is_same, bool>()) { - if (!yyjson_is_bool(_var.val_)) { + if (!yyjson_detail::yyjson_is_bool(_var.val_)) { return error("Could not cast to boolean."); } - return yyjson_get_bool(_var.val_); + return yyjson_detail::yyjson_get_bool(_var.val_); } else if constexpr (std::is_floating_point>()) { - if (!yyjson_is_num(_var.val_)) { + if (!yyjson_detail::yyjson_is_num(_var.val_)) { return error("Could not cast to double."); } - return static_cast(yyjson_get_num(_var.val_)); + return static_cast(yyjson_detail::yyjson_get_num(_var.val_)); } else if constexpr (std::is_unsigned>()) { - if (!yyjson_is_uint(_var.val_)) { + if (!yyjson_detail::yyjson_is_uint(_var.val_)) { return error("Could not cast to uint."); } - return static_cast(yyjson_get_uint(_var.val_)); + return static_cast(yyjson_detail::yyjson_get_uint(_var.val_)); } else if constexpr (std::is_integral>()) { - if (!yyjson_is_int(_var.val_)) { + if (!yyjson_detail::yyjson_is_int(_var.val_)) { return error("Could not cast to int."); } - return static_cast(yyjson_get_sint(_var.val_)); + return static_cast(yyjson_detail::yyjson_get_sint(_var.val_)); } else { static_assert(rfl::always_false_v, "Unsupported type."); @@ -177,7 +173,7 @@ struct Reader { /// @param _var The JSON value to convert /// @return Result containing the array, or an error if value is not an array rfl::Result to_array(const InputVarType _var) const noexcept { - if (!yyjson_is_arr(_var.val_)) { + if (!yyjson_detail::yyjson_is_arr(_var.val_)) { return error("Could not cast to array!"); } return InputArrayType(_var.val_); @@ -188,7 +184,7 @@ struct Reader { /// @return Result containing the object, or an error if value is not an object rfl::Result to_object( const InputVarType _var) const noexcept { - if (!yyjson_is_obj(_var.val_)) { + if (!yyjson_detail::yyjson_is_obj(_var.val_)) { return error("Could not cast to object!"); } return InputObjectType(_var.val_); diff --git a/include/rfl/json/Writer.hpp b/include/rfl/json/Writer.hpp index af2f3a501..218e68fe2 100644 --- a/include/rfl/json/Writer.hpp +++ b/include/rfl/json/Writer.hpp @@ -1,11 +1,7 @@ #ifndef RFL_JSON_WRITER_HPP_ #define RFL_JSON_WRITER_HPP_ -#if __has_include() -#include -#else -#include "../thirdparty/yyjson.h" -#endif +#include "yyjson_helpers.hpp" #include #include @@ -88,7 +84,7 @@ class RFL_API Writer { template OutputVarType value_as_root(const T& _var) const noexcept { const auto val = from_basic_type(_var); - yyjson_mut_doc_set_root(doc(), val.val_); + yyjson_detail::yyjson_mut_doc_set_root(doc(), val.val_); return OutputVarType(val); } @@ -135,7 +131,7 @@ class RFL_API Writer { OutputVarType add_value_to_array(const T& _var, OutputArrayType* _parent) const { const auto val = from_basic_type(_var); - const bool ok = yyjson_mut_arr_add_val(_parent->val_, val.val_); + const bool ok = yyjson_detail::yyjson_mut_arr_add_val(_parent->val_, val.val_); if (!ok) { throw std::runtime_error("Could not add value to array."); } @@ -155,8 +151,8 @@ class RFL_API Writer { const T& _var, OutputObjectType* _parent) const { const auto val = from_basic_type(_var); - const bool ok = yyjson_mut_obj_add( - _parent->val_, yyjson_mut_strncpy(doc(), _name.data(), _name.size()), val.val_); + const bool ok = yyjson_detail::yyjson_mut_obj_add( + _parent->val_, yyjson_detail::yyjson_mut_strncpy(doc(), _name.data(), _name.size()), val.val_); if (!ok) { throw std::runtime_error("Could not add field '" + std::string(_name) + "' to object."); @@ -190,19 +186,19 @@ class RFL_API Writer { template OutputVarType from_basic_type(const T& _var) const noexcept { if constexpr (std::is_same, std::string>()) { - return OutputVarType(yyjson_mut_strncpy(doc(), _var.c_str(), _var.size())); + return OutputVarType(yyjson_detail::yyjson_mut_strncpy(doc(), _var.c_str(), _var.size())); } else if constexpr (std::is_same, bool>()) { - return OutputVarType(yyjson_mut_bool(doc(), _var)); + return OutputVarType(yyjson_detail::yyjson_mut_bool(doc(), _var)); } else if constexpr (std::is_floating_point>()) { - return OutputVarType(yyjson_mut_real(doc(), static_cast(_var))); + return OutputVarType(yyjson_detail::yyjson_mut_real(doc(), static_cast(_var))); } else if constexpr (std::is_unsigned>()) { - return OutputVarType(yyjson_mut_uint(doc(), static_cast(_var))); + return OutputVarType(yyjson_detail::yyjson_mut_uint(doc(), static_cast(_var))); } else if constexpr (std::is_integral>()) { - return OutputVarType(yyjson_mut_int(doc(), static_cast(_var))); + return OutputVarType(yyjson_detail::yyjson_mut_int(doc(), static_cast(_var))); } else { static_assert(rfl::always_false_v, "Unsupported type."); diff --git a/include/rfl/json/read.hpp b/include/rfl/json/read.hpp index ad3e47b1e..19c30a891 100644 --- a/include/rfl/json/read.hpp +++ b/include/rfl/json/read.hpp @@ -1,11 +1,7 @@ #ifndef RFL_JSON_READ_HPP_ #define RFL_JSON_READ_HPP_ -#if __has_include() -#include -#else -#include "../thirdparty/yyjson.h" -#endif +#include "yyjson_helpers.hpp" #include #include @@ -43,7 +39,7 @@ auto read(const InputVarType& _obj) { template Result> read( const std::string_view _json_str, const yyjson_read_flag _flag = 0) { - if (_flag & YYJSON_READ_INSITU) { + if (_flag & yyjson_detail::read_insitu) { return error("YYJSON_READ_INSITU is not supported"); } yyjson_read_err err; @@ -54,10 +50,10 @@ Result> read( if (!doc) { return error("Could not parse document: " + std::string(err.msg)); } - yyjson_val* root = yyjson_doc_get_root(doc); + yyjson_val* root = yyjson_detail::yyjson_doc_get_root(doc); const auto r = Reader(); auto res = Parser>::read(r, InputVarType(root)); - yyjson_doc_free(doc); + yyjson_detail::yyjson_doc_free(doc); return res; } diff --git a/include/rfl/json/yyjson_helpers.hpp b/include/rfl/json/yyjson_helpers.hpp new file mode 100644 index 000000000..a9dedfd91 --- /dev/null +++ b/include/rfl/json/yyjson_helpers.hpp @@ -0,0 +1,83 @@ +#ifndef RFL_JSON_YYJSON_HELPERS_HPP_ +#define RFL_JSON_YYJSON_HELPERS_HPP_ + +#if __has_include() +#include +#else +#include "../thirdparty/yyjson.h" +#endif + +#include "../common.hpp" + +namespace rfl::json::yyjson_detail { + +inline constexpr yyjson_read_flag read_insitu = YYJSON_READ_INSITU; + +// Module importers call external wrappers instead of yyjson static functions. +#ifdef REFLECTCPP_BUILD_MODULES +RFL_API yyjson_val *yyjson_arr_get(yyjson_val *arr, size_t idx); +RFL_API bool yyjson_arr_iter_init(yyjson_val *arr, yyjson_arr_iter *iter); +RFL_API yyjson_val *yyjson_arr_iter_next(yyjson_arr_iter *iter); +RFL_API void yyjson_doc_free(yyjson_doc *doc); +RFL_API yyjson_val *yyjson_doc_get_root(yyjson_doc *doc); +RFL_API bool yyjson_get_bool(yyjson_val *val); +RFL_API size_t yyjson_get_len(yyjson_val *val); +RFL_API double yyjson_get_num(yyjson_val *val); +RFL_API int64_t yyjson_get_sint(yyjson_val *val); +RFL_API const char *yyjson_get_str(yyjson_val *val); +RFL_API uint64_t yyjson_get_uint(yyjson_val *val); +RFL_API bool yyjson_is_arr(yyjson_val *val); +RFL_API bool yyjson_is_bool(yyjson_val *val); +RFL_API bool yyjson_is_int(yyjson_val *val); +RFL_API bool yyjson_is_null(yyjson_val *val); +RFL_API bool yyjson_is_num(yyjson_val *val); +RFL_API bool yyjson_is_obj(yyjson_val *val); +RFL_API bool yyjson_is_uint(yyjson_val *val); +RFL_API bool yyjson_mut_arr_add_val(yyjson_mut_val *arr, yyjson_mut_val *val); +RFL_API yyjson_mut_val *yyjson_mut_bool(yyjson_mut_doc *doc, bool val); +RFL_API void yyjson_mut_doc_set_root(yyjson_mut_doc *doc, yyjson_mut_val *root); +RFL_API yyjson_mut_val *yyjson_mut_int(yyjson_mut_doc *doc, int64_t num); +RFL_API bool yyjson_mut_obj_add(yyjson_mut_val *obj, yyjson_mut_val *key, yyjson_mut_val *val); +RFL_API yyjson_mut_val *yyjson_mut_real(yyjson_mut_doc *doc, double num); +RFL_API yyjson_mut_val *yyjson_mut_strncpy(yyjson_mut_doc *doc, const char *str, size_t len); +RFL_API yyjson_mut_val *yyjson_mut_uint(yyjson_mut_doc *doc, uint64_t num); +RFL_API yyjson_val *yyjson_obj_get(yyjson_val *obj, const char *key); +RFL_API yyjson_val *yyjson_obj_iter_get_val(yyjson_val *key); +RFL_API bool yyjson_obj_iter_init(yyjson_val *obj, yyjson_obj_iter *iter); +RFL_API yyjson_val *yyjson_obj_iter_next(yyjson_obj_iter *iter); +#else +using ::yyjson_arr_get; +using ::yyjson_arr_iter_init; +using ::yyjson_arr_iter_next; +using ::yyjson_doc_free; +using ::yyjson_doc_get_root; +using ::yyjson_get_bool; +using ::yyjson_get_len; +using ::yyjson_get_num; +using ::yyjson_get_sint; +using ::yyjson_get_str; +using ::yyjson_get_uint; +using ::yyjson_is_arr; +using ::yyjson_is_bool; +using ::yyjson_is_int; +using ::yyjson_is_null; +using ::yyjson_is_num; +using ::yyjson_is_obj; +using ::yyjson_is_uint; +using ::yyjson_mut_arr_add_val; +using ::yyjson_mut_bool; +using ::yyjson_mut_doc_set_root; +using ::yyjson_mut_int; +using ::yyjson_mut_obj_add; +using ::yyjson_mut_real; +using ::yyjson_mut_strncpy; +using ::yyjson_mut_uint; +using ::yyjson_obj_get; +using ::yyjson_obj_iter_get_val; +using ::yyjson_obj_iter_init; +using ::yyjson_obj_iter_next; +#endif + +} // namespace rfl::json::yyjson_detail + +#endif diff --git a/include/rfl/parsing/is_empty.hpp b/include/rfl/parsing/is_empty.hpp index 41d5b8511..d14d0ea37 100644 --- a/include/rfl/parsing/is_empty.hpp +++ b/include/rfl/parsing/is_empty.hpp @@ -21,7 +21,7 @@ namespace parsing { * @return True if the variable is empty, false otherwise. */ template -static bool is_empty(const T& _var) { +inline bool is_empty(const T& _var) { using Type = std::remove_cvref_t; if constexpr (std::is_pointer_v) { return !_var || is_empty(*_var); diff --git a/include/rfl/parsing/make_type_name.hpp b/include/rfl/parsing/make_type_name.hpp index 35e9a554b..9fa62f7bc 100644 --- a/include/rfl/parsing/make_type_name.hpp +++ b/include/rfl/parsing/make_type_name.hpp @@ -26,7 +26,7 @@ inline std::string replace_non_alphanumeric(std::string _str) { * @return The type name. */ template -static std::string make_type_name() { +inline std::string make_type_name() { if constexpr (is_tagged_union_wrapper_v) { return replace_non_alphanumeric(type_name_t().str() + "__tagged"); diff --git a/modules/rfl.ctre.cppm b/modules/rfl.ctre.cppm new file mode 100644 index 000000000..8d0b7d24d --- /dev/null +++ b/modules/rfl.ctre.cppm @@ -0,0 +1,20 @@ +module; + +#include "rfl/internal/ctre_std.hpp" + +export module rfl.ctre; + +// Keep CTRE's implementation in this module; only the rfl adapter is exported. +#if __has_include() +#include +#else +#include "rfl/thirdparty/ctre.hpp" +#endif + +export namespace rfl::internal { +template +bool ctre_match(const std::string& value) { + return static_cast(ctre::match{ + ctll::construct_from_pointer_t{}, Regex.arr_.data()}>(value)); +} +} diff --git a/scripts/check_pch_modules.py b/scripts/check_pch_modules.py new file mode 100644 index 000000000..41495d783 --- /dev/null +++ b/scripts/check_pch_modules.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python3 +"""Compare PCH on/off for the same module importer across Clang versions.""" + +import argparse +import json +from pathlib import Path +import shlex +import shutil +import subprocess +import time + + +ROOT = Path(__file__).resolve().parents[1] +SOURCE = 'tests/json/test_add_namespaced_tags_to_rfl_variants.cpp' +TARGET = 'tests/json/CMakeFiles/reflect-cpp-json-tests.dir/test_add_namespaced_tags_to_rfl_variants.cpp.o' + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--compiler', action='append', help='repeatable Clang executable') + parser.add_argument('--build-root', default='build/pch-matrix') + parser.add_argument('--jobs', type=int, default=3) + parser.add_argument('--pch', choices=('ON', 'OFF', 'BOTH'), default='BOTH') + parser.add_argument('--full', action='store_true', help='also build and run the full JSON/CLI tests') + args = parser.parse_args() + compilers = args.compiler or [f'clang++-{version}' for version in range(19, 23)] + output = ROOT / args.build_root + output.mkdir(parents=True, exist_ok=True) + results = [] + for compiler in compilers: + executable = shutil.which(compiler) + if executable is None: + results.append(dict(compiler=compiler, status='missing')) + continue + version = subprocess.check_output([executable, '--version'], text=True).splitlines()[0] + for pch in (('ON', 'OFF') if args.pch == 'BOTH' else (args.pch,)): + label = f'{Path(compiler).name}-pch-{pch}' + build = output / label + commands = [ + ['cmake', '-S', str(ROOT), '-B', str(build), '-G', 'Ninja', + f'-DCMAKE_CXX_COMPILER={executable}', + f'-DCMAKE_C_COMPILER={executable.replace("clang++", "clang")}', + '-DCMAKE_CXX_STANDARD=20', '-DCMAKE_BUILD_TYPE=Release', + '-DREFLECTCPP_USE_VCPKG=OFF', '-DREFLECTCPP_BUILD_TESTS=ON', + '-DREFLECTCPP_BUILD_MODULES=ON', + f'-DCMAKE_DISABLE_PRECOMPILE_HEADERS={"OFF" if pch == "ON" else "ON"}'], + ['cmake', '--build', str(build), '--target', TARGET, f'-j{args.jobs}'], + ] + if args.full: + commands += [ + ['cmake', '--build', str(build), f'-j{args.jobs}'], + ['ctest', '--test-dir', str(build), '--output-on-failure', + '--no-tests=error', f'-j{args.jobs}'], + ] + result = dict(compiler=compiler, version=version, pch=pch, + source=SOURCE, scope='full' if args.full else 'importer', + status='passed', log=str(output / f'{label}{"-full" if args.full else ""}.log')) + started = time.monotonic() + print(f'Running {label}: {version}', flush=True) + with Path(result['log']).open('w') as log: + log.write(version + '\n') + for command in commands: + log.write('$ ' + shlex.join(command) + '\n') + log.flush() + code = subprocess.call(command, cwd=ROOT, stdout=log, stderr=subprocess.STDOUT) + if code: + result.update(status='failed', exit_code=code, command=command) + break + database = build / 'compile_commands.json' + if database.exists(): + entry = next((entry for entry in json.loads(database.read_text()) + if entry['file'] == str(ROOT / SOURCE)), None) + if entry: + result['compile_command'] = entry['command'] + result['pch_in_command'] = '-include-pch' in entry['command'] + result['seconds'] = round(time.monotonic() - started, 1) + results.append(result) + if build.exists(): + individual = build / ('full-result.json' if args.full else 'pch-result.json') + individual.write_text(json.dumps(result, indent=2) + '\n') + report = output / ('full-results.json' if args.full else 'results.json') + report.write_text(json.dumps(results, indent=2) + '\n') + print(f'{label}: {result["status"]} ({result["seconds"]}s)', flush=True) + report = output / ('full-results.json' if args.full else 'results.json') + report.write_text(json.dumps(results, indent=2) + '\n') + return int(any(result['status'] != 'passed' for result in results)) + + +if __name__ == '__main__': + raise SystemExit(main()) diff --git a/scripts/ci/Containerfile b/scripts/ci/Containerfile new file mode 100644 index 000000000..53d9388c6 --- /dev/null +++ b/scripts/ci/Containerfile @@ -0,0 +1,29 @@ +FROM ubuntu:24.04 +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get update && apt-get install -y --no-install-recommends \ + ca-certificates curl git zip unzip tar pkg-config python3 python3-yaml \ + python3-venv ninja-build build-essential \ + g++-11 g++-12 g++-13 g++-14 \ + clang-16 clang-tools-16 clang-17 clang-tools-17 clang-18 clang-tools-18 \ + clang-19 clang-tools-19 \ + libgtest-dev libyaml-cpp-dev libtomlplusplus-dev libpugixml-dev \ + libboost-serialization-dev libmsgpack-dev libflatbuffers-dev libcereal-dev \ + && rm -rf /var/lib/apt/lists/* +ARG EXTRA_CLANG_VERSIONS="" +RUN if [ -n "$EXTRA_CLANG_VERSIONS" ]; then \ + mkdir -p /etc/apt/keyrings && \ + curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key -o /etc/apt/keyrings/llvm.asc && \ + for version in $EXTRA_CLANG_VERSIONS; do \ + if [ "$version" -ge 20 ]; then \ + printf 'deb [signed-by=/etc/apt/keyrings/llvm.asc] https://apt.llvm.org/noble/ llvm-toolchain-noble-%s main\n' "$version" >> /etc/apt/sources.list.d/llvm.list; \ + fi; \ + done && \ + apt-get update && \ + for version in $EXTRA_CLANG_VERSIONS; do \ + apt-get install -y --no-install-recommends "clang-$version" "clang-tools-$version" || exit 1; \ + done && \ + rm -rf /var/lib/apt/lists/*; \ + fi +RUN python3 -m venv --system-site-packages /opt/ci && /opt/ci/bin/pip install --no-cache-dir cmake==3.31.6 +ENV PATH="/opt/ci/bin:${PATH}" +WORKDIR /work diff --git a/scripts/ci/README.md b/scripts/ci/README.md new file mode 100644 index 000000000..3f4f31bd6 --- /dev/null +++ b/scripts/ci/README.md @@ -0,0 +1,111 @@ +# Local Linux CI + +`scripts/ci_matrix.py` expands the axes and exclusions in +`.github/workflows/linux.yaml`. Each job has its own build directory and log under +`build/local-ci`; the last invocation writes `results.json`. Failed jobs do not +stop the remaining jobs. The runner returns a nonzero exit code on any failure. + +Install Python 3 and PyYAML on the host. List jobs without building: + +```sh +python3 scripts/ci_matrix.py --list +python3 scripts/ci_matrix.py --list --modules ON +``` + +## Ubuntu 24.04 container + +Build once with Podman (or replace `podman` with `docker`): + +```sh +podman build -f scripts/ci/Containerfile -t reflectcpp-ci . +git submodule update --init --recursive +``` + +The image provides GCC 11–14, Clang 16–19, their dependency scanners, Ninja, +CMake 3.31.6, and several system dependencies. By default the runner uses the +repository's pinned vcpkg submodule, like CI. The source tree and build cache +remain on the host. First-time vcpkg dependency builds require network access. + +```sh +python3 scripts/ci_matrix.py --container reflectcpp-ci \ + --compiler gcc-14 --compiler llvm-19 --format JSON --cxx 20 --modules ON + +# Original header compatibility matrix, followed by module-capable jobs: +python3 scripts/ci_matrix.py --container reflectcpp-ci +python3 scripts/ci_matrix.py --container reflectcpp-ci --modules ON +``` + +Use `--runtime docker` for Docker. Builds use four parallel tasks by default; +use `--jobs 2` on machines with limited memory. The matrix runs jobs sequentially +to bound memory usage and share dependency caches. + +## Native compiler or system dependencies + +```sh +python3 scripts/ci_matrix.py --compiler llvm-19 --format YAML --cxx 20 \ + --modules ON --system-deps +``` + +For testing a newer native compiler against a selected CI configuration: + +```sh +python3 scripts/ci_matrix.py --compiler llvm-19 --cxx-executable clang++ \ + --format JSON --cxx 20 --modules ON --system-deps +``` + +The log and JSON report record the actual compiler. Such overrides and system +packages are useful for debugging, but do not reproduce the original compiler +and dependency versions. Missing compilers fail by default; `--allow-missing` +records them as skipped instead. Windows/MSVC and AppleClang jobs need their +respective operating systems and are not emulated by this Linux runner. + +## Module support + +Enable module interfaces with `-DREFLECTCPP_BUILD_MODULES=ON`. Header builds are +the default. CMake generates test adapters under `/tests/test_rfl` containing either +imports or includes, so both modes exercise the same test bodies without test +preprocessor switches. C arrays/inheritance use +their own module because their macro changes the compiled declarations. + +CMake's scanning floor is GCC 14, Clang 16, or MSVC 14.34, with Ninja 1.11+ or a +supported Visual Studio generator. These are build-system requirements, not a +guarantee that a compiler implements every module feature or can compile this +library and its dependencies. In particular, `import std` has different +requirements and is not used by these module interfaces. + +This project's Clang module builds require Clang 19 or newer. Clang 18 and older +remain in the header-build compatibility matrix. Clang 18 module importers fail +with PCH enabled, so that combination is no longer supported. Library and test +PCH remain enabled by default; `-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON` can disable +them explicitly. Module interface sources keep `SKIP_PRECOMPILE_HEADERS` because +their global module fragments must precede declarations. + +Sources: [CMake 3.31](https://cmake.org/cmake/help/v3.31/manual/cmake-cxxmodules.7.html), +[GCC 14](https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/C_002b_002b-Modules.html), +[Clang status](https://clang.llvm.org/cxx_status.html). + +## Compare PCH and modules + +Build the optional Clang 20–22 toolchains alongside Clang 19, then run the same JSON module importer +with PCH explicitly enabled and disabled for each compiler: + +```sh +podman build -f scripts/ci/Containerfile --build-arg 'EXTRA_CLANG_VERSIONS=20 21 22' -t reflectcpp-pch-ci . +podman run --rm --userns=keep-id -v "$PWD:/work" -w /work reflectcpp-pch-ci \ + python3 scripts/check_pch_modules.py +``` + +Repeat `--compiler clang++-19` (or another supported installed executable) to select +versions. Results, compiler versions, compile commands, and individual logs are +written to `build/pch-matrix`. This is a focused compilation check for the PCH +failure, not the full test matrix; add `--pch ON --full` to also build and run +the complete JSON/CLI tests. + +Verified on Ubuntu 24.04 with libstdc++ 14, CMake 3.31.6, and C++20: + +| Clang | PCH ON/OFF importer check | Full JSON/CLI tests with PCH ON | +| --- | --- | --- | +| 19.1.1 | Both passed | 341 passed, 1 locale test skipped | +| 20.1.8 | Both passed | 341 passed, 1 locale test skipped | +| 21.1.8 | Both passed | 341 passed, 1 locale test skipped | +| 22.1.8 | Both passed | 341 passed, 1 locale test skipped | diff --git a/scripts/ci_matrix.py b/scripts/ci_matrix.py new file mode 100644 index 000000000..9d130aa1c --- /dev/null +++ b/scripts/ci_matrix.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python3 +"""Run selected Linux CI jobs locally, retaining separate build trees and logs.""" + +import argparse +import itertools +import json +from pathlib import Path +import shlex +import shutil +import subprocess +import sys +import time + +import yaml + + +ROOT = Path(__file__).resolve().parents[1] + + +def matrix_jobs(): + workflow = yaml.safe_load((ROOT / '.github/workflows/linux.yaml').read_text()) + matrix = workflow['jobs']['linux']['strategy']['matrix'] + axes = {key: value for key, value in matrix.items() if key not in ('exclude', 'include')} + jobs = [] + for values in itertools.product(*axes.values()): + job = dict(zip(axes, values)) + if not any(all(job.get(k) == v for k, v in rule.items()) for rule in matrix.get('exclude', [])): + jobs.append(job) + jobs.extend(matrix.get('include', [])) + return jobs + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--list', action='store_true', help='print selected jobs without running them') + parser.add_argument('--compiler', action='append', help='filter, e.g. gcc-14 or llvm-19; repeatable') + parser.add_argument('--format', action='append', help='filter formats; repeatable') + parser.add_argument('--cxx', type=int, choices=(20, 23), help='filter language standard') + parser.add_argument('--modules', choices=('ON', 'OFF'), default='OFF') + parser.add_argument('--cxx-executable', help='override compiler for a single selected compiler family/version') + parser.add_argument('--system-deps', action='store_true', help='use system packages instead of CI vcpkg') + parser.add_argument('--jobs', type=int, default=4, help='parallel build and test jobs') + parser.add_argument('--container', help='run inside this prebuilt Ubuntu image') + parser.add_argument('--build-root', default='build/local-ci/native', help='directory for builds, logs and results') + parser.add_argument('--runtime', default='podman', choices=('podman', 'docker')) + parser.add_argument('--allow-missing', action='store_true', help='record missing compilers as skipped') + args = parser.parse_args() + if args.jobs < 1: + parser.error('--jobs must be positive') + if args.cxx_executable and (not args.compiler or len(args.compiler) != 1): + parser.error('--cxx-executable requires exactly one --compiler filter') + if args.container: + forwarded = sys.argv[1:] + for flag in ('--container', '--runtime'): + if flag in forwarded: + index = forwarded.index(flag) + del forwarded[index:index + 2] + forwarded = [arg for arg in forwarded if not arg.startswith(flag + '=')] + return subprocess.call([ + args.runtime, 'run', '--rm', *(['--userns=keep-id'] if args.runtime == 'podman' else []), + '-v', f'{ROOT}:/work', '-w', '/work', + '-e', 'VCPKG_BINARY_SOURCES=clear;files,/work/build/local-ci/vcpkg-cache,readwrite', + args.container, 'python3', 'scripts/ci_matrix.py', *forwarded, + '--build-root', 'build/local-ci/container', + ]) + + selected = [] + for job in matrix_jobs(): + if job.get('modules', 'OFF') != args.modules: + continue + compiler = f"{job['compiler']}-{job['compiler-version']}" + if args.compiler and compiler not in args.compiler: + continue + if args.format and job['format'] not in args.format: + continue + if args.cxx and job['cxx'] != args.cxx: + continue + if args.modules == 'ON' and job['compiler-version'] < (14 if job['compiler'] == 'gcc' else 19): + continue + selected.append((job, compiler)) + if not selected: + parser.error('no matching jobs (module jobs require GCC 14+ or Clang 19+)') + if args.list: + for job, compiler in selected: + print(f"{job['format']}-cxx{job['cxx']}-{compiler}-modules-{args.modules}") + print(f'{len(selected)} jobs') + return 0 + + output = ROOT / args.build_root + output.mkdir(parents=True, exist_ok=True) + results = [] + for job, compiler in selected: + label = f"{job['format']}-cxx{job['cxx']}-{compiler}-modules-{args.modules}" + cxx = args.cxx_executable or f"{'g++' if job['compiler'] == 'gcc' else 'clang++'}-{job['compiler-version']}" + result = dict(job=label, compiler=cxx, dependency_mode='system' if args.system_deps else 'vcpkg') + results.append(result) + if not shutil.which(cxx): + result['status'] = 'skipped' if args.allow_missing else 'failed' + result['reason'] = f'compiler not found: {cxx}' + print(f"{label}: {result['reason']}", flush=True) + continue + build = output / label + flags = [f'-DCMAKE_CXX_COMPILER={shutil.which(cxx)}', f"-DCMAKE_CXX_STANDARD={job['cxx']}", + '-DCMAKE_BUILD_TYPE=Release', f'-DREFLECTCPP_BUILD_MODULES={args.modules}', + f"-DREFLECTCPP_USE_VCPKG={'OFF' if args.system_deps else 'ON'}"] + cc = cxx.replace('clang++', 'clang').replace('g++', 'gcc') + if cc != cxx and shutil.which(cc): + flags.append(f'-DCMAKE_C_COMPILER={shutil.which(cc)}') + fmt = job['format'] + if fmt == 'benchmarks': + flags += ['-DREFLECTCPP_BUILD_BENCHMARKS=ON', '-DREFLECTCPP_ALL_FORMATS=ON'] + elif fmt == 'headers': + flags += ['-DREFLECTCPP_CHECK_HEADERS=ON'] + else: + flags += ['-DREFLECTCPP_BUILD_TESTS=ON'] + if fmt != 'JSON': + flags += ['-DREFLECTCPP_JSON=OFF', f'-DREFLECTCPP_{fmt}=ON'] + commands = [[cxx, '--version'], ['cmake', '-S', str(ROOT), '-B', str(build), '-G', 'Ninja', *flags], + ['cmake', '--build', str(build), f'-j{args.jobs}']] + if fmt not in ('benchmarks', 'headers'): + commands.append(['ctest', '--test-dir', str(build), '--output-on-failure', '--no-tests=error', f'-j{args.jobs}']) + if fmt == 'benchmarks': + for kind in ('all', 'json'): + filters = ('canada_read', 'canada_write', 'licenses_read', 'licenses_write', 'person_read', 'person_write') if kind == 'all' else ('person_read', 'canada', 'licenses') + for benchmark_filter in filters: + commands.append([str(build / f'benchmarks/{kind}/reflect-cpp-{kind}-format-benchmarks') if kind == 'all' else str(build / 'benchmarks/json/reflect-cpp-json-benchmarks'), f'--benchmark_filter={benchmark_filter}']) + started = time.monotonic() + print(f'Running {label} with {cxx}', flush=True) + with (output / f'{label}.log').open('w') as log: + for command in commands: + log.write('$ ' + shlex.join(command) + '\n') + log.flush() + try: + code = subprocess.call(command, cwd=ROOT, stdout=log, stderr=subprocess.STDOUT) + except OSError as error: + log.write(str(error) + '\n') + code = 127 + if code: + result.update(status='failed', command=command, exit_code=code) + break + else: + result['status'] = 'passed' + result['seconds'] = round(time.monotonic() - started, 1) + result['log'] = str(output / f'{label}.log') + (output / 'results.json').write_text(json.dumps(results, indent=2) + '\n') + print(f"{label}: {result['status']} ({result['seconds']}s); {result['log']}", flush=True) + (output / 'results.json').write_text(json.dumps(results, indent=2) + '\n') + return int(any(result['status'] == 'failed' for result in results)) + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/reflectcpp_yyjson_helpers.cpp b/src/reflectcpp_yyjson_helpers.cpp new file mode 100644 index 000000000..c8cb335c2 --- /dev/null +++ b/src/reflectcpp_yyjson_helpers.cpp @@ -0,0 +1,125 @@ +#include "rfl/json/yyjson_helpers.hpp" + +namespace rfl::json::yyjson_detail { + +yyjson_val *yyjson_arr_get(yyjson_val *arr, size_t idx) { + return ::yyjson_arr_get(arr, idx); +} + +bool yyjson_arr_iter_init(yyjson_val *arr, yyjson_arr_iter *iter) { + return ::yyjson_arr_iter_init(arr, iter); +} + +yyjson_val *yyjson_arr_iter_next(yyjson_arr_iter *iter) { + return ::yyjson_arr_iter_next(iter); +} + +void yyjson_doc_free(yyjson_doc *doc) { + return ::yyjson_doc_free(doc); +} + +yyjson_val *yyjson_doc_get_root(yyjson_doc *doc) { + return ::yyjson_doc_get_root(doc); +} + +bool yyjson_get_bool(yyjson_val *val) { + return ::yyjson_get_bool(val); +} + +size_t yyjson_get_len(yyjson_val *val) { + return ::yyjson_get_len(val); +} + +double yyjson_get_num(yyjson_val *val) { + return ::yyjson_get_num(val); +} + +int64_t yyjson_get_sint(yyjson_val *val) { + return ::yyjson_get_sint(val); +} + +const char *yyjson_get_str(yyjson_val *val) { + return ::yyjson_get_str(val); +} + +uint64_t yyjson_get_uint(yyjson_val *val) { + return ::yyjson_get_uint(val); +} + +bool yyjson_is_arr(yyjson_val *val) { + return ::yyjson_is_arr(val); +} + +bool yyjson_is_bool(yyjson_val *val) { + return ::yyjson_is_bool(val); +} + +bool yyjson_is_int(yyjson_val *val) { + return ::yyjson_is_int(val); +} + +bool yyjson_is_null(yyjson_val *val) { + return ::yyjson_is_null(val); +} + +bool yyjson_is_num(yyjson_val *val) { + return ::yyjson_is_num(val); +} + +bool yyjson_is_obj(yyjson_val *val) { + return ::yyjson_is_obj(val); +} + +bool yyjson_is_uint(yyjson_val *val) { + return ::yyjson_is_uint(val); +} + +bool yyjson_mut_arr_add_val(yyjson_mut_val *arr, yyjson_mut_val *val) { + return ::yyjson_mut_arr_add_val(arr, val); +} + +yyjson_mut_val *yyjson_mut_bool(yyjson_mut_doc *doc, bool val) { + return ::yyjson_mut_bool(doc, val); +} + +void yyjson_mut_doc_set_root(yyjson_mut_doc *doc, yyjson_mut_val *root) { + return ::yyjson_mut_doc_set_root(doc, root); +} + +yyjson_mut_val *yyjson_mut_int(yyjson_mut_doc *doc, int64_t num) { + return ::yyjson_mut_int(doc, num); +} + +bool yyjson_mut_obj_add(yyjson_mut_val *obj, yyjson_mut_val *key, yyjson_mut_val *val) { + return ::yyjson_mut_obj_add(obj, key, val); +} + +yyjson_mut_val *yyjson_mut_real(yyjson_mut_doc *doc, double num) { + return ::yyjson_mut_real(doc, num); +} + +yyjson_mut_val *yyjson_mut_strncpy(yyjson_mut_doc *doc, const char *str, size_t len) { + return ::yyjson_mut_strncpy(doc, str, len); +} + +yyjson_mut_val *yyjson_mut_uint(yyjson_mut_doc *doc, uint64_t num) { + return ::yyjson_mut_uint(doc, num); +} + +yyjson_val *yyjson_obj_get(yyjson_val *obj, const char *key) { + return ::yyjson_obj_get(obj, key); +} + +yyjson_val *yyjson_obj_iter_get_val(yyjson_val *key) { + return ::yyjson_obj_iter_get_val(key); +} + +bool yyjson_obj_iter_init(yyjson_val *obj, yyjson_obj_iter *iter) { + return ::yyjson_obj_iter_init(obj, iter); +} + +yyjson_val *yyjson_obj_iter_next(yyjson_obj_iter *iter) { + return ::yyjson_obj_iter_next(iter); +} + +} // namespace rfl::json::yyjson_detail diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 11fa767f6..8f6ad3334 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,24 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O2") +# Generate one adapter for each enabled module. The same test sources can then +# exercise either headers or module imports without preprocessor switches. +foreach(MODULE_FILE IN LISTS REFLECT_CPP_MODULES) + get_filename_component(MODULE_NAME "${MODULE_FILE}" NAME_WLE) + if(REFLECTCPP_BUILD_MODULES) + set(REFLECTCPP_TEST_DEPENDENCY "import ${MODULE_NAME};") + elseif(MODULE_NAME STREQUAL "rfl") + set(REFLECTCPP_TEST_DEPENDENCY "#include \n#include \n#include ") + elseif(MODULE_NAME STREQUAL "rfl.c_arrays_and_inheritance") + set(REFLECTCPP_TEST_DEPENDENCY "#define REFLECT_CPP_C_ARRAYS_OR_INHERITANCE\n#include \n#include \n#include ") + elseif(MODULE_NAME STREQUAL "rfl.ctre") + continue() + else() + string(REPLACE "." "/" HEADER_NAME "${MODULE_NAME}") + set(REFLECTCPP_TEST_DEPENDENCY "#include <${HEADER_NAME}.hpp>") + endif() + configure_file(test_rfl.hpp.in "test_rfl/${MODULE_NAME}.hpp" @ONLY) +endforeach() + # Note: Adding -Wno-stringop-overflow is necessary, because of false positive warnings, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110498 if (MSVC) # /utf-8 tells MSVC the test sources are UTF-8 (default is the system code diff --git a/tests/avro/test_add_struct_name.cpp b/tests/avro/test_add_struct_name.cpp index 658e652d8..aebc85e43 100644 --- a/tests/avro/test_add_struct_name.cpp +++ b/tests/avro/test_add_struct_name.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.avro; +#include namespace test_add_struct_name { diff --git a/tests/avro/test_array.cpp b/tests/avro/test_array.cpp index 45f68665a..9cc5d35d5 100644 --- a/tests/avro/test_array.cpp +++ b/tests/avro/test_array.cpp @@ -5,11 +5,12 @@ // Make sure things still compile when // rfl.hpp is included after rfl/avro.hpp. -#include "write_and_read.hpp" #include -import rfl; -import rfl.avro; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/avro/test_box.cpp b/tests/avro/test_box.cpp index 4e861ad3a..b481821be 100644 --- a/tests/avro/test_box.cpp +++ b/tests/avro/test_box.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.avro; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/avro/test_bytestring.cpp b/tests/avro/test_bytestring.cpp index 106c4daf5..9568cda45 100644 --- a/tests/avro/test_bytestring.cpp +++ b/tests/avro/test_bytestring.cpp @@ -1,9 +1,10 @@ -#include "write_and_read.hpp" #include -import rfl.avro; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_bytestring { diff --git a/tests/avro/test_combined_processors.cpp b/tests/avro/test_combined_processors.cpp index 1c572b2e0..8db8a1f08 100644 --- a/tests/avro/test_combined_processors.cpp +++ b/tests/avro/test_combined_processors.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.avro; +#include namespace test_combined_processors { diff --git a/tests/avro/test_custom_class1.cpp b/tests/avro/test_custom_class1.cpp index 1da15c3cb..eda3f7967 100644 --- a/tests/avro/test_custom_class1.cpp +++ b/tests/avro/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_custom_class1 { diff --git a/tests/avro/test_custom_class3.cpp b/tests/avro/test_custom_class3.cpp index 9554a90f4..c6ce30872 100644 --- a/tests/avro/test_custom_class3.cpp +++ b/tests/avro/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_custom_class3 { diff --git a/tests/avro/test_custom_class4.cpp b/tests/avro/test_custom_class4.cpp index 4a4b73566..615f0121f 100644 --- a/tests/avro/test_custom_class4.cpp +++ b/tests/avro/test_custom_class4.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_custom_class4 { diff --git a/tests/avro/test_default_values.cpp b/tests/avro/test_default_values.cpp index 68af5aab8..8cac15415 100644 --- a/tests/avro/test_default_values.cpp +++ b/tests/avro/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_default_values { diff --git a/tests/avro/test_deque.cpp b/tests/avro/test_deque.cpp index 054c5a6e0..75be97db3 100644 --- a/tests/avro/test_deque.cpp +++ b/tests/avro/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.avro; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/avro/test_enum.cpp b/tests/avro/test_enum.cpp index 355d42825..c944bb930 100644 --- a/tests/avro/test_enum.cpp +++ b/tests/avro/test_enum.cpp @@ -1,9 +1,9 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; -import rfl.json; +#include +#include +#include namespace test_enum { diff --git a/tests/avro/test_field_variant.cpp b/tests/avro/test_field_variant.cpp index ead6c6d74..dd71360d6 100644 --- a/tests/avro/test_field_variant.cpp +++ b/tests/avro/test_field_variant.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_field_variant { diff --git a/tests/avro/test_field_variant_std.cpp b/tests/avro/test_field_variant_std.cpp index 0237a7301..c17006060 100644 --- a/tests/avro/test_field_variant_std.cpp +++ b/tests/avro/test_field_variant_std.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.avro; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_field_variant_std { diff --git a/tests/avro/test_flag_enum.cpp b/tests/avro/test_flag_enum.cpp index a0fa270be..7d8c2e315 100644 --- a/tests/avro/test_flag_enum.cpp +++ b/tests/avro/test_flag_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_flag_enum { diff --git a/tests/avro/test_flag_enum_with_int.cpp b/tests/avro/test_flag_enum_with_int.cpp index 53c24bb5b..c73bfd774 100644 --- a/tests/avro/test_flag_enum_with_int.cpp +++ b/tests/avro/test_flag_enum_with_int.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/avro/test_flatten.cpp b/tests/avro/test_flatten.cpp index 675f6e960..8592506a2 100644 --- a/tests/avro/test_flatten.cpp +++ b/tests/avro/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_flatten { diff --git a/tests/avro/test_flatten_anonymous.cpp b/tests/avro/test_flatten_anonymous.cpp index fb20815db..1db3880cc 100644 --- a/tests/avro/test_flatten_anonymous.cpp +++ b/tests/avro/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/avro/test_float_and_int.cpp b/tests/avro/test_float_and_int.cpp index 1558e04ee..fba8464eb 100644 --- a/tests/avro/test_float_and_int.cpp +++ b/tests/avro/test_float_and_int.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.avro; +#include namespace test_float_and_int { diff --git a/tests/avro/test_forward_list.cpp b/tests/avro/test_forward_list.cpp index 9bafab81e..4891b53bc 100644 --- a/tests/avro/test_forward_list.cpp +++ b/tests/avro/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.avro; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/avro/test_literal.cpp b/tests/avro/test_literal.cpp index 55535f90a..a05eb4b26 100644 --- a/tests/avro/test_literal.cpp +++ b/tests/avro/test_literal.cpp @@ -2,9 +2,9 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; -import rfl.json; +#include +#include +#include namespace test_literal { diff --git a/tests/avro/test_literal_map.cpp b/tests/avro/test_literal_map.cpp index fca66cda8..342f257b2 100644 --- a/tests/avro/test_literal_map.cpp +++ b/tests/avro/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_literal_map { diff --git a/tests/avro/test_map.cpp b/tests/avro/test_map.cpp index 0217b05d0..4ad214f3e 100644 --- a/tests/avro/test_map.cpp +++ b/tests/avro/test_map.cpp @@ -1,13 +1,14 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl.avro; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_map { diff --git a/tests/avro/test_map2.cpp b/tests/avro/test_map2.cpp index ae781ba62..34117cbca 100644 --- a/tests/avro/test_map2.cpp +++ b/tests/avro/test_map2.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.avro; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_map2 { diff --git a/tests/avro/test_monster_example.cpp b/tests/avro/test_monster_example.cpp index ebf912b0f..1480865a6 100644 --- a/tests/avro/test_monster_example.cpp +++ b/tests/avro/test_monster_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_monster_example { diff --git a/tests/avro/test_optional_fields.cpp b/tests/avro/test_optional_fields.cpp index 9325cfb0f..cbedefa41 100644 --- a/tests/avro/test_optional_fields.cpp +++ b/tests/avro/test_optional_fields.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.avro; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_optional_fields { diff --git a/tests/avro/test_readme_example.cpp b/tests/avro/test_readme_example.cpp index 310aa6848..a2ee81172 100644 --- a/tests/avro/test_readme_example.cpp +++ b/tests/avro/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_readme_example { diff --git a/tests/avro/test_readme_example2.cpp b/tests/avro/test_readme_example2.cpp index 635d53ba6..a2fbf7472 100644 --- a/tests/avro/test_readme_example2.cpp +++ b/tests/avro/test_readme_example2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_readme_example2 { diff --git a/tests/avro/test_readme_example3.cpp b/tests/avro/test_readme_example3.cpp index a2520ae7e..33fe4e802 100644 --- a/tests/avro/test_readme_example3.cpp +++ b/tests/avro/test_readme_example3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_readme_example3 { diff --git a/tests/avro/test_ref.cpp b/tests/avro/test_ref.cpp index d2627475c..ec3b3323e 100644 --- a/tests/avro/test_ref.cpp +++ b/tests/avro/test_ref.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.avro; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/avro/test_regression_bugs.cpp b/tests/avro/test_regression_bugs.cpp index e7de26ed0..56c9ce987 100644 --- a/tests/avro/test_regression_bugs.cpp +++ b/tests/avro/test_regression_bugs.cpp @@ -2,8 +2,8 @@ #include #include -import rfl; -import rfl.avro; +#include +#include diff --git a/tests/avro/test_rfl_tuple.cpp b/tests/avro/test_rfl_tuple.cpp index 7edac2f33..009d0de83 100644 --- a/tests/avro/test_rfl_tuple.cpp +++ b/tests/avro/test_rfl_tuple.cpp @@ -2,12 +2,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.avro; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_rfl_tuple { diff --git a/tests/avro/test_rfl_variant.cpp b/tests/avro/test_rfl_variant.cpp index 77554f4fa..050ab5723 100644 --- a/tests/avro/test_rfl_variant.cpp +++ b/tests/avro/test_rfl_variant.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.avro; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/avro/test_save_load.cpp b/tests/avro/test_save_load.cpp index a2c9adc15..4ddc87023 100644 --- a/tests/avro/test_save_load.cpp +++ b/tests/avro/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include -import rfl; -import rfl.avro; +#include +#include namespace test_save_load { diff --git a/tests/avro/test_set.cpp b/tests/avro/test_set.cpp index 5a07ded92..dc504354b 100644 --- a/tests/avro/test_set.cpp +++ b/tests/avro/test_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.avro; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/avro/test_shared_ptr.cpp b/tests/avro/test_shared_ptr.cpp index e1558a93a..7bb7960a9 100644 --- a/tests/avro/test_shared_ptr.cpp +++ b/tests/avro/test_shared_ptr.cpp @@ -2,12 +2,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.avro; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_shared_ptr { diff --git a/tests/avro/test_size.cpp b/tests/avro/test_size.cpp index 598ac887a..dfbe2e4b7 100644 --- a/tests/avro/test_size.cpp +++ b/tests/avro/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_size { diff --git a/tests/avro/test_snake_case_to_camel_case.cpp b/tests/avro/test_snake_case_to_camel_case.cpp index 8b3e65608..5406b00d3 100644 --- a/tests/avro/test_snake_case_to_camel_case.cpp +++ b/tests/avro/test_snake_case_to_camel_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.avro; +#include namespace test_snake_case_to_camel_case { diff --git a/tests/avro/test_snake_case_to_pascal_case.cpp b/tests/avro/test_snake_case_to_pascal_case.cpp index 99fbc5a53..728bd6627 100644 --- a/tests/avro/test_snake_case_to_pascal_case.cpp +++ b/tests/avro/test_snake_case_to_pascal_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.avro; +#include namespace test_snake_case_to_pascal_case { diff --git a/tests/avro/test_string_map.cpp b/tests/avro/test_string_map.cpp index 16102a787..08a68aeef 100644 --- a/tests/avro/test_string_map.cpp +++ b/tests/avro/test_string_map.cpp @@ -3,9 +3,9 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; -import rfl.json; +#include +#include +#include namespace test_string_map { diff --git a/tests/avro/test_tagged_union.cpp b/tests/avro/test_tagged_union.cpp index 6bea20742..63460712c 100644 --- a/tests/avro/test_tagged_union.cpp +++ b/tests/avro/test_tagged_union.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_tagged_union { diff --git a/tests/avro/test_timestamp.cpp b/tests/avro/test_timestamp.cpp index c50056e2a..28859ab42 100644 --- a/tests/avro/test_timestamp.cpp +++ b/tests/avro/test_timestamp.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include namespace test_timestamp { diff --git a/tests/avro/test_tuple.cpp b/tests/avro/test_tuple.cpp index 93b2a1f54..33daf6ada 100644 --- a/tests/avro/test_tuple.cpp +++ b/tests/avro/test_tuple.cpp @@ -3,12 +3,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.avro; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_tuple { diff --git a/tests/avro/test_tutorial_example.cpp b/tests/avro/test_tutorial_example.cpp index 7c19ede96..ebedd3c1a 100644 --- a/tests/avro/test_tutorial_example.cpp +++ b/tests/avro/test_tutorial_example.cpp @@ -1,8 +1,8 @@ #include #include -import rfl; -import rfl.avro; +#include +#include /// The basic example from the Avro C tutorial. diff --git a/tests/avro/test_tutorial_example_automated_schema.cpp b/tests/avro/test_tutorial_example_automated_schema.cpp index a6ac53945..fc01cb4ba 100644 --- a/tests/avro/test_tutorial_example_automated_schema.cpp +++ b/tests/avro/test_tutorial_example_automated_schema.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.avro; +#include +#include /// The basic example from the Avro C tutorial. diff --git a/tests/avro/test_unique_ptr.cpp b/tests/avro/test_unique_ptr.cpp index c28e56a6b..8c2705953 100644 --- a/tests/avro/test_unique_ptr.cpp +++ b/tests/avro/test_unique_ptr.cpp @@ -2,12 +2,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.avro; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_unique_ptr { diff --git a/tests/avro/test_unique_ptr2.cpp b/tests/avro/test_unique_ptr2.cpp index 7375288a8..d3332ac6c 100644 --- a/tests/avro/test_unique_ptr2.cpp +++ b/tests/avro/test_unique_ptr2.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.avro; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/avro/test_variant.cpp b/tests/avro/test_variant.cpp index 18506ccef..1e20b9383 100644 --- a/tests/avro/test_variant.cpp +++ b/tests/avro/test_variant.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.avro; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/avro/test_wstring.cpp b/tests/avro/test_wstring.cpp index eeee1aea2..935c1535f 100644 --- a/tests/avro/test_wstring.cpp +++ b/tests/avro/test_wstring.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.avro; -import rfl; +#include +#include struct TestStruct { diff --git a/tests/avro/write_and_read.hpp b/tests/avro/write_and_read.hpp index fb476b082..048a32d7f 100644 --- a/tests/avro/write_and_read.hpp +++ b/tests/avro/write_and_read.hpp @@ -6,8 +6,8 @@ #include #include -import rfl.json; -import rfl.avro; +#include +#include template diff --git a/tests/boost_serialization/test_add_struct_name.cpp b/tests/boost_serialization/test_add_struct_name.cpp index c56bdd8ca..781bc1194 100644 --- a/tests/boost_serialization/test_add_struct_name.cpp +++ b/tests/boost_serialization/test_add_struct_name.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; +#include namespace test_add_struct_name { diff --git a/tests/boost_serialization/test_array.cpp b/tests/boost_serialization/test_array.cpp index 854c3f66a..5cb8d34da 100644 --- a/tests/boost_serialization/test_array.cpp +++ b/tests/boost_serialization/test_array.cpp @@ -5,11 +5,12 @@ // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include "write_and_read.hpp" #include -import rfl; -import rfl.boost_serialization; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/boost_serialization/test_box.cpp b/tests/boost_serialization/test_box.cpp index c0275ed64..ff67f2834 100644 --- a/tests/boost_serialization/test_box.cpp +++ b/tests/boost_serialization/test_box.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.boost_serialization; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/boost_serialization/test_combined_processors.cpp b/tests/boost_serialization/test_combined_processors.cpp index 366e9c59e..eb89f451c 100644 --- a/tests/boost_serialization/test_combined_processors.cpp +++ b/tests/boost_serialization/test_combined_processors.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; +#include namespace test_combined_processors { diff --git a/tests/boost_serialization/test_custom_class1.cpp b/tests/boost_serialization/test_custom_class1.cpp index a33582df0..f1a5bd8cc 100644 --- a/tests/boost_serialization/test_custom_class1.cpp +++ b/tests/boost_serialization/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_custom_class1 { diff --git a/tests/boost_serialization/test_custom_class3.cpp b/tests/boost_serialization/test_custom_class3.cpp index 9d398c5bb..030c815c9 100644 --- a/tests/boost_serialization/test_custom_class3.cpp +++ b/tests/boost_serialization/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_custom_class3 { diff --git a/tests/boost_serialization/test_custom_class4.cpp b/tests/boost_serialization/test_custom_class4.cpp index 124284e0f..d0b9b8e51 100644 --- a/tests/boost_serialization/test_custom_class4.cpp +++ b/tests/boost_serialization/test_custom_class4.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_custom_class4 { diff --git a/tests/boost_serialization/test_default_values.cpp b/tests/boost_serialization/test_default_values.cpp index 44e5ed076..f3089c8d7 100644 --- a/tests/boost_serialization/test_default_values.cpp +++ b/tests/boost_serialization/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_default_values { diff --git a/tests/boost_serialization/test_deque.cpp b/tests/boost_serialization/test_deque.cpp index 8434d8b62..fbebe36e1 100644 --- a/tests/boost_serialization/test_deque.cpp +++ b/tests/boost_serialization/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.boost_serialization; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/boost_serialization/test_enum.cpp b/tests/boost_serialization/test_enum.cpp index b5ded05d4..15eca88e1 100644 --- a/tests/boost_serialization/test_enum.cpp +++ b/tests/boost_serialization/test_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_enum { diff --git a/tests/boost_serialization/test_field_variant.cpp b/tests/boost_serialization/test_field_variant.cpp index 5dedfc3fb..7770e20f4 100644 --- a/tests/boost_serialization/test_field_variant.cpp +++ b/tests/boost_serialization/test_field_variant.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_field_variant { diff --git a/tests/boost_serialization/test_flag_enum.cpp b/tests/boost_serialization/test_flag_enum.cpp index 03f07e19b..0b834f5c8 100644 --- a/tests/boost_serialization/test_flag_enum.cpp +++ b/tests/boost_serialization/test_flag_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_flag_enum { diff --git a/tests/boost_serialization/test_flag_enum_with_int.cpp b/tests/boost_serialization/test_flag_enum_with_int.cpp index e3554758d..80e9c32b8 100644 --- a/tests/boost_serialization/test_flag_enum_with_int.cpp +++ b/tests/boost_serialization/test_flag_enum_with_int.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/boost_serialization/test_flatten.cpp b/tests/boost_serialization/test_flatten.cpp index ce4b4146e..78e86c4b4 100644 --- a/tests/boost_serialization/test_flatten.cpp +++ b/tests/boost_serialization/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_flatten { diff --git a/tests/boost_serialization/test_flatten_anonymous.cpp b/tests/boost_serialization/test_flatten_anonymous.cpp index 0bfafaf58..d9466a20d 100644 --- a/tests/boost_serialization/test_flatten_anonymous.cpp +++ b/tests/boost_serialization/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/boost_serialization/test_forward_list.cpp b/tests/boost_serialization/test_forward_list.cpp index 945d6595a..cfa1efdff 100644 --- a/tests/boost_serialization/test_forward_list.cpp +++ b/tests/boost_serialization/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.boost_serialization; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/boost_serialization/test_generic.cpp b/tests/boost_serialization/test_generic.cpp index 3c7079c23..9057b2631 100644 --- a/tests/boost_serialization/test_generic.cpp +++ b/tests/boost_serialization/test_generic.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.boost_serialization; +#include +#include namespace test_generic { diff --git a/tests/boost_serialization/test_literal.cpp b/tests/boost_serialization/test_literal.cpp index c543ec3f0..55b3590b9 100644 --- a/tests/boost_serialization/test_literal.cpp +++ b/tests/boost_serialization/test_literal.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_literal { diff --git a/tests/boost_serialization/test_literal_map.cpp b/tests/boost_serialization/test_literal_map.cpp index cb033b85c..8627f4b22 100644 --- a/tests/boost_serialization/test_literal_map.cpp +++ b/tests/boost_serialization/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_literal_map { diff --git a/tests/boost_serialization/test_map.cpp b/tests/boost_serialization/test_map.cpp index d0b365a21..cabeb0514 100644 --- a/tests/boost_serialization/test_map.cpp +++ b/tests/boost_serialization/test_map.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.boost_serialization; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map { diff --git a/tests/boost_serialization/test_map_with_key_validation.cpp b/tests/boost_serialization/test_map_with_key_validation.cpp index 104abc19d..25123f5b6 100644 --- a/tests/boost_serialization/test_map_with_key_validation.cpp +++ b/tests/boost_serialization/test_map_with_key_validation.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl.boost_serialization; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map_with_key_validation { diff --git a/tests/boost_serialization/test_monster_example.cpp b/tests/boost_serialization/test_monster_example.cpp index f0ed69ba9..5f8c1a695 100644 --- a/tests/boost_serialization/test_monster_example.cpp +++ b/tests/boost_serialization/test_monster_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_monster_example { diff --git a/tests/boost_serialization/test_readme_example.cpp b/tests/boost_serialization/test_readme_example.cpp index 670d107ac..43c15b36f 100644 --- a/tests/boost_serialization/test_readme_example.cpp +++ b/tests/boost_serialization/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_readme_example { diff --git a/tests/boost_serialization/test_readme_example2.cpp b/tests/boost_serialization/test_readme_example2.cpp index 7179b0f6a..3cdc8e406 100644 --- a/tests/boost_serialization/test_readme_example2.cpp +++ b/tests/boost_serialization/test_readme_example2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_readme_example2 { diff --git a/tests/boost_serialization/test_ref.cpp b/tests/boost_serialization/test_ref.cpp index a6f060642..9dd0db91b 100644 --- a/tests/boost_serialization/test_ref.cpp +++ b/tests/boost_serialization/test_ref.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.boost_serialization; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/boost_serialization/test_save_load.cpp b/tests/boost_serialization/test_save_load.cpp index 1e75dc5ae..9200b817f 100644 --- a/tests/boost_serialization/test_save_load.cpp +++ b/tests/boost_serialization/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include #include -import rfl; -import rfl.boost_serialization; +#include +#include namespace test_save_load { diff --git a/tests/boost_serialization/test_set.cpp b/tests/boost_serialization/test_set.cpp index b4aeb1439..cc795d394 100644 --- a/tests/boost_serialization/test_set.cpp +++ b/tests/boost_serialization/test_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.boost_serialization; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/boost_serialization/test_size.cpp b/tests/boost_serialization/test_size.cpp index f7d60d3f9..0f7787e3e 100644 --- a/tests/boost_serialization/test_size.cpp +++ b/tests/boost_serialization/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_size { diff --git a/tests/boost_serialization/test_snake_case_to_camel_case.cpp b/tests/boost_serialization/test_snake_case_to_camel_case.cpp index bd89d554f..a7b68fe1b 100644 --- a/tests/boost_serialization/test_snake_case_to_camel_case.cpp +++ b/tests/boost_serialization/test_snake_case_to_camel_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; +#include namespace test_snake_case_to_camel_case { diff --git a/tests/boost_serialization/test_snake_case_to_pascal_case.cpp b/tests/boost_serialization/test_snake_case_to_pascal_case.cpp index 64ec11f37..72bc42179 100644 --- a/tests/boost_serialization/test_snake_case_to_pascal_case.cpp +++ b/tests/boost_serialization/test_snake_case_to_pascal_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; +#include namespace test_snake_case_to_pascal_case { diff --git a/tests/boost_serialization/test_string_map.cpp b/tests/boost_serialization/test_string_map.cpp index ecd2619e3..5591e587b 100644 --- a/tests/boost_serialization/test_string_map.cpp +++ b/tests/boost_serialization/test_string_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_string_map { diff --git a/tests/boost_serialization/test_tagged_union.cpp b/tests/boost_serialization/test_tagged_union.cpp index baa8f9d8e..ecc389d2e 100644 --- a/tests/boost_serialization/test_tagged_union.cpp +++ b/tests/boost_serialization/test_tagged_union.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_tagged_union { diff --git a/tests/boost_serialization/test_timestamp.cpp b/tests/boost_serialization/test_timestamp.cpp index 2f40706f5..a3131d69e 100644 --- a/tests/boost_serialization/test_timestamp.cpp +++ b/tests/boost_serialization/test_timestamp.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.boost_serialization; -import rfl; +#include +#include namespace test_timestamp { diff --git a/tests/boost_serialization/test_unique_ptr.cpp b/tests/boost_serialization/test_unique_ptr.cpp index 16b793960..d3108acc7 100644 --- a/tests/boost_serialization/test_unique_ptr.cpp +++ b/tests/boost_serialization/test_unique_ptr.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.boost_serialization; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr { diff --git a/tests/boost_serialization/test_unique_ptr2.cpp b/tests/boost_serialization/test_unique_ptr2.cpp index cb5a68110..ebc7554c8 100644 --- a/tests/boost_serialization/test_unique_ptr2.cpp +++ b/tests/boost_serialization/test_unique_ptr2.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.boost_serialization; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/boost_serialization/test_variant.cpp b/tests/boost_serialization/test_variant.cpp index de9768cac..d334ff6c5 100644 --- a/tests/boost_serialization/test_variant.cpp +++ b/tests/boost_serialization/test_variant.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.boost_serialization; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/boost_serialization/write_and_read.hpp b/tests/boost_serialization/write_and_read.hpp index 81dac060b..6b7b8e1b1 100644 --- a/tests/boost_serialization/write_and_read.hpp +++ b/tests/boost_serialization/write_and_read.hpp @@ -6,8 +6,8 @@ #include #include -import rfl.json; -import rfl.boost_serialization; +#include +#include template diff --git a/tests/bson/test_add_struct_name.cpp b/tests/bson/test_add_struct_name.cpp index 695305ace..83cc38ffb 100644 --- a/tests/bson/test_add_struct_name.cpp +++ b/tests/bson/test_add_struct_name.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.bson; +#include namespace test_add_struct_name { diff --git a/tests/bson/test_array.cpp b/tests/bson/test_array.cpp index f6b2e8b77..e2292a288 100644 --- a/tests/bson/test_array.cpp +++ b/tests/bson/test_array.cpp @@ -5,11 +5,12 @@ // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include "write_and_read.hpp" #include -import rfl; -import rfl.bson; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/bson/test_box.cpp b/tests/bson/test_box.cpp index 2c471d2e8..6e87f2ddf 100644 --- a/tests/bson/test_box.cpp +++ b/tests/bson/test_box.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.bson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/bson/test_bytestring.cpp b/tests/bson/test_bytestring.cpp index cb548c5d4..a7ca84e09 100644 --- a/tests/bson/test_bytestring.cpp +++ b/tests/bson/test_bytestring.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.bson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_bytestring { diff --git a/tests/bson/test_combined_processors.cpp b/tests/bson/test_combined_processors.cpp index 36c698272..773508226 100644 --- a/tests/bson/test_combined_processors.cpp +++ b/tests/bson/test_combined_processors.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.bson; +#include namespace test_combined_processors { diff --git a/tests/bson/test_custom_class1.cpp b/tests/bson/test_custom_class1.cpp index f886ba64e..2402edab3 100644 --- a/tests/bson/test_custom_class1.cpp +++ b/tests/bson/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_custom_class1 { diff --git a/tests/bson/test_custom_class3.cpp b/tests/bson/test_custom_class3.cpp index bcd3838b7..85afcf40b 100644 --- a/tests/bson/test_custom_class3.cpp +++ b/tests/bson/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_custom_class3 { diff --git a/tests/bson/test_custom_class4.cpp b/tests/bson/test_custom_class4.cpp index 14a2dbc93..e443f2726 100644 --- a/tests/bson/test_custom_class4.cpp +++ b/tests/bson/test_custom_class4.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_custom_class4 { diff --git a/tests/bson/test_default_values.cpp b/tests/bson/test_default_values.cpp index a22037a10..e5087d0f3 100644 --- a/tests/bson/test_default_values.cpp +++ b/tests/bson/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_default_values { diff --git a/tests/bson/test_deque.cpp b/tests/bson/test_deque.cpp index 378de5cca..1c11b7687 100644 --- a/tests/bson/test_deque.cpp +++ b/tests/bson/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.bson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/bson/test_enum.cpp b/tests/bson/test_enum.cpp index 3ed263e86..1284bee2b 100644 --- a/tests/bson/test_enum.cpp +++ b/tests/bson/test_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_enum { diff --git a/tests/bson/test_field_variant.cpp b/tests/bson/test_field_variant.cpp index ba4fa7b6e..dba6d0fee 100644 --- a/tests/bson/test_field_variant.cpp +++ b/tests/bson/test_field_variant.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_field_variant { diff --git a/tests/bson/test_flag_enum.cpp b/tests/bson/test_flag_enum.cpp index 85007b7ee..6e652c3a6 100644 --- a/tests/bson/test_flag_enum.cpp +++ b/tests/bson/test_flag_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_flag_enum { diff --git a/tests/bson/test_flag_enum_with_int.cpp b/tests/bson/test_flag_enum_with_int.cpp index 0b3563fa2..d2bf635dc 100644 --- a/tests/bson/test_flag_enum_with_int.cpp +++ b/tests/bson/test_flag_enum_with_int.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/bson/test_flatten.cpp b/tests/bson/test_flatten.cpp index 69c5379ee..845ae0313 100644 --- a/tests/bson/test_flatten.cpp +++ b/tests/bson/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_flatten { diff --git a/tests/bson/test_flatten_anonymous.cpp b/tests/bson/test_flatten_anonymous.cpp index c39e6bcb6..7045e7ab6 100644 --- a/tests/bson/test_flatten_anonymous.cpp +++ b/tests/bson/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/bson/test_forward_list.cpp b/tests/bson/test_forward_list.cpp index f6ad6f8c3..e1662ea51 100644 --- a/tests/bson/test_forward_list.cpp +++ b/tests/bson/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.bson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/bson/test_literal.cpp b/tests/bson/test_literal.cpp index 63c852a5a..a5cef5741 100644 --- a/tests/bson/test_literal.cpp +++ b/tests/bson/test_literal.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_literal { diff --git a/tests/bson/test_literal_map.cpp b/tests/bson/test_literal_map.cpp index b21968d12..8c01e5d1b 100644 --- a/tests/bson/test_literal_map.cpp +++ b/tests/bson/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_literal_map { diff --git a/tests/bson/test_map.cpp b/tests/bson/test_map.cpp index f895503cf..d2e2edb87 100644 --- a/tests/bson/test_map.cpp +++ b/tests/bson/test_map.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.bson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map { diff --git a/tests/bson/test_map_with_key_validation.cpp b/tests/bson/test_map_with_key_validation.cpp index a503de478..f2a655faf 100644 --- a/tests/bson/test_map_with_key_validation.cpp +++ b/tests/bson/test_map_with_key_validation.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl.bson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map_with_key_validation { diff --git a/tests/bson/test_monster_example.cpp b/tests/bson/test_monster_example.cpp index a2cf37380..86bc5e6ed 100644 --- a/tests/bson/test_monster_example.cpp +++ b/tests/bson/test_monster_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_monster_example { diff --git a/tests/bson/test_oid.cpp b/tests/bson/test_oid.cpp index 1da28fb95..055cdfe19 100644 --- a/tests/bson/test_oid.cpp +++ b/tests/bson/test_oid.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.bson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_oid { diff --git a/tests/bson/test_readme_example.cpp b/tests/bson/test_readme_example.cpp index c22117b15..36f54bd74 100644 --- a/tests/bson/test_readme_example.cpp +++ b/tests/bson/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_readme_example { diff --git a/tests/bson/test_readme_example2.cpp b/tests/bson/test_readme_example2.cpp index 113cf587e..baae4ef0d 100644 --- a/tests/bson/test_readme_example2.cpp +++ b/tests/bson/test_readme_example2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_readme_example2 { diff --git a/tests/bson/test_ref.cpp b/tests/bson/test_ref.cpp index 6d57418fb..53beead9c 100644 --- a/tests/bson/test_ref.cpp +++ b/tests/bson/test_ref.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.bson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/bson/test_regression_bugs.cpp b/tests/bson/test_regression_bugs.cpp index 94cfabd3c..7977061b2 100644 --- a/tests/bson/test_regression_bugs.cpp +++ b/tests/bson/test_regression_bugs.cpp @@ -5,8 +5,8 @@ #include #include #include -import rfl; -import rfl.bson; +#include +#include diff --git a/tests/bson/test_save_load.cpp b/tests/bson/test_save_load.cpp index 8492393c5..c981022d1 100644 --- a/tests/bson/test_save_load.cpp +++ b/tests/bson/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include -import rfl; -import rfl.bson; +#include +#include namespace test_save_load { diff --git a/tests/bson/test_set.cpp b/tests/bson/test_set.cpp index af3cfcc70..195429a86 100644 --- a/tests/bson/test_set.cpp +++ b/tests/bson/test_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.bson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/bson/test_size.cpp b/tests/bson/test_size.cpp index ac73dc73a..5ef801627 100644 --- a/tests/bson/test_size.cpp +++ b/tests/bson/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_size { diff --git a/tests/bson/test_snake_case_to_camel_case.cpp b/tests/bson/test_snake_case_to_camel_case.cpp index 005e46e71..a78a1c10b 100644 --- a/tests/bson/test_snake_case_to_camel_case.cpp +++ b/tests/bson/test_snake_case_to_camel_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.bson; +#include namespace test_snake_case_to_camel_case { diff --git a/tests/bson/test_snake_case_to_pascal_case.cpp b/tests/bson/test_snake_case_to_pascal_case.cpp index 259e667cf..af47b6219 100644 --- a/tests/bson/test_snake_case_to_pascal_case.cpp +++ b/tests/bson/test_snake_case_to_pascal_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.bson; +#include namespace test_snake_case_to_pascal_case { diff --git a/tests/bson/test_string_map.cpp b/tests/bson/test_string_map.cpp index 186ef9ba9..1bb0db831 100644 --- a/tests/bson/test_string_map.cpp +++ b/tests/bson/test_string_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_string_map { diff --git a/tests/bson/test_tagged_union.cpp b/tests/bson/test_tagged_union.cpp index fd8c133ea..7578e55a9 100644 --- a/tests/bson/test_tagged_union.cpp +++ b/tests/bson/test_tagged_union.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_tagged_union { diff --git a/tests/bson/test_timestamp.cpp b/tests/bson/test_timestamp.cpp index b4dfd04ea..955ff33b1 100644 --- a/tests/bson/test_timestamp.cpp +++ b/tests/bson/test_timestamp.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_timestamp { diff --git a/tests/bson/test_unique_ptr.cpp b/tests/bson/test_unique_ptr.cpp index cd0365da5..91dc6c443 100644 --- a/tests/bson/test_unique_ptr.cpp +++ b/tests/bson/test_unique_ptr.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.bson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr { diff --git a/tests/bson/test_unique_ptr2.cpp b/tests/bson/test_unique_ptr2.cpp index 2367af19b..68093f2b7 100644 --- a/tests/bson/test_unique_ptr2.cpp +++ b/tests/bson/test_unique_ptr2.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.bson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/bson/test_variant.cpp b/tests/bson/test_variant.cpp index 76296d464..fda92c254 100644 --- a/tests/bson/test_variant.cpp +++ b/tests/bson/test_variant.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.bson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/bson/test_vectorstring.cpp b/tests/bson/test_vectorstring.cpp index 56794332f..2bf224658 100644 --- a/tests/bson/test_vectorstring.cpp +++ b/tests/bson/test_vectorstring.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include namespace test_vectorstring { diff --git a/tests/bson/test_wstring.cpp b/tests/bson/test_wstring.cpp index 1bf5dfd48..29198c258 100644 --- a/tests/bson/test_wstring.cpp +++ b/tests/bson/test_wstring.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.bson; -import rfl; +#include +#include struct TestStruct { diff --git a/tests/bson/write_and_read.hpp b/tests/bson/write_and_read.hpp index d48522514..2a03a5b76 100644 --- a/tests/bson/write_and_read.hpp +++ b/tests/bson/write_and_read.hpp @@ -4,7 +4,7 @@ #include #include -import rfl.bson; +#include diff --git a/tests/capnproto/compile_fail/capnproto_read_istream_schema.cpp b/tests/capnproto/compile_fail/capnproto_read_istream_schema.cpp index 24aafbbff..f4536a359 100644 --- a/tests/capnproto/compile_fail/capnproto_read_istream_schema.cpp +++ b/tests/capnproto/compile_fail/capnproto_read_istream_schema.cpp @@ -8,8 +8,8 @@ #include #include -import rfl; -import rfl.capnproto; +#include +#include diff --git a/tests/capnproto/test_add_struct_name.cpp b/tests/capnproto/test_add_struct_name.cpp index 3b2771bdb..0564cd251 100644 --- a/tests/capnproto/test_add_struct_name.cpp +++ b/tests/capnproto/test_add_struct_name.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; +#include namespace test_add_struct_name { diff --git a/tests/capnproto/test_array.cpp b/tests/capnproto/test_array.cpp index 658fe5d88..d48d4d304 100644 --- a/tests/capnproto/test_array.cpp +++ b/tests/capnproto/test_array.cpp @@ -5,11 +5,12 @@ // Make sure things still compile when // rfl.hpp is included after rfl/capnproto.hpp. -#include "write_and_read.hpp" #include -import rfl; -import rfl.capnproto; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/capnproto/test_box.cpp b/tests/capnproto/test_box.cpp index 104c53932..2e4e02df0 100644 --- a/tests/capnproto/test_box.cpp +++ b/tests/capnproto/test_box.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/capnproto/test_bytestring.cpp b/tests/capnproto/test_bytestring.cpp index c8e96a421..2e83c8701 100644 --- a/tests/capnproto/test_bytestring.cpp +++ b/tests/capnproto/test_bytestring.cpp @@ -1,9 +1,10 @@ -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_bytestring { diff --git a/tests/capnproto/test_custom_class1.cpp b/tests/capnproto/test_custom_class1.cpp index 1fc02eda5..db52f4478 100644 --- a/tests/capnproto/test_custom_class1.cpp +++ b/tests/capnproto/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_custom_class1 { diff --git a/tests/capnproto/test_custom_class3.cpp b/tests/capnproto/test_custom_class3.cpp index 7319cfa9b..110104da0 100644 --- a/tests/capnproto/test_custom_class3.cpp +++ b/tests/capnproto/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_custom_class3 { diff --git a/tests/capnproto/test_custom_class4.cpp b/tests/capnproto/test_custom_class4.cpp index 352a76862..e047cae46 100644 --- a/tests/capnproto/test_custom_class4.cpp +++ b/tests/capnproto/test_custom_class4.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_custom_class4 { diff --git a/tests/capnproto/test_default_values.cpp b/tests/capnproto/test_default_values.cpp index 86d378d12..c078406e5 100644 --- a/tests/capnproto/test_default_values.cpp +++ b/tests/capnproto/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_default_values { diff --git a/tests/capnproto/test_deque.cpp b/tests/capnproto/test_deque.cpp index 9ed955529..45b453b91 100644 --- a/tests/capnproto/test_deque.cpp +++ b/tests/capnproto/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.capnproto; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/capnproto/test_enum.cpp b/tests/capnproto/test_enum.cpp index a1df7070d..78480c98d 100644 --- a/tests/capnproto/test_enum.cpp +++ b/tests/capnproto/test_enum.cpp @@ -1,9 +1,9 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; -import rfl.json; +#include +#include +#include namespace test_enum { diff --git a/tests/capnproto/test_field_variant.cpp b/tests/capnproto/test_field_variant.cpp index 8ef576d50..927745e17 100644 --- a/tests/capnproto/test_field_variant.cpp +++ b/tests/capnproto/test_field_variant.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_field_variant { diff --git a/tests/capnproto/test_field_variant_std.cpp b/tests/capnproto/test_field_variant_std.cpp index 9a6057b20..d5bb58f14 100644 --- a/tests/capnproto/test_field_variant_std.cpp +++ b/tests/capnproto/test_field_variant_std.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_field_variant_std { diff --git a/tests/capnproto/test_flag_enum.cpp b/tests/capnproto/test_flag_enum.cpp index d5fabe0df..3535e7174 100644 --- a/tests/capnproto/test_flag_enum.cpp +++ b/tests/capnproto/test_flag_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_flag_enum { diff --git a/tests/capnproto/test_flag_enum_with_int.cpp b/tests/capnproto/test_flag_enum_with_int.cpp index 9d45d847c..0b124b107 100644 --- a/tests/capnproto/test_flag_enum_with_int.cpp +++ b/tests/capnproto/test_flag_enum_with_int.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/capnproto/test_flatten.cpp b/tests/capnproto/test_flatten.cpp index bfd867bed..d69c0bd5b 100644 --- a/tests/capnproto/test_flatten.cpp +++ b/tests/capnproto/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_flatten { diff --git a/tests/capnproto/test_flatten_anonymous.cpp b/tests/capnproto/test_flatten_anonymous.cpp index 6e40eb1f0..cc3057495 100644 --- a/tests/capnproto/test_flatten_anonymous.cpp +++ b/tests/capnproto/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/capnproto/test_forward_list.cpp b/tests/capnproto/test_forward_list.cpp index 55bf54eaa..59bb3d9ea 100644 --- a/tests/capnproto/test_forward_list.cpp +++ b/tests/capnproto/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.capnproto; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/capnproto/test_literal.cpp b/tests/capnproto/test_literal.cpp index b024e15ef..c11153e75 100644 --- a/tests/capnproto/test_literal.cpp +++ b/tests/capnproto/test_literal.cpp @@ -2,9 +2,9 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; -import rfl.json; +#include +#include +#include namespace test_literal { diff --git a/tests/capnproto/test_literal_map.cpp b/tests/capnproto/test_literal_map.cpp index 3cb05d045..aff10dca0 100644 --- a/tests/capnproto/test_literal_map.cpp +++ b/tests/capnproto/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_literal_map { diff --git a/tests/capnproto/test_map.cpp b/tests/capnproto/test_map.cpp index 043caaba9..2349e981d 100644 --- a/tests/capnproto/test_map.cpp +++ b/tests/capnproto/test_map.cpp @@ -1,13 +1,14 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl.capnproto; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_map { diff --git a/tests/capnproto/test_map2.cpp b/tests/capnproto/test_map2.cpp index f47e0b96e..7a1083ef3 100644 --- a/tests/capnproto/test_map2.cpp +++ b/tests/capnproto/test_map2.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_map2 { diff --git a/tests/capnproto/test_map_value_types.cpp b/tests/capnproto/test_map_value_types.cpp index d3fe55e1a..e254ee4db 100644 --- a/tests/capnproto/test_map_value_types.cpp +++ b/tests/capnproto/test_map_value_types.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map_value_types { diff --git a/tests/capnproto/test_monster_example.cpp b/tests/capnproto/test_monster_example.cpp index 43f96bdcf..0f5580d07 100644 --- a/tests/capnproto/test_monster_example.cpp +++ b/tests/capnproto/test_monster_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_monster_example { diff --git a/tests/capnproto/test_optional_fields.cpp b/tests/capnproto/test_optional_fields.cpp index fd7b5ea0c..d6f652d34 100644 --- a/tests/capnproto/test_optional_fields.cpp +++ b/tests/capnproto/test_optional_fields.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_optional_fields { diff --git a/tests/capnproto/test_optionals_in_vectors.cpp b/tests/capnproto/test_optionals_in_vectors.cpp index fb2bbdfb7..64edc24a3 100644 --- a/tests/capnproto/test_optionals_in_vectors.cpp +++ b/tests/capnproto/test_optionals_in_vectors.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_optionals_in_vectors { diff --git a/tests/capnproto/test_person.cpp b/tests/capnproto/test_person.cpp index 72fc40f4b..e62bc1954 100644 --- a/tests/capnproto/test_person.cpp +++ b/tests/capnproto/test_person.cpp @@ -4,8 +4,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.capnproto; +#include +#include namespace test_tutorial_example { diff --git a/tests/capnproto/test_readme_example.cpp b/tests/capnproto/test_readme_example.cpp index 2c91bdc1e..6f25eb300 100644 --- a/tests/capnproto/test_readme_example.cpp +++ b/tests/capnproto/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_readme_example { diff --git a/tests/capnproto/test_readme_example2.cpp b/tests/capnproto/test_readme_example2.cpp index d1045ffcd..af901af6e 100644 --- a/tests/capnproto/test_readme_example2.cpp +++ b/tests/capnproto/test_readme_example2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_readme_example2 { diff --git a/tests/capnproto/test_readme_example3.cpp b/tests/capnproto/test_readme_example3.cpp index b14ba9270..44959bc17 100644 --- a/tests/capnproto/test_readme_example3.cpp +++ b/tests/capnproto/test_readme_example3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_readme_example3 { diff --git a/tests/capnproto/test_ref.cpp b/tests/capnproto/test_ref.cpp index 192c6d626..3074fc868 100644 --- a/tests/capnproto/test_ref.cpp +++ b/tests/capnproto/test_ref.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/capnproto/test_rfl_tuple.cpp b/tests/capnproto/test_rfl_tuple.cpp index 74af3ea00..e743ccc17 100644 --- a/tests/capnproto/test_rfl_tuple.cpp +++ b/tests/capnproto/test_rfl_tuple.cpp @@ -2,12 +2,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_rfl_tuple { diff --git a/tests/capnproto/test_rfl_variant.cpp b/tests/capnproto/test_rfl_variant.cpp index 8505fd87c..5e7cca0ec 100644 --- a/tests/capnproto/test_rfl_variant.cpp +++ b/tests/capnproto/test_rfl_variant.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/capnproto/test_save_load.cpp b/tests/capnproto/test_save_load.cpp index bb9c02ad4..3d40726e7 100644 --- a/tests/capnproto/test_save_load.cpp +++ b/tests/capnproto/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include #include -import rfl; -import rfl.capnproto; +#include +#include namespace test_save_load { diff --git a/tests/capnproto/test_set.cpp b/tests/capnproto/test_set.cpp index d4388480b..077d6ed5e 100644 --- a/tests/capnproto/test_set.cpp +++ b/tests/capnproto/test_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.capnproto; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/capnproto/test_shared_ptr.cpp b/tests/capnproto/test_shared_ptr.cpp index 534155371..c51fc627e 100644 --- a/tests/capnproto/test_shared_ptr.cpp +++ b/tests/capnproto/test_shared_ptr.cpp @@ -2,12 +2,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_shared_ptr { diff --git a/tests/capnproto/test_size.cpp b/tests/capnproto/test_size.cpp index 487f5c980..8bde75341 100644 --- a/tests/capnproto/test_size.cpp +++ b/tests/capnproto/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_size { diff --git a/tests/capnproto/test_string_map.cpp b/tests/capnproto/test_string_map.cpp index 4c4e97803..a4a4a6e9c 100644 --- a/tests/capnproto/test_string_map.cpp +++ b/tests/capnproto/test_string_map.cpp @@ -3,9 +3,9 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; -import rfl.json; +#include +#include +#include namespace test_string_map { diff --git a/tests/capnproto/test_tagged_union.cpp b/tests/capnproto/test_tagged_union.cpp index 696a00fa4..8e23935d7 100644 --- a/tests/capnproto/test_tagged_union.cpp +++ b/tests/capnproto/test_tagged_union.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_tagged_union { diff --git a/tests/capnproto/test_timestamp.cpp b/tests/capnproto/test_timestamp.cpp index 64f36c1bf..07fc04b20 100644 --- a/tests/capnproto/test_timestamp.cpp +++ b/tests/capnproto/test_timestamp.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_timestamp { diff --git a/tests/capnproto/test_tuple.cpp b/tests/capnproto/test_tuple.cpp index 8ba959cdf..7aca8edf3 100644 --- a/tests/capnproto/test_tuple.cpp +++ b/tests/capnproto/test_tuple.cpp @@ -3,12 +3,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_tuple { diff --git a/tests/capnproto/test_tutorial_example.cpp b/tests/capnproto/test_tutorial_example.cpp index 7817f7ff0..7f0f81e36 100644 --- a/tests/capnproto/test_tutorial_example.cpp +++ b/tests/capnproto/test_tutorial_example.cpp @@ -2,8 +2,8 @@ #include #include -import rfl; -import rfl.capnproto; +#include +#include // #include "write_and_read.hpp" diff --git a/tests/capnproto/test_uint64.cpp b/tests/capnproto/test_uint64.cpp index 35173ac41..7eaa0d695 100644 --- a/tests/capnproto/test_uint64.cpp +++ b/tests/capnproto/test_uint64.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include namespace test_uint64 { diff --git a/tests/capnproto/test_unique_ptr.cpp b/tests/capnproto/test_unique_ptr.cpp index a85ac889e..aa816dd38 100644 --- a/tests/capnproto/test_unique_ptr.cpp +++ b/tests/capnproto/test_unique_ptr.cpp @@ -2,12 +2,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_unique_ptr { diff --git a/tests/capnproto/test_unique_ptr2.cpp b/tests/capnproto/test_unique_ptr2.cpp index 1477e0789..cbd1a79ab 100644 --- a/tests/capnproto/test_unique_ptr2.cpp +++ b/tests/capnproto/test_unique_ptr2.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.capnproto; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/capnproto/test_variant.cpp b/tests/capnproto/test_variant.cpp index 2e755d839..f85930c88 100644 --- a/tests/capnproto/test_variant.cpp +++ b/tests/capnproto/test_variant.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.capnproto; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/capnproto/test_variants_in_vectors.cpp b/tests/capnproto/test_variants_in_vectors.cpp index 64903b5ff..48693a602 100644 --- a/tests/capnproto/test_variants_in_vectors.cpp +++ b/tests/capnproto/test_variants_in_vectors.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.capnproto; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_variants_in_vectors { diff --git a/tests/capnproto/test_wstring.cpp b/tests/capnproto/test_wstring.cpp index 581f7cb3c..53672f0a6 100644 --- a/tests/capnproto/test_wstring.cpp +++ b/tests/capnproto/test_wstring.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.capnproto; -import rfl; +#include +#include struct TestStruct { diff --git a/tests/capnproto/write_and_read.hpp b/tests/capnproto/write_and_read.hpp index c5bbe34c5..3938a0bb6 100644 --- a/tests/capnproto/write_and_read.hpp +++ b/tests/capnproto/write_and_read.hpp @@ -4,7 +4,7 @@ #include #include -import rfl.capnproto; +#include diff --git a/tests/cbor/test_add_struct_name.cpp b/tests/cbor/test_add_struct_name.cpp index 5b2066352..c1a84bcb8 100644 --- a/tests/cbor/test_add_struct_name.cpp +++ b/tests/cbor/test_add_struct_name.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.cbor; +#include namespace test_add_struct_name { diff --git a/tests/cbor/test_array.cpp b/tests/cbor/test_array.cpp index 966bb11bc..7921b781f 100644 --- a/tests/cbor/test_array.cpp +++ b/tests/cbor/test_array.cpp @@ -5,11 +5,12 @@ // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include "write_and_read.hpp" #include -import rfl; -import rfl.cbor; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/cbor/test_box.cpp b/tests/cbor/test_box.cpp index f6490008e..431c82340 100644 --- a/tests/cbor/test_box.cpp +++ b/tests/cbor/test_box.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.cbor; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/cbor/test_bytestring.cpp b/tests/cbor/test_bytestring.cpp index d2ce3df09..b9e90d928 100644 --- a/tests/cbor/test_bytestring.cpp +++ b/tests/cbor/test_bytestring.cpp @@ -1,9 +1,10 @@ -#include "write_and_read.hpp" #include -import rfl.cbor; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_bytestring { diff --git a/tests/cbor/test_combined_processors.cpp b/tests/cbor/test_combined_processors.cpp index 53ef27526..e0531c9ed 100644 --- a/tests/cbor/test_combined_processors.cpp +++ b/tests/cbor/test_combined_processors.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.cbor; +#include namespace test_combined_processors { diff --git a/tests/cbor/test_custom_class1.cpp b/tests/cbor/test_custom_class1.cpp index 2ce8d3870..712dbc301 100644 --- a/tests/cbor/test_custom_class1.cpp +++ b/tests/cbor/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_custom_class1 { diff --git a/tests/cbor/test_custom_class3.cpp b/tests/cbor/test_custom_class3.cpp index a2c36426b..8859f7c84 100644 --- a/tests/cbor/test_custom_class3.cpp +++ b/tests/cbor/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_custom_class3 { diff --git a/tests/cbor/test_custom_class4.cpp b/tests/cbor/test_custom_class4.cpp index ae06833bf..022c21f92 100644 --- a/tests/cbor/test_custom_class4.cpp +++ b/tests/cbor/test_custom_class4.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_custom_class4 { diff --git a/tests/cbor/test_default_values.cpp b/tests/cbor/test_default_values.cpp index e74d4658d..e13602a58 100644 --- a/tests/cbor/test_default_values.cpp +++ b/tests/cbor/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_default_values { diff --git a/tests/cbor/test_deque.cpp b/tests/cbor/test_deque.cpp index 4a46ee844..0a45a72d6 100644 --- a/tests/cbor/test_deque.cpp +++ b/tests/cbor/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.cbor; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/cbor/test_enum.cpp b/tests/cbor/test_enum.cpp index 0d5282066..d05c4b1e0 100644 --- a/tests/cbor/test_enum.cpp +++ b/tests/cbor/test_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_enum { diff --git a/tests/cbor/test_error_messages.cpp b/tests/cbor/test_error_messages.cpp index 47b3785f3..b4949b870 100644 --- a/tests/cbor/test_error_messages.cpp +++ b/tests/cbor/test_error_messages.cpp @@ -2,9 +2,9 @@ #include #include -import rfl; -import rfl.json; -import rfl.cbor; +#include +#include +#include namespace test_error_messages { diff --git a/tests/cbor/test_extra_fields.cpp b/tests/cbor/test_extra_fields.cpp index 3a6767e42..e1f68300c 100644 --- a/tests/cbor/test_extra_fields.cpp +++ b/tests/cbor/test_extra_fields.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_extra_fields { diff --git a/tests/cbor/test_field_variant.cpp b/tests/cbor/test_field_variant.cpp index f1e0d3b09..adedeb8da 100644 --- a/tests/cbor/test_field_variant.cpp +++ b/tests/cbor/test_field_variant.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_field_variant { diff --git a/tests/cbor/test_flag_enum.cpp b/tests/cbor/test_flag_enum.cpp index 1899ca70e..0c34bcfc7 100644 --- a/tests/cbor/test_flag_enum.cpp +++ b/tests/cbor/test_flag_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_flag_enum { diff --git a/tests/cbor/test_flag_enum_with_int.cpp b/tests/cbor/test_flag_enum_with_int.cpp index 43b786db9..9ee223cbf 100644 --- a/tests/cbor/test_flag_enum_with_int.cpp +++ b/tests/cbor/test_flag_enum_with_int.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/cbor/test_flatten.cpp b/tests/cbor/test_flatten.cpp index 3bd34df81..2a9c7029b 100644 --- a/tests/cbor/test_flatten.cpp +++ b/tests/cbor/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_flatten { diff --git a/tests/cbor/test_flatten_anonymous.cpp b/tests/cbor/test_flatten_anonymous.cpp index 03760cdfc..bcf9a22de 100644 --- a/tests/cbor/test_flatten_anonymous.cpp +++ b/tests/cbor/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/cbor/test_forward_list.cpp b/tests/cbor/test_forward_list.cpp index 8e2252da6..366c9b62e 100644 --- a/tests/cbor/test_forward_list.cpp +++ b/tests/cbor/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.cbor; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/cbor/test_integers.cpp b/tests/cbor/test_integers.cpp index d7da8663d..4faca1a3f 100644 --- a/tests/cbor/test_integers.cpp +++ b/tests/cbor/test_integers.cpp @@ -1,7 +1,7 @@ #include #include "write_and_read.hpp" -import rfl.cbor; +#include namespace test_integers { diff --git a/tests/cbor/test_literal.cpp b/tests/cbor/test_literal.cpp index b50817f28..9de3a3c86 100644 --- a/tests/cbor/test_literal.cpp +++ b/tests/cbor/test_literal.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_literal { diff --git a/tests/cbor/test_literal_map.cpp b/tests/cbor/test_literal_map.cpp index 014d75db0..d78820557 100644 --- a/tests/cbor/test_literal_map.cpp +++ b/tests/cbor/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_literal_map { diff --git a/tests/cbor/test_map.cpp b/tests/cbor/test_map.cpp index 9aee6c052..3140ef8f3 100644 --- a/tests/cbor/test_map.cpp +++ b/tests/cbor/test_map.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.cbor; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map { diff --git a/tests/cbor/test_map_with_key_validation.cpp b/tests/cbor/test_map_with_key_validation.cpp index 69bb6a943..473382739 100644 --- a/tests/cbor/test_map_with_key_validation.cpp +++ b/tests/cbor/test_map_with_key_validation.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl.cbor; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map_with_key_validation { diff --git a/tests/cbor/test_monster_example.cpp b/tests/cbor/test_monster_example.cpp index 5a07b737f..23f81e67a 100644 --- a/tests/cbor/test_monster_example.cpp +++ b/tests/cbor/test_monster_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_monster_example { diff --git a/tests/cbor/test_no_optionals.cpp b/tests/cbor/test_no_optionals.cpp index fb9862e64..a3c96543c 100644 --- a/tests/cbor/test_no_optionals.cpp +++ b/tests/cbor/test_no_optionals.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.cbor; +#include "write_and_read.hpp" + +#include +#include namespace test_no_optionals { diff --git a/tests/cbor/test_optional_fields.cpp b/tests/cbor/test_optional_fields.cpp index 0bc6d3554..5ac56854a 100644 --- a/tests/cbor/test_optional_fields.cpp +++ b/tests/cbor/test_optional_fields.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.cbor; +#include "write_and_read.hpp" + +#include +#include namespace test_optional_fields { diff --git a/tests/cbor/test_read_byte_containers.cpp b/tests/cbor/test_read_byte_containers.cpp index fc0291a14..f66adcea8 100644 --- a/tests/cbor/test_read_byte_containers.cpp +++ b/tests/cbor/test_read_byte_containers.cpp @@ -6,8 +6,8 @@ #include #include -import rfl; -import rfl.cbor; +#include +#include // Make sure things still compile when diff --git a/tests/cbor/test_readme_example.cpp b/tests/cbor/test_readme_example.cpp index 138a0264f..aa71fa445 100644 --- a/tests/cbor/test_readme_example.cpp +++ b/tests/cbor/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_readme_example { diff --git a/tests/cbor/test_readme_example2.cpp b/tests/cbor/test_readme_example2.cpp index f16e0bb9f..acfb96dbc 100644 --- a/tests/cbor/test_readme_example2.cpp +++ b/tests/cbor/test_readme_example2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_readme_example2 { diff --git a/tests/cbor/test_ref.cpp b/tests/cbor/test_ref.cpp index 89af11d6c..a42dd4aba 100644 --- a/tests/cbor/test_ref.cpp +++ b/tests/cbor/test_ref.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.cbor; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/cbor/test_save_load.cpp b/tests/cbor/test_save_load.cpp index 99e8f8583..791448062 100644 --- a/tests/cbor/test_save_load.cpp +++ b/tests/cbor/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include -import rfl; -import rfl.cbor; +#include +#include namespace test_save_load { diff --git a/tests/cbor/test_set.cpp b/tests/cbor/test_set.cpp index 4ad76496e..d15c0752f 100644 --- a/tests/cbor/test_set.cpp +++ b/tests/cbor/test_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.cbor; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/cbor/test_size.cpp b/tests/cbor/test_size.cpp index 5cd66cb8d..5388c683b 100644 --- a/tests/cbor/test_size.cpp +++ b/tests/cbor/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_size { diff --git a/tests/cbor/test_snake_case_to_camel_case.cpp b/tests/cbor/test_snake_case_to_camel_case.cpp index c4cdbfbc3..de66f6743 100644 --- a/tests/cbor/test_snake_case_to_camel_case.cpp +++ b/tests/cbor/test_snake_case_to_camel_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.cbor; +#include namespace test_snake_case_to_camel_case { diff --git a/tests/cbor/test_snake_case_to_pascal_case.cpp b/tests/cbor/test_snake_case_to_pascal_case.cpp index de95a59ec..a7ac15610 100644 --- a/tests/cbor/test_snake_case_to_pascal_case.cpp +++ b/tests/cbor/test_snake_case_to_pascal_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.cbor; +#include namespace test_snake_case_to_pascal_case { diff --git a/tests/cbor/test_string_map.cpp b/tests/cbor/test_string_map.cpp index db18b71ac..3bd4294a2 100644 --- a/tests/cbor/test_string_map.cpp +++ b/tests/cbor/test_string_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_string_map { diff --git a/tests/cbor/test_tagged_union.cpp b/tests/cbor/test_tagged_union.cpp index 4e370aac5..a1e25da6f 100644 --- a/tests/cbor/test_tagged_union.cpp +++ b/tests/cbor/test_tagged_union.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_tagged_union { diff --git a/tests/cbor/test_tagged_union2.cpp b/tests/cbor/test_tagged_union2.cpp index 9dffbf06d..beb27c485 100644 --- a/tests/cbor/test_tagged_union2.cpp +++ b/tests/cbor/test_tagged_union2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_tagged_union2 { diff --git a/tests/cbor/test_timestamp.cpp b/tests/cbor/test_timestamp.cpp index d49ac3e19..2d3754300 100644 --- a/tests/cbor/test_timestamp.cpp +++ b/tests/cbor/test_timestamp.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_timestamp { diff --git a/tests/cbor/test_unique_ptr.cpp b/tests/cbor/test_unique_ptr.cpp index 51ce22131..43fad487b 100644 --- a/tests/cbor/test_unique_ptr.cpp +++ b/tests/cbor/test_unique_ptr.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.cbor; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr { diff --git a/tests/cbor/test_unique_ptr2.cpp b/tests/cbor/test_unique_ptr2.cpp index 814e9ba17..5179f4abf 100644 --- a/tests/cbor/test_unique_ptr2.cpp +++ b/tests/cbor/test_unique_ptr2.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.cbor; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/cbor/test_variant.cpp b/tests/cbor/test_variant.cpp index 1f20078f1..034288668 100644 --- a/tests/cbor/test_variant.cpp +++ b/tests/cbor/test_variant.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl.cbor; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/cbor/test_variant_auto_tagging.cpp b/tests/cbor/test_variant_auto_tagging.cpp index f80c1ffb3..c1716ecd4 100644 --- a/tests/cbor/test_variant_auto_tagging.cpp +++ b/tests/cbor/test_variant_auto_tagging.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.cbor; -import rfl; +#include "write_and_read.hpp" + +#include +#include // NOTE TO MAINTAINERS: diff --git a/tests/cbor/test_vectorstring.cpp b/tests/cbor/test_vectorstring.cpp index b3603b6eb..0a875f61f 100644 --- a/tests/cbor/test_vectorstring.cpp +++ b/tests/cbor/test_vectorstring.cpp @@ -1,7 +1,7 @@ #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include namespace test_vectorstring { diff --git a/tests/cbor/test_wstring.cpp b/tests/cbor/test_wstring.cpp index d7a99ae7d..e391927c4 100644 --- a/tests/cbor/test_wstring.cpp +++ b/tests/cbor/test_wstring.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cbor; -import rfl; +#include +#include struct TestStruct { diff --git a/tests/cbor/write_and_read.hpp b/tests/cbor/write_and_read.hpp index a57b470d0..de5874615 100644 --- a/tests/cbor/write_and_read.hpp +++ b/tests/cbor/write_and_read.hpp @@ -11,7 +11,7 @@ #include #include -import rfl.cbor; +#include // Helper function to parse hex bytes from CBOR diagnostic output diff --git a/tests/cereal/test_add_struct_name.cpp b/tests/cereal/test_add_struct_name.cpp index 50e44ddfa..c5841ad17 100644 --- a/tests/cereal/test_add_struct_name.cpp +++ b/tests/cereal/test_add_struct_name.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.cereal; +#include namespace test_add_struct_name { diff --git a/tests/cereal/test_array.cpp b/tests/cereal/test_array.cpp index b47128bdb..e4a871af0 100644 --- a/tests/cereal/test_array.cpp +++ b/tests/cereal/test_array.cpp @@ -3,11 +3,12 @@ #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.cereal; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/cereal/test_box.cpp b/tests/cereal/test_box.cpp index b6669fab9..6081e966d 100644 --- a/tests/cereal/test_box.cpp +++ b/tests/cereal/test_box.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.cereal; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/cereal/test_bytestring.cpp b/tests/cereal/test_bytestring.cpp index 66163ae00..97ee95ab2 100644 --- a/tests/cereal/test_bytestring.cpp +++ b/tests/cereal/test_bytestring.cpp @@ -1,9 +1,10 @@ -#include "write_and_read.hpp" #include -import rfl.cereal; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_bytestring { diff --git a/tests/cereal/test_custom_class1.cpp b/tests/cereal/test_custom_class1.cpp index 40215098c..884724448 100644 --- a/tests/cereal/test_custom_class1.cpp +++ b/tests/cereal/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include namespace test_custom_class1 { diff --git a/tests/cereal/test_custom_class3.cpp b/tests/cereal/test_custom_class3.cpp index ba8cb2977..7a46dd138 100644 --- a/tests/cereal/test_custom_class3.cpp +++ b/tests/cereal/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include namespace test_custom_class3 { diff --git a/tests/cereal/test_custom_class4.cpp b/tests/cereal/test_custom_class4.cpp index 9fe50d795..9bde8c7c6 100644 --- a/tests/cereal/test_custom_class4.cpp +++ b/tests/cereal/test_custom_class4.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.cereal; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_custom_class4 { diff --git a/tests/cereal/test_default_values.cpp b/tests/cereal/test_default_values.cpp index e95828fd1..42a01ccf8 100644 --- a/tests/cereal/test_default_values.cpp +++ b/tests/cereal/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include namespace test_default_values { diff --git a/tests/cereal/test_deque.cpp b/tests/cereal/test_deque.cpp index b94d4ecda..f386b2fb7 100644 --- a/tests/cereal/test_deque.cpp +++ b/tests/cereal/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.cereal; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/cereal/test_enum.cpp b/tests/cereal/test_enum.cpp index b7bc63c32..813f0e774 100644 --- a/tests/cereal/test_enum.cpp +++ b/tests/cereal/test_enum.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.cereal; +#include +#include namespace test_enum { diff --git a/tests/cereal/test_field_variant.cpp b/tests/cereal/test_field_variant.cpp index 119ab249d..3c622a77a 100644 --- a/tests/cereal/test_field_variant.cpp +++ b/tests/cereal/test_field_variant.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include namespace test_field_variant { diff --git a/tests/cereal/test_field_variant_std.cpp b/tests/cereal/test_field_variant_std.cpp index 35e00b03d..f279a2998 100644 --- a/tests/cereal/test_field_variant_std.cpp +++ b/tests/cereal/test_field_variant_std.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.cereal; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_field_variant_std { diff --git a/tests/cereal/test_flag_enum.cpp b/tests/cereal/test_flag_enum.cpp index 15f4f2ab3..f2665be19 100644 --- a/tests/cereal/test_flag_enum.cpp +++ b/tests/cereal/test_flag_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include namespace test_flag_enum { diff --git a/tests/cereal/test_flag_enum_with_int.cpp b/tests/cereal/test_flag_enum_with_int.cpp index aca530792..31b0ce228 100644 --- a/tests/cereal/test_flag_enum_with_int.cpp +++ b/tests/cereal/test_flag_enum_with_int.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/cereal/test_flatten.cpp b/tests/cereal/test_flatten.cpp index 7d1f1ea89..1f46bddf8 100644 --- a/tests/cereal/test_flatten.cpp +++ b/tests/cereal/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include namespace test_flatten { diff --git a/tests/cereal/test_flatten_anonymous.cpp b/tests/cereal/test_flatten_anonymous.cpp index 44f0f504d..374c88b1c 100644 --- a/tests/cereal/test_flatten_anonymous.cpp +++ b/tests/cereal/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/cereal/test_forward_list.cpp b/tests/cereal/test_forward_list.cpp index a6c97037e..6bf0ec211 100644 --- a/tests/cereal/test_forward_list.cpp +++ b/tests/cereal/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.cereal; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/cereal/test_generic.cpp b/tests/cereal/test_generic.cpp index f17f68a88..fc55125d1 100644 --- a/tests/cereal/test_generic.cpp +++ b/tests/cereal/test_generic.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.cereal; +#include +#include namespace test_generic { diff --git a/tests/cereal/test_literal.cpp b/tests/cereal/test_literal.cpp index 37cd81423..043a73a45 100644 --- a/tests/cereal/test_literal.cpp +++ b/tests/cereal/test_literal.cpp @@ -2,9 +2,9 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; -import rfl.json; +#include +#include +#include namespace test_literal { diff --git a/tests/cereal/test_literal_map.cpp b/tests/cereal/test_literal_map.cpp index 693e791b6..4495651b7 100644 --- a/tests/cereal/test_literal_map.cpp +++ b/tests/cereal/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include namespace test_literal_map { diff --git a/tests/cereal/test_map.cpp b/tests/cereal/test_map.cpp index 28a291f49..e8825a911 100644 --- a/tests/cereal/test_map.cpp +++ b/tests/cereal/test_map.cpp @@ -3,12 +3,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.cereal; +#include "write_and_read.hpp" + +#include +#include namespace test_map { diff --git a/tests/cereal/test_map2.cpp b/tests/cereal/test_map2.cpp index 9a7013b3c..2f72658f4 100644 --- a/tests/cereal/test_map2.cpp +++ b/tests/cereal/test_map2.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.cereal; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_map2 { diff --git a/tests/cereal/test_monster_example.cpp b/tests/cereal/test_monster_example.cpp index 9fea3ea8e..9e1f73c78 100644 --- a/tests/cereal/test_monster_example.cpp +++ b/tests/cereal/test_monster_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include namespace test_monster_example { diff --git a/tests/cereal/test_optional_fields.cpp b/tests/cereal/test_optional_fields.cpp index 13708ddf1..54a4fffea 100644 --- a/tests/cereal/test_optional_fields.cpp +++ b/tests/cereal/test_optional_fields.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.cereal; +#include "write_and_read.hpp" + +#include +#include namespace test_optional_fields { diff --git a/tests/cereal/test_optionals_in_vectors.cpp b/tests/cereal/test_optionals_in_vectors.cpp index 549c53775..2a13d2bb2 100644 --- a/tests/cereal/test_optionals_in_vectors.cpp +++ b/tests/cereal/test_optionals_in_vectors.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.cereal; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_optionals_in_vectors { diff --git a/tests/cereal/test_person.cpp b/tests/cereal/test_person.cpp index 85d0e14d0..d42eae804 100644 --- a/tests/cereal/test_person.cpp +++ b/tests/cereal/test_person.cpp @@ -4,8 +4,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.cereal; +#include +#include namespace test_person { diff --git a/tests/cereal/test_readme_example.cpp b/tests/cereal/test_readme_example.cpp index 197be5ffb..3c120af7a 100644 --- a/tests/cereal/test_readme_example.cpp +++ b/tests/cereal/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.cereal; +#include +#include namespace test_readme_example { diff --git a/tests/cereal/test_readme_example2.cpp b/tests/cereal/test_readme_example2.cpp index fa449e6cb..9062e7e53 100644 --- a/tests/cereal/test_readme_example2.cpp +++ b/tests/cereal/test_readme_example2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include namespace test_readme_example2 { diff --git a/tests/cereal/test_readme_example3.cpp b/tests/cereal/test_readme_example3.cpp index 9f7c9b4d0..40bce434a 100644 --- a/tests/cereal/test_readme_example3.cpp +++ b/tests/cereal/test_readme_example3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include namespace test_readme_example3 { diff --git a/tests/cereal/test_ref.cpp b/tests/cereal/test_ref.cpp index 5d0ced880..aa56fd63a 100644 --- a/tests/cereal/test_ref.cpp +++ b/tests/cereal/test_ref.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.cereal; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/cereal/test_rfl_tuple.cpp b/tests/cereal/test_rfl_tuple.cpp index c43ab731a..291980fe7 100644 --- a/tests/cereal/test_rfl_tuple.cpp +++ b/tests/cereal/test_rfl_tuple.cpp @@ -2,12 +2,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.cereal; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_rfl_tuple { diff --git a/tests/cereal/test_rfl_variant.cpp b/tests/cereal/test_rfl_variant.cpp index e37073333..c581fb19d 100644 --- a/tests/cereal/test_rfl_variant.cpp +++ b/tests/cereal/test_rfl_variant.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.cereal; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/cereal/test_save_load.cpp b/tests/cereal/test_save_load.cpp index e8cddb9d8..5ffd9389e 100644 --- a/tests/cereal/test_save_load.cpp +++ b/tests/cereal/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.cereal; +#include +#include namespace test_save_load { diff --git a/tests/cereal/test_set.cpp b/tests/cereal/test_set.cpp index 362e65152..12c959b1d 100644 --- a/tests/cereal/test_set.cpp +++ b/tests/cereal/test_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.cereal; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/cereal/test_shared_ptr.cpp b/tests/cereal/test_shared_ptr.cpp index 326a24a51..211e35641 100644 --- a/tests/cereal/test_shared_ptr.cpp +++ b/tests/cereal/test_shared_ptr.cpp @@ -2,12 +2,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.cereal; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_shared_ptr { diff --git a/tests/cereal/test_size.cpp b/tests/cereal/test_size.cpp index 061b23274..501d3c492 100644 --- a/tests/cereal/test_size.cpp +++ b/tests/cereal/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include namespace test_size { diff --git a/tests/cereal/test_string_map.cpp b/tests/cereal/test_string_map.cpp index 3b37fa951..dfc68df1f 100644 --- a/tests/cereal/test_string_map.cpp +++ b/tests/cereal/test_string_map.cpp @@ -3,9 +3,9 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; -import rfl.json; +#include +#include +#include namespace test_string_map { diff --git a/tests/cereal/test_tagged_union.cpp b/tests/cereal/test_tagged_union.cpp index 770bdcdc1..23466d48b 100644 --- a/tests/cereal/test_tagged_union.cpp +++ b/tests/cereal/test_tagged_union.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.cereal; +#include +#include namespace test_tagged_union { diff --git a/tests/cereal/test_timestamp.cpp b/tests/cereal/test_timestamp.cpp index a6cfc2eba..eb08f0587 100644 --- a/tests/cereal/test_timestamp.cpp +++ b/tests/cereal/test_timestamp.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.cereal; +#include +#include namespace test_timestamp { diff --git a/tests/cereal/test_tuple.cpp b/tests/cereal/test_tuple.cpp index 9cc3dd11a..11e84e147 100644 --- a/tests/cereal/test_tuple.cpp +++ b/tests/cereal/test_tuple.cpp @@ -4,8 +4,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.cereal; +#include +#include namespace test_tuple { diff --git a/tests/cereal/test_unique_ptr.cpp b/tests/cereal/test_unique_ptr.cpp index 17c60d5ed..6fce4d4c1 100644 --- a/tests/cereal/test_unique_ptr.cpp +++ b/tests/cereal/test_unique_ptr.cpp @@ -3,11 +3,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.cereal; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr { diff --git a/tests/cereal/test_unique_ptr2.cpp b/tests/cereal/test_unique_ptr2.cpp index 2757745af..a00dc714e 100644 --- a/tests/cereal/test_unique_ptr2.cpp +++ b/tests/cereal/test_unique_ptr2.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.cereal; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/cereal/test_variant.cpp b/tests/cereal/test_variant.cpp index c254d60c3..f1b1fee75 100644 --- a/tests/cereal/test_variant.cpp +++ b/tests/cereal/test_variant.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.cereal; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/cereal/test_variants_in_vectors.cpp b/tests/cereal/test_variants_in_vectors.cpp index aa8d3c0e6..c87eba4e5 100644 --- a/tests/cereal/test_variants_in_vectors.cpp +++ b/tests/cereal/test_variants_in_vectors.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.cereal; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_variants_in_vectors { diff --git a/tests/cereal/test_wstring.cpp b/tests/cereal/test_wstring.cpp index c0298d3f3..f9db860a1 100644 --- a/tests/cereal/test_wstring.cpp +++ b/tests/cereal/test_wstring.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.cereal; -import rfl; +#include +#include struct TestStruct { diff --git a/tests/cereal/write_and_read.hpp b/tests/cereal/write_and_read.hpp index 42c2adb77..c18b4e461 100644 --- a/tests/cereal/write_and_read.hpp +++ b/tests/cereal/write_and_read.hpp @@ -4,7 +4,7 @@ #include #include -import rfl.cereal; +#include diff --git a/tests/cli/test_basic.cpp b/tests/cli/test_basic.cpp index 2064a113c..fbee29a55 100644 --- a/tests/cli/test_basic.cpp +++ b/tests/cli/test_basic.cpp @@ -1,7 +1,7 @@ #include #include -import rfl; -import rfl.cli; +#include +#include namespace test_basic { diff --git a/tests/cli/test_bool_short_positional.cpp b/tests/cli/test_bool_short_positional.cpp index cc6b8e8cd..47d463d85 100644 --- a/tests/cli/test_bool_short_positional.cpp +++ b/tests/cli/test_bool_short_positional.cpp @@ -1,7 +1,7 @@ #include #include -import rfl; -import rfl.cli; +#include +#include namespace test_bool_short_positional { diff --git a/tests/cli/test_enum.cpp b/tests/cli/test_enum.cpp index 663ca4776..30fb6f713 100644 --- a/tests/cli/test_enum.cpp +++ b/tests/cli/test_enum.cpp @@ -1,7 +1,7 @@ #include #include -import rfl; -import rfl.cli; +#include +#include namespace test_enum { diff --git a/tests/cli/test_errors.cpp b/tests/cli/test_errors.cpp index 3fe871ce2..ec34534b9 100644 --- a/tests/cli/test_errors.cpp +++ b/tests/cli/test_errors.cpp @@ -1,7 +1,7 @@ #include #include -import rfl; -import rfl.cli; +#include +#include namespace test_errors { diff --git a/tests/cli/test_flatten.cpp b/tests/cli/test_flatten.cpp index ed8400e49..84e4efd49 100644 --- a/tests/cli/test_flatten.cpp +++ b/tests/cli/test_flatten.cpp @@ -1,7 +1,7 @@ #include #include -import rfl; -import rfl.cli; +#include +#include namespace test_flatten { diff --git a/tests/cli/test_kebab_case.cpp b/tests/cli/test_kebab_case.cpp index c3b4ea848..9985f4831 100644 --- a/tests/cli/test_kebab_case.cpp +++ b/tests/cli/test_kebab_case.cpp @@ -1,7 +1,7 @@ #include #include -import rfl; -import rfl.cli; +#include +#include namespace test_kebab_case { diff --git a/tests/cli/test_nested.cpp b/tests/cli/test_nested.cpp index 76fa146ac..ef066dffa 100644 --- a/tests/cli/test_nested.cpp +++ b/tests/cli/test_nested.cpp @@ -1,7 +1,7 @@ #include #include -import rfl; -import rfl.cli; +#include +#include namespace test_nested { diff --git a/tests/cli/test_optional.cpp b/tests/cli/test_optional.cpp index 50ea6d12e..03314869f 100644 --- a/tests/cli/test_optional.cpp +++ b/tests/cli/test_optional.cpp @@ -1,8 +1,8 @@ #include #include #include -import rfl; -import rfl.cli; +#include +#include namespace test_optional { diff --git a/tests/cli/test_positional.cpp b/tests/cli/test_positional.cpp index 0fe377f49..a1c364230 100644 --- a/tests/cli/test_positional.cpp +++ b/tests/cli/test_positional.cpp @@ -2,8 +2,8 @@ #include #include -import rfl; -import rfl.cli; +#include +#include namespace test_positional { diff --git a/tests/cli/test_positional_and_short.cpp b/tests/cli/test_positional_and_short.cpp index 63f1d5c5e..7aeb753db 100644 --- a/tests/cli/test_positional_and_short.cpp +++ b/tests/cli/test_positional_and_short.cpp @@ -1,7 +1,7 @@ #include #include -import rfl; -import rfl.cli; +#include +#include namespace test_positional_and_short { diff --git a/tests/cli/test_regression_bugs.cpp b/tests/cli/test_regression_bugs.cpp index 00fb6764c..5199c379c 100644 --- a/tests/cli/test_regression_bugs.cpp +++ b/tests/cli/test_regression_bugs.cpp @@ -3,8 +3,8 @@ #include #include #include -import rfl; -import rfl.cli; +#include +#include diff --git a/tests/cli/test_rename.cpp b/tests/cli/test_rename.cpp index c5c5118b8..29170a97d 100644 --- a/tests/cli/test_rename.cpp +++ b/tests/cli/test_rename.cpp @@ -1,7 +1,7 @@ #include #include -import rfl; -import rfl.cli; +#include +#include namespace test_rename { diff --git a/tests/cli/test_settings_macro.cpp b/tests/cli/test_settings_macro.cpp index 23d716f9d..422d59c62 100644 --- a/tests/cli/test_settings_macro.cpp +++ b/tests/cli/test_settings_macro.cpp @@ -3,7 +3,7 @@ #include #include -import rfl; +#include namespace test_settings_macro { diff --git a/tests/cli/test_short.cpp b/tests/cli/test_short.cpp index ad9de61b7..5f2dfddc7 100644 --- a/tests/cli/test_short.cpp +++ b/tests/cli/test_short.cpp @@ -1,7 +1,7 @@ #include #include -import rfl; -import rfl.cli; +#include +#include namespace test_short { diff --git a/tests/cli/test_vector.cpp b/tests/cli/test_vector.cpp index b53f1c49c..bf631879d 100644 --- a/tests/cli/test_vector.cpp +++ b/tests/cli/test_vector.cpp @@ -1,8 +1,8 @@ #include #include #include -import rfl; -import rfl.cli; +#include +#include namespace test_vector { diff --git a/tests/csv/test_boolean.cpp b/tests/csv/test_boolean.cpp index ed3235901..19132a664 100644 --- a/tests/csv/test_boolean.cpp +++ b/tests/csv/test_boolean.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.csv; +#include namespace test_boolean { diff --git a/tests/csv/test_box.cpp b/tests/csv/test_box.cpp index bd096bcba..40f904688 100644 --- a/tests/csv/test_box.cpp +++ b/tests/csv/test_box.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.csv; +#include namespace test_box { diff --git a/tests/csv/test_bytestring.cpp b/tests/csv/test_bytestring.cpp index d923a3ebd..db8903742 100644 --- a/tests/csv/test_bytestring.cpp +++ b/tests/csv/test_bytestring.cpp @@ -1,9 +1,10 @@ #include -#include "write_and_read.hpp" #include -import rfl.csv; +#include "write_and_read.hpp" + +#include namespace test_bytestring { diff --git a/tests/csv/test_camel_case.cpp b/tests/csv/test_camel_case.cpp index 41d312755..d726fd5ad 100644 --- a/tests/csv/test_camel_case.cpp +++ b/tests/csv/test_camel_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.csv; +#include namespace test_camel_case { diff --git a/tests/csv/test_deque.cpp b/tests/csv/test_deque.cpp index e38935e90..abb4e217c 100644 --- a/tests/csv/test_deque.cpp +++ b/tests/csv/test_deque.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.csv; +#include namespace test_deque { diff --git a/tests/csv/test_enums.cpp b/tests/csv/test_enums.cpp index 8f24b40d8..2503cc11b 100644 --- a/tests/csv/test_enums.cpp +++ b/tests/csv/test_enums.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.csv; +#include namespace test_enums { diff --git a/tests/csv/test_flatten.cpp b/tests/csv/test_flatten.cpp index fa4d712e7..d78ab857b 100644 --- a/tests/csv/test_flatten.cpp +++ b/tests/csv/test_flatten.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.csv; +#include namespace test_flatten { diff --git a/tests/csv/test_literal.cpp b/tests/csv/test_literal.cpp index 0724e4dfe..704a88eea 100644 --- a/tests/csv/test_literal.cpp +++ b/tests/csv/test_literal.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.csv; +#include namespace test_literal { diff --git a/tests/csv/test_optionals.cpp b/tests/csv/test_optionals.cpp index 71a640a99..7d55fab5e 100644 --- a/tests/csv/test_optionals.cpp +++ b/tests/csv/test_optionals.cpp @@ -3,7 +3,7 @@ #include #include "write_and_read.hpp" -import rfl.csv; +#include namespace test_optionals { diff --git a/tests/csv/test_readme_example.cpp b/tests/csv/test_readme_example.cpp index 87ba286cc..7e457b250 100644 --- a/tests/csv/test_readme_example.cpp +++ b/tests/csv/test_readme_example.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.csv; +#include namespace test_readme_example { diff --git a/tests/csv/test_ref.cpp b/tests/csv/test_ref.cpp index b366d3f07..4ab116f0b 100644 --- a/tests/csv/test_ref.cpp +++ b/tests/csv/test_ref.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.csv; +#include namespace test_ref { diff --git a/tests/csv/test_save_load.cpp b/tests/csv/test_save_load.cpp index 9918a63d3..07071ea75 100644 --- a/tests/csv/test_save_load.cpp +++ b/tests/csv/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include #include -import rfl; -import rfl.csv; +#include +#include namespace test_save_load { diff --git a/tests/csv/test_settings.cpp b/tests/csv/test_settings.cpp index 9696f80cb..2259ef6b5 100644 --- a/tests/csv/test_settings.cpp +++ b/tests/csv/test_settings.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.csv; +#include namespace test_settings { diff --git a/tests/csv/test_shared_ptr.cpp b/tests/csv/test_shared_ptr.cpp index 492a7132c..e82cf4277 100644 --- a/tests/csv/test_shared_ptr.cpp +++ b/tests/csv/test_shared_ptr.cpp @@ -3,7 +3,7 @@ #include #include "write_and_read.hpp" -import rfl.csv; +#include namespace test_shared_ptr { diff --git a/tests/csv/test_unique_ptr.cpp b/tests/csv/test_unique_ptr.cpp index 91c1a4821..6ef168882 100644 --- a/tests/csv/test_unique_ptr.cpp +++ b/tests/csv/test_unique_ptr.cpp @@ -3,7 +3,7 @@ #include #include "write_and_read.hpp" -import rfl.csv; +#include namespace test_unique_ptr { diff --git a/tests/csv/write_and_read.hpp b/tests/csv/write_and_read.hpp index 1ad944c2f..460363ba1 100644 --- a/tests/csv/write_and_read.hpp +++ b/tests/csv/write_and_read.hpp @@ -4,7 +4,7 @@ #include #include -import rfl.csv; +#include diff --git a/tests/flexbuffers/test_add_struct_name.cpp b/tests/flexbuffers/test_add_struct_name.cpp index 7716c0b02..e011fb655 100644 --- a/tests/flexbuffers/test_add_struct_name.cpp +++ b/tests/flexbuffers/test_add_struct_name.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; +#include namespace test_add_struct_name { diff --git a/tests/flexbuffers/test_array.cpp b/tests/flexbuffers/test_array.cpp index a59fbca7e..6d932e06a 100644 --- a/tests/flexbuffers/test_array.cpp +++ b/tests/flexbuffers/test_array.cpp @@ -5,11 +5,12 @@ // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include "write_and_read.hpp" #include -import rfl; -import rfl.flexbuf; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/flexbuffers/test_box.cpp b/tests/flexbuffers/test_box.cpp index 58220194d..b469345ca 100644 --- a/tests/flexbuffers/test_box.cpp +++ b/tests/flexbuffers/test_box.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.flexbuf; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/flexbuffers/test_bytestring.cpp b/tests/flexbuffers/test_bytestring.cpp index 309f5321b..48c1c0fa2 100644 --- a/tests/flexbuffers/test_bytestring.cpp +++ b/tests/flexbuffers/test_bytestring.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.flexbuf; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_bytestring { diff --git a/tests/flexbuffers/test_combined_processors.cpp b/tests/flexbuffers/test_combined_processors.cpp index c82af8f41..614e20b67 100644 --- a/tests/flexbuffers/test_combined_processors.cpp +++ b/tests/flexbuffers/test_combined_processors.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; +#include namespace test_combined_processors { diff --git a/tests/flexbuffers/test_custom_class1.cpp b/tests/flexbuffers/test_custom_class1.cpp index 84fd67966..ef2cd198f 100644 --- a/tests/flexbuffers/test_custom_class1.cpp +++ b/tests/flexbuffers/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_custom_class1 { diff --git a/tests/flexbuffers/test_custom_class3.cpp b/tests/flexbuffers/test_custom_class3.cpp index f9d9b0445..ee7a017c7 100644 --- a/tests/flexbuffers/test_custom_class3.cpp +++ b/tests/flexbuffers/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_custom_class3 { diff --git a/tests/flexbuffers/test_custom_class4.cpp b/tests/flexbuffers/test_custom_class4.cpp index 155ec2a4f..e1b9ef7ea 100644 --- a/tests/flexbuffers/test_custom_class4.cpp +++ b/tests/flexbuffers/test_custom_class4.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_custom_class4 { diff --git a/tests/flexbuffers/test_default_values.cpp b/tests/flexbuffers/test_default_values.cpp index 6f805c4ef..d98468b67 100644 --- a/tests/flexbuffers/test_default_values.cpp +++ b/tests/flexbuffers/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_default_values { diff --git a/tests/flexbuffers/test_deque.cpp b/tests/flexbuffers/test_deque.cpp index ac1d93130..ef87bf07d 100644 --- a/tests/flexbuffers/test_deque.cpp +++ b/tests/flexbuffers/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.flexbuf; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/flexbuffers/test_enum.cpp b/tests/flexbuffers/test_enum.cpp index 184b484bf..b61449df2 100644 --- a/tests/flexbuffers/test_enum.cpp +++ b/tests/flexbuffers/test_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_enum { diff --git a/tests/flexbuffers/test_field_variant.cpp b/tests/flexbuffers/test_field_variant.cpp index ca036d0f8..c69356aa5 100644 --- a/tests/flexbuffers/test_field_variant.cpp +++ b/tests/flexbuffers/test_field_variant.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_field_variant { diff --git a/tests/flexbuffers/test_flag_enum.cpp b/tests/flexbuffers/test_flag_enum.cpp index 528a36de6..a6537b7ee 100644 --- a/tests/flexbuffers/test_flag_enum.cpp +++ b/tests/flexbuffers/test_flag_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_flag_enum { diff --git a/tests/flexbuffers/test_flag_enum_with_int.cpp b/tests/flexbuffers/test_flag_enum_with_int.cpp index 17379b3c7..c919ef364 100644 --- a/tests/flexbuffers/test_flag_enum_with_int.cpp +++ b/tests/flexbuffers/test_flag_enum_with_int.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/flexbuffers/test_flatten.cpp b/tests/flexbuffers/test_flatten.cpp index f312da060..c2e2ce3f5 100644 --- a/tests/flexbuffers/test_flatten.cpp +++ b/tests/flexbuffers/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_flatten { diff --git a/tests/flexbuffers/test_flatten_anonymous.cpp b/tests/flexbuffers/test_flatten_anonymous.cpp index 0a22a7523..5b89eba40 100644 --- a/tests/flexbuffers/test_flatten_anonymous.cpp +++ b/tests/flexbuffers/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/flexbuffers/test_forward_list.cpp b/tests/flexbuffers/test_forward_list.cpp index f725d63dc..76e797a65 100644 --- a/tests/flexbuffers/test_forward_list.cpp +++ b/tests/flexbuffers/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.flexbuf; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/flexbuffers/test_literal.cpp b/tests/flexbuffers/test_literal.cpp index bcd219664..8de6e4569 100644 --- a/tests/flexbuffers/test_literal.cpp +++ b/tests/flexbuffers/test_literal.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_literal { diff --git a/tests/flexbuffers/test_literal_map.cpp b/tests/flexbuffers/test_literal_map.cpp index 75ba8bbcf..a45a7817c 100644 --- a/tests/flexbuffers/test_literal_map.cpp +++ b/tests/flexbuffers/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_literal_map { diff --git a/tests/flexbuffers/test_map.cpp b/tests/flexbuffers/test_map.cpp index a78e9247e..a47df646a 100644 --- a/tests/flexbuffers/test_map.cpp +++ b/tests/flexbuffers/test_map.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.flexbuf; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map { diff --git a/tests/flexbuffers/test_map_with_key_validation.cpp b/tests/flexbuffers/test_map_with_key_validation.cpp index 8f0ec1960..e1e54184f 100644 --- a/tests/flexbuffers/test_map_with_key_validation.cpp +++ b/tests/flexbuffers/test_map_with_key_validation.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl.flexbuf; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map_with_key_validation { diff --git a/tests/flexbuffers/test_monster_example.cpp b/tests/flexbuffers/test_monster_example.cpp index d878202b7..3ae8433bd 100644 --- a/tests/flexbuffers/test_monster_example.cpp +++ b/tests/flexbuffers/test_monster_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_monster_example { diff --git a/tests/flexbuffers/test_readme_example.cpp b/tests/flexbuffers/test_readme_example.cpp index 5d71089c5..bc90038da 100644 --- a/tests/flexbuffers/test_readme_example.cpp +++ b/tests/flexbuffers/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_readme_example { diff --git a/tests/flexbuffers/test_readme_example2.cpp b/tests/flexbuffers/test_readme_example2.cpp index 1f7c780ee..1712333ec 100644 --- a/tests/flexbuffers/test_readme_example2.cpp +++ b/tests/flexbuffers/test_readme_example2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_readme_example2 { diff --git a/tests/flexbuffers/test_ref.cpp b/tests/flexbuffers/test_ref.cpp index a2525c40d..3e4a1b735 100644 --- a/tests/flexbuffers/test_ref.cpp +++ b/tests/flexbuffers/test_ref.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.flexbuf; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/flexbuffers/test_save_load.cpp b/tests/flexbuffers/test_save_load.cpp index 860870e5b..ebb1dcc46 100644 --- a/tests/flexbuffers/test_save_load.cpp +++ b/tests/flexbuffers/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include -import rfl; -import rfl.flexbuf; +#include +#include namespace test_save_load { diff --git a/tests/flexbuffers/test_set.cpp b/tests/flexbuffers/test_set.cpp index 3ce75fc92..17dd72c4c 100644 --- a/tests/flexbuffers/test_set.cpp +++ b/tests/flexbuffers/test_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.flexbuf; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/flexbuffers/test_size.cpp b/tests/flexbuffers/test_size.cpp index b55b9ece7..514643101 100644 --- a/tests/flexbuffers/test_size.cpp +++ b/tests/flexbuffers/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_size { diff --git a/tests/flexbuffers/test_snake_case_to_camel_case.cpp b/tests/flexbuffers/test_snake_case_to_camel_case.cpp index 9de25c69b..f90dbaae4 100644 --- a/tests/flexbuffers/test_snake_case_to_camel_case.cpp +++ b/tests/flexbuffers/test_snake_case_to_camel_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; +#include namespace test_snake_case_to_camel_case { diff --git a/tests/flexbuffers/test_snake_case_to_pascal_case.cpp b/tests/flexbuffers/test_snake_case_to_pascal_case.cpp index cf8bbe7c9..fa7b711b5 100644 --- a/tests/flexbuffers/test_snake_case_to_pascal_case.cpp +++ b/tests/flexbuffers/test_snake_case_to_pascal_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; +#include namespace test_snake_case_to_pascal_case { diff --git a/tests/flexbuffers/test_string_map.cpp b/tests/flexbuffers/test_string_map.cpp index e3b299d48..a7db2ab54 100644 --- a/tests/flexbuffers/test_string_map.cpp +++ b/tests/flexbuffers/test_string_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_string_map { diff --git a/tests/flexbuffers/test_tagged_union.cpp b/tests/flexbuffers/test_tagged_union.cpp index fc15135f8..fba67159e 100644 --- a/tests/flexbuffers/test_tagged_union.cpp +++ b/tests/flexbuffers/test_tagged_union.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_tagged_union { diff --git a/tests/flexbuffers/test_tagged_union2.cpp b/tests/flexbuffers/test_tagged_union2.cpp index 6e91840e5..4db25bd01 100644 --- a/tests/flexbuffers/test_tagged_union2.cpp +++ b/tests/flexbuffers/test_tagged_union2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_tagged_union2 { diff --git a/tests/flexbuffers/test_timestamp.cpp b/tests/flexbuffers/test_timestamp.cpp index 27c437df0..ab3dc566f 100644 --- a/tests/flexbuffers/test_timestamp.cpp +++ b/tests/flexbuffers/test_timestamp.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include namespace test_timestamp { diff --git a/tests/flexbuffers/test_unique_ptr.cpp b/tests/flexbuffers/test_unique_ptr.cpp index e86abe185..73c70a5a0 100644 --- a/tests/flexbuffers/test_unique_ptr.cpp +++ b/tests/flexbuffers/test_unique_ptr.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.flexbuf; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr { diff --git a/tests/flexbuffers/test_unique_ptr2.cpp b/tests/flexbuffers/test_unique_ptr2.cpp index 298d5870a..94e66561b 100644 --- a/tests/flexbuffers/test_unique_ptr2.cpp +++ b/tests/flexbuffers/test_unique_ptr2.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.flexbuf; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/flexbuffers/test_variant.cpp b/tests/flexbuffers/test_variant.cpp index 842cf2ad4..a15363b8f 100644 --- a/tests/flexbuffers/test_variant.cpp +++ b/tests/flexbuffers/test_variant.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.flexbuf; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/flexbuffers/test_wstring.cpp b/tests/flexbuffers/test_wstring.cpp index e863cf908..576150992 100644 --- a/tests/flexbuffers/test_wstring.cpp +++ b/tests/flexbuffers/test_wstring.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.flexbuf; -import rfl; +#include +#include struct TestStruct { diff --git a/tests/flexbuffers/write_and_read.hpp b/tests/flexbuffers/write_and_read.hpp index 8d7d1e6e2..6fa9a02df 100644 --- a/tests/flexbuffers/write_and_read.hpp +++ b/tests/flexbuffers/write_and_read.hpp @@ -4,7 +4,7 @@ #include #include -import rfl.flexbuf; +#include diff --git a/tests/generic/compile_fail/flatten_cross_type_move_assign.cpp b/tests/generic/compile_fail/flatten_cross_type_move_assign.cpp index 4e6b0ecf3..23d354abc 100644 --- a/tests/generic/compile_fail/flatten_cross_type_move_assign.cpp +++ b/tests/generic/compile_fail/flatten_cross_type_move_assign.cpp @@ -1,6 +1,6 @@ #include -import rfl; +#include // Flatten::operator=(Flatten&&) uses std::forward(_f) which passes diff --git a/tests/generic/test_array.cpp b/tests/generic/test_array.cpp index 9e7d98e96..656020307 100644 --- a/tests/generic/test_array.cpp +++ b/tests/generic/test_array.cpp @@ -2,10 +2,11 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; +#include "write_and_read.hpp" + +#include namespace test_array { diff --git a/tests/generic/test_bad_access_error.cpp b/tests/generic/test_bad_access_error.cpp index 357657b95..a40aa8835 100644 --- a/tests/generic/test_bad_access_error.cpp +++ b/tests/generic/test_bad_access_error.cpp @@ -5,7 +5,7 @@ #include #include -import rfl; +#include diff --git a/tests/generic/test_box.cpp b/tests/generic/test_box.cpp index 850f27384..08e2a2a12 100644 --- a/tests/generic/test_box.cpp +++ b/tests/generic/test_box.cpp @@ -1,9 +1,10 @@ #include -#include "write_and_read.hpp" #include -import rfl; +#include "write_and_read.hpp" + +#include namespace test_box { diff --git a/tests/generic/test_byte_containers.cpp b/tests/generic/test_byte_containers.cpp index 7d666eb6d..6e038df86 100644 --- a/tests/generic/test_byte_containers.cpp +++ b/tests/generic/test_byte_containers.cpp @@ -3,13 +3,14 @@ #include #include -#include "write_and_read.hpp" #include #include #include #include -import rfl; +#include "write_and_read.hpp" + +#include namespace test_byte_container_concepts { diff --git a/tests/generic/test_custom_class1.cpp b/tests/generic/test_custom_class1.cpp index 15f191102..d4466610e 100644 --- a/tests/generic/test_custom_class1.cpp +++ b/tests/generic/test_custom_class1.cpp @@ -3,7 +3,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_custom_class1 { diff --git a/tests/generic/test_custom_class3.cpp b/tests/generic/test_custom_class3.cpp index 2ea97b421..c5966ad8f 100644 --- a/tests/generic/test_custom_class3.cpp +++ b/tests/generic/test_custom_class3.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_custom_class3 { diff --git a/tests/generic/test_custom_class4.cpp b/tests/generic/test_custom_class4.cpp index 2ef62dbfb..9a6317da7 100644 --- a/tests/generic/test_custom_class4.cpp +++ b/tests/generic/test_custom_class4.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_custom_class4 { diff --git a/tests/generic/test_default_values.cpp b/tests/generic/test_default_values.cpp index b8410c633..77c533420 100644 --- a/tests/generic/test_default_values.cpp +++ b/tests/generic/test_default_values.cpp @@ -3,7 +3,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_default_values { diff --git a/tests/generic/test_deque.cpp b/tests/generic/test_deque.cpp index fa8a5ae8f..c62cf1e49 100644 --- a/tests/generic/test_deque.cpp +++ b/tests/generic/test_deque.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl; +#include "write_and_read.hpp" + +#include namespace test_deque { diff --git a/tests/generic/test_enum.cpp b/tests/generic/test_enum.cpp index e1b82f185..b634704c1 100644 --- a/tests/generic/test_enum.cpp +++ b/tests/generic/test_enum.cpp @@ -1,7 +1,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_enum { diff --git a/tests/generic/test_enum_range.cpp b/tests/generic/test_enum_range.cpp index fef9671e1..be2a73dc5 100644 --- a/tests/generic/test_enum_range.cpp +++ b/tests/generic/test_enum_range.cpp @@ -1,7 +1,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include diff --git a/tests/generic/test_enum_range_min_max.cpp b/tests/generic/test_enum_range_min_max.cpp index fa2f99653..d4e77e781 100644 --- a/tests/generic/test_enum_range_min_max.cpp +++ b/tests/generic/test_enum_range_min_max.cpp @@ -1,6 +1,6 @@ #include -import rfl; +#include namespace test_enum_range_min_max { diff --git a/tests/generic/test_enum_range_size.cpp b/tests/generic/test_enum_range_size.cpp index 69d55a558..c2ed06969 100644 --- a/tests/generic/test_enum_range_size.cpp +++ b/tests/generic/test_enum_range_size.cpp @@ -1,5 +1,5 @@ #include -import rfl; +#include namespace test_enum_range_size { diff --git a/tests/generic/test_field.cpp b/tests/generic/test_field.cpp index 7531da485..24d5c4f25 100644 --- a/tests/generic/test_field.cpp +++ b/tests/generic/test_field.cpp @@ -1,10 +1,11 @@ #include -#include "test_helpers.hpp" #include -import rfl; +#include "test_helpers.hpp" + +#include namespace test_field_cross_move { diff --git a/tests/generic/test_field_variant.cpp b/tests/generic/test_field_variant.cpp index bfcff7187..86d38ea4c 100644 --- a/tests/generic/test_field_variant.cpp +++ b/tests/generic/test_field_variant.cpp @@ -1,7 +1,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_field_variant { diff --git a/tests/generic/test_flag_enum.cpp b/tests/generic/test_flag_enum.cpp index a3b6a4001..377930c98 100644 --- a/tests/generic/test_flag_enum.cpp +++ b/tests/generic/test_flag_enum.cpp @@ -1,7 +1,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_flag_enum { diff --git a/tests/generic/test_flag_enum_with_int.cpp b/tests/generic/test_flag_enum_with_int.cpp index 5a8b0cefb..fd5ebe74d 100644 --- a/tests/generic/test_flag_enum_with_int.cpp +++ b/tests/generic/test_flag_enum_with_int.cpp @@ -1,7 +1,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_flag_enum_with_int { diff --git a/tests/generic/test_flatten.cpp b/tests/generic/test_flatten.cpp index 52e5fe5e5..f4acae47d 100644 --- a/tests/generic/test_flatten.cpp +++ b/tests/generic/test_flatten.cpp @@ -1,12 +1,13 @@ #include #include -#include "test_helpers.hpp" -#include "write_and_read.hpp" #include -import rfl; +#include "test_helpers.hpp" +#include "write_and_read.hpp" + +#include namespace test_flatten { diff --git a/tests/generic/test_flatten_anonymous.cpp b/tests/generic/test_flatten_anonymous.cpp index fd2d3f1af..4e2eadd8e 100644 --- a/tests/generic/test_flatten_anonymous.cpp +++ b/tests/generic/test_flatten_anonymous.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_flatten_anonymous { diff --git a/tests/generic/test_forward_list.cpp b/tests/generic/test_forward_list.cpp index 83f262d54..f42ed62b5 100644 --- a/tests/generic/test_forward_list.cpp +++ b/tests/generic/test_forward_list.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl; +#include "write_and_read.hpp" + +#include namespace test_forward_list { diff --git a/tests/generic/test_generic.cpp b/tests/generic/test_generic.cpp index b2a3d025f..ecf02e6d4 100644 --- a/tests/generic/test_generic.cpp +++ b/tests/generic/test_generic.cpp @@ -2,7 +2,7 @@ #include #include -import rfl; +#include diff --git a/tests/generic/test_literal.cpp b/tests/generic/test_literal.cpp index 28383c639..eac2a3b8c 100644 --- a/tests/generic/test_literal.cpp +++ b/tests/generic/test_literal.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_literal { diff --git a/tests/generic/test_literal_map.cpp b/tests/generic/test_literal_map.cpp index 87c5b9f3c..6b11b2c48 100644 --- a/tests/generic/test_literal_map.cpp +++ b/tests/generic/test_literal_map.cpp @@ -3,7 +3,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_literal_map { diff --git a/tests/generic/test_map.cpp b/tests/generic/test_map.cpp index f0753f4de..6c672aa24 100644 --- a/tests/generic/test_map.cpp +++ b/tests/generic/test_map.cpp @@ -1,10 +1,11 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; +#include "write_and_read.hpp" + +#include namespace test_map { diff --git a/tests/generic/test_map_with_key_validation.cpp b/tests/generic/test_map_with_key_validation.cpp index 2ee2b96ea..a1426ebe5 100644 --- a/tests/generic/test_map_with_key_validation.cpp +++ b/tests/generic/test_map_with_key_validation.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; +#include "write_and_read.hpp" + +#include namespace test_map_with_key_validation { diff --git a/tests/generic/test_monster_example.cpp b/tests/generic/test_monster_example.cpp index 406c7206d..b42f25d49 100644 --- a/tests/generic/test_monster_example.cpp +++ b/tests/generic/test_monster_example.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_monster_example { diff --git a/tests/generic/test_object.cpp b/tests/generic/test_object.cpp index 83eb7118f..f539fdc11 100644 --- a/tests/generic/test_object.cpp +++ b/tests/generic/test_object.cpp @@ -1,7 +1,7 @@ #include #include -import rfl; +#include diff --git a/tests/generic/test_optional.cpp b/tests/generic/test_optional.cpp index 51fc88c53..5d751a64c 100644 --- a/tests/generic/test_optional.cpp +++ b/tests/generic/test_optional.cpp @@ -2,7 +2,7 @@ #include #include -import rfl; +#include namespace test_optional { diff --git a/tests/generic/test_readme_example.cpp b/tests/generic/test_readme_example.cpp index 0441060d5..e6ca7eb8c 100644 --- a/tests/generic/test_readme_example.cpp +++ b/tests/generic/test_readme_example.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_readme_example { diff --git a/tests/generic/test_readme_example2.cpp b/tests/generic/test_readme_example2.cpp index cda2ad908..c085139b0 100644 --- a/tests/generic/test_readme_example2.cpp +++ b/tests/generic/test_readme_example2.cpp @@ -1,7 +1,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_readme_example2 { diff --git a/tests/generic/test_ref.cpp b/tests/generic/test_ref.cpp index 7f5889e1f..11a2f8b47 100644 --- a/tests/generic/test_ref.cpp +++ b/tests/generic/test_ref.cpp @@ -1,9 +1,10 @@ #include -#include "write_and_read.hpp" #include -import rfl; +#include "write_and_read.hpp" + +#include namespace test_ref { diff --git a/tests/generic/test_result.cpp b/tests/generic/test_result.cpp index dbe814443..fdab3bd9e 100644 --- a/tests/generic/test_result.cpp +++ b/tests/generic/test_result.cpp @@ -2,7 +2,7 @@ #include #include -import rfl; +#include diff --git a/tests/generic/test_set.cpp b/tests/generic/test_set.cpp index 3a048fa2f..958c6d33b 100644 --- a/tests/generic/test_set.cpp +++ b/tests/generic/test_set.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl; +#include "write_and_read.hpp" + +#include namespace test_set { diff --git a/tests/generic/test_size.cpp b/tests/generic/test_size.cpp index 479dd9977..d43840c5e 100644 --- a/tests/generic/test_size.cpp +++ b/tests/generic/test_size.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_size { diff --git a/tests/generic/test_skip.cpp b/tests/generic/test_skip.cpp index 96c53d960..ba1d0d5d0 100644 --- a/tests/generic/test_skip.cpp +++ b/tests/generic/test_skip.cpp @@ -1,10 +1,11 @@ #include -#include "test_helpers.hpp" #include -import rfl; +#include "test_helpers.hpp" + +#include namespace test_skip_cross_move { diff --git a/tests/generic/test_string_map.cpp b/tests/generic/test_string_map.cpp index be5f1b2a0..bc530a4b9 100644 --- a/tests/generic/test_string_map.cpp +++ b/tests/generic/test_string_map.cpp @@ -3,7 +3,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_string_map { diff --git a/tests/generic/test_tagged_union.cpp b/tests/generic/test_tagged_union.cpp index cb19c16b0..009be765e 100644 --- a/tests/generic/test_tagged_union.cpp +++ b/tests/generic/test_tagged_union.cpp @@ -1,10 +1,11 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; +#include "write_and_read.hpp" + +#include namespace test_tagged_union { diff --git a/tests/generic/test_timestamp.cpp b/tests/generic/test_timestamp.cpp index 31e9726fb..daf90a6f1 100644 --- a/tests/generic/test_timestamp.cpp +++ b/tests/generic/test_timestamp.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_timestamp { diff --git a/tests/generic/test_tuple.cpp b/tests/generic/test_tuple.cpp index 237233b3a..72ec26968 100644 --- a/tests/generic/test_tuple.cpp +++ b/tests/generic/test_tuple.cpp @@ -3,7 +3,7 @@ #include #include #include -import rfl; +#include diff --git a/tests/generic/test_unique_ptr.cpp b/tests/generic/test_unique_ptr.cpp index 942ab0e21..a874c44a0 100644 --- a/tests/generic/test_unique_ptr.cpp +++ b/tests/generic/test_unique_ptr.cpp @@ -2,10 +2,11 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; +#include "write_and_read.hpp" + +#include namespace test_unique_ptr { diff --git a/tests/generic/test_unique_ptr2.cpp b/tests/generic/test_unique_ptr2.cpp index f648df465..f04467e67 100644 --- a/tests/generic/test_unique_ptr2.cpp +++ b/tests/generic/test_unique_ptr2.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include #include -import rfl; +#include "write_and_read.hpp" + +#include namespace test_unique_ptr2 { diff --git a/tests/generic/test_variant.cpp b/tests/generic/test_variant.cpp index db6f8f22c..d74d87ef7 100644 --- a/tests/generic/test_variant.cpp +++ b/tests/generic/test_variant.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include #include -import rfl; +#include "write_and_read.hpp" + +#include namespace test_variant { diff --git a/tests/generic/test_wstring.cpp b/tests/generic/test_wstring.cpp index 6f5d73836..be566a229 100644 --- a/tests/generic/test_wstring.cpp +++ b/tests/generic/test_wstring.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include struct TestStruct { diff --git a/tests/generic/write_and_read.hpp b/tests/generic/write_and_read.hpp index dd91eaf47..45bacec08 100644 --- a/tests/generic/write_and_read.hpp +++ b/tests/generic/write_and_read.hpp @@ -4,7 +4,7 @@ #include #include -import rfl.json; +#include diff --git a/tests/json/test_add_namespaced_tags_to_rfl_variants.cpp b/tests/json/test_add_namespaced_tags_to_rfl_variants.cpp index e9c35416c..a11af41d6 100644 --- a/tests/json/test_add_namespaced_tags_to_rfl_variants.cpp +++ b/tests/json/test_add_namespaced_tags_to_rfl_variants.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include // NOTE TO MAINTAINERS: diff --git a/tests/json/test_add_namespaced_tags_to_variants.cpp b/tests/json/test_add_namespaced_tags_to_variants.cpp index c164b34e0..481f31283 100644 --- a/tests/json/test_add_namespaced_tags_to_variants.cpp +++ b/tests/json/test_add_namespaced_tags_to_variants.cpp @@ -4,8 +4,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include // NOTE TO MAINTAINERS: diff --git a/tests/json/test_add_struct_name.cpp b/tests/json/test_add_struct_name.cpp index 0f314e63f..db8c92869 100644 --- a/tests/json/test_add_struct_name.cpp +++ b/tests/json/test_add_struct_name.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_add_struct_name { diff --git a/tests/json/test_add_tags_to_rfl_variants.cpp b/tests/json/test_add_tags_to_rfl_variants.cpp index 1ee67a34b..232ee3b9b 100644 --- a/tests/json/test_add_tags_to_rfl_variants.cpp +++ b/tests/json/test_add_tags_to_rfl_variants.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include // NOTE TO MAINTAINERS: diff --git a/tests/json/test_add_tags_to_variants.cpp b/tests/json/test_add_tags_to_variants.cpp index 59e3e6540..d8636230a 100644 --- a/tests/json/test_add_tags_to_variants.cpp +++ b/tests/json/test_add_tags_to_variants.cpp @@ -4,8 +4,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include // NOTE TO MAINTAINERS: diff --git a/tests/json/test_all_of.cpp b/tests/json/test_all_of.cpp index ec9e00f7d..993e314c3 100644 --- a/tests/json/test_all_of.cpp +++ b/tests/json/test_all_of.cpp @@ -4,8 +4,8 @@ // rfl.hpp is included after rfl/json.hpp. #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_all_of { diff --git a/tests/json/test_alphanumeric_map.cpp b/tests/json/test_alphanumeric_map.cpp index c32f0c5a3..e1b0efc7f 100644 --- a/tests/json/test_alphanumeric_map.cpp +++ b/tests/json/test_alphanumeric_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_alphanumeric_map { diff --git a/tests/json/test_alphanumeric_unordered_map.cpp b/tests/json/test_alphanumeric_unordered_map.cpp index c02707254..8b97f2d2f 100644 --- a/tests/json/test_alphanumeric_unordered_map.cpp +++ b/tests/json/test_alphanumeric_unordered_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_alphanumeric_unordered_map { diff --git a/tests/json/test_and_then.cpp b/tests/json/test_and_then.cpp index e1d9ae546..732daeed1 100644 --- a/tests/json/test_and_then.cpp +++ b/tests/json/test_and_then.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_and_then { diff --git a/tests/json/test_anonymous_fields.cpp b/tests/json/test_anonymous_fields.cpp index 59c493f9b..c182fde46 100644 --- a/tests/json/test_anonymous_fields.cpp +++ b/tests/json/test_anonymous_fields.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_anonymous_fields { diff --git a/tests/json/test_any_of.cpp b/tests/json/test_any_of.cpp index 4e3a83cfc..af6546acf 100644 --- a/tests/json/test_any_of.cpp +++ b/tests/json/test_any_of.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_any_of { diff --git a/tests/json/test_apply.cpp b/tests/json/test_apply.cpp index 2faaea605..9370e7530 100644 --- a/tests/json/test_apply.cpp +++ b/tests/json/test_apply.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_apply { diff --git a/tests/json/test_apply_on_named_tuple.cpp b/tests/json/test_apply_on_named_tuple.cpp index 3dd3425de..62ffe8858 100644 --- a/tests/json/test_apply_on_named_tuple.cpp +++ b/tests/json/test_apply_on_named_tuple.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_apply_on_named_tuple { diff --git a/tests/json/test_array.cpp b/tests/json/test_array.cpp index f5c627e4f..e9e99b0d2 100644 --- a/tests/json/test_array.cpp +++ b/tests/json/test_array.cpp @@ -3,11 +3,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/json/test_array2.cpp b/tests/json/test_array2.cpp index 59feec502..031948822 100644 --- a/tests/json/test_array2.cpp +++ b/tests/json/test_array2.cpp @@ -3,7 +3,7 @@ #include #include "write_and_read.hpp" -import rfl; +#include namespace test_array2 { diff --git a/tests/json/test_as.cpp b/tests/json/test_as.cpp index f08d5662e..ff08faea1 100644 --- a/tests/json/test_as.cpp +++ b/tests/json/test_as.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_as { diff --git a/tests/json/test_as2.cpp b/tests/json/test_as2.cpp index e86da4ccc..0bfb302f1 100644 --- a/tests/json/test_as2.cpp +++ b/tests/json/test_as2.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_as2 { diff --git a/tests/json/test_as_flatten.cpp b/tests/json/test_as_flatten.cpp index 54b4ba0b0..1bb844937 100644 --- a/tests/json/test_as_flatten.cpp +++ b/tests/json/test_as_flatten.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_as_flatten { diff --git a/tests/json/test_atomic.cpp b/tests/json/test_atomic.cpp index 5e28e26b8..c399d0694 100644 --- a/tests/json/test_atomic.cpp +++ b/tests/json/test_atomic.cpp @@ -2,12 +2,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_atomic { diff --git a/tests/json/test_atomic_array.cpp b/tests/json/test_atomic_array.cpp index 677d72a2f..ca8d5dc08 100644 --- a/tests/json/test_atomic_array.cpp +++ b/tests/json/test_atomic_array.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_atomic_array { diff --git a/tests/json/test_atomic_box.cpp b/tests/json/test_atomic_box.cpp index ea8c7b6c9..55acaab4c 100644 --- a/tests/json/test_atomic_box.cpp +++ b/tests/json/test_atomic_box.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_atomic_box { diff --git a/tests/json/test_atomic_negative.cpp b/tests/json/test_atomic_negative.cpp index d0996ed67..3e7e691e0 100644 --- a/tests/json/test_atomic_negative.cpp +++ b/tests/json/test_atomic_negative.cpp @@ -2,8 +2,8 @@ #include #include -import rfl; -import rfl.json; +#include +#include namespace test_atomic_negative { diff --git a/tests/json/test_atomic_ref.cpp b/tests/json/test_atomic_ref.cpp index d83312636..3c8ab04c3 100644 --- a/tests/json/test_atomic_ref.cpp +++ b/tests/json/test_atomic_ref.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_atomic_ref { diff --git a/tests/json/test_atomic_shared_ptr.cpp b/tests/json/test_atomic_shared_ptr.cpp index ce29ef228..c1b614741 100644 --- a/tests/json/test_atomic_shared_ptr.cpp +++ b/tests/json/test_atomic_shared_ptr.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_atomic_shared_ptr { diff --git a/tests/json/test_atomic_unique_ptr.cpp b/tests/json/test_atomic_unique_ptr.cpp index 50b77a974..6a76f8ba3 100644 --- a/tests/json/test_atomic_unique_ptr.cpp +++ b/tests/json/test_atomic_unique_ptr.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_atomic_unique_ptr { diff --git a/tests/json/test_binary.cpp b/tests/json/test_binary.cpp index b7ec7f888..306d14c26 100644 --- a/tests/json/test_binary.cpp +++ b/tests/json/test_binary.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_binary { diff --git a/tests/json/test_box.cpp b/tests/json/test_box.cpp index d9199c2e8..387517e1a 100644 --- a/tests/json/test_box.cpp +++ b/tests/json/test_box.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/json/test_box2.cpp b/tests/json/test_box2.cpp index 9fd793b6b..aea4e67ff 100644 --- a/tests/json/test_box2.cpp +++ b/tests/json/test_box2.cpp @@ -5,8 +5,8 @@ #include #include -import rfl; -import rfl.json; +#include +#include namespace test_box2 { diff --git a/tests/json/test_camel_case_to_snake_case_rename.cpp b/tests/json/test_camel_case_to_snake_case_rename.cpp index f8198d31d..4a96ee80b 100644 --- a/tests/json/test_camel_case_to_snake_case_rename.cpp +++ b/tests/json/test_camel_case_to_snake_case_rename.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_camel_case_to_snake_case_rename { diff --git a/tests/json/test_chrono_duration.cpp b/tests/json/test_chrono_duration.cpp index 0dc757f62..365c45da2 100644 --- a/tests/json/test_chrono_duration.cpp +++ b/tests/json/test_chrono_duration.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_chrono_duration { diff --git a/tests/json/test_combined_processors.cpp b/tests/json/test_combined_processors.cpp index 9e1dd28f0..0b81b8c78 100644 --- a/tests/json/test_combined_processors.cpp +++ b/tests/json/test_combined_processors.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_combined_processors { diff --git a/tests/json/test_const_fields.cpp b/tests/json/test_const_fields.cpp index e1b9e5bd0..987bf2bfb 100644 --- a/tests/json/test_const_fields.cpp +++ b/tests/json/test_const_fields.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_const_fields { diff --git a/tests/json/test_custom_class1.cpp b/tests/json/test_custom_class1.cpp index 8b6dcc8a8..0e4803577 100644 --- a/tests/json/test_custom_class1.cpp +++ b/tests/json/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_custom_class1 { diff --git a/tests/json/test_custom_class2.cpp b/tests/json/test_custom_class2.cpp index d1e6b012f..dac7df5ec 100644 --- a/tests/json/test_custom_class2.cpp +++ b/tests/json/test_custom_class2.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_custom_class2 { diff --git a/tests/json/test_custom_class3.cpp b/tests/json/test_custom_class3.cpp index a4a8fa318..9cd609d88 100644 --- a/tests/json/test_custom_class3.cpp +++ b/tests/json/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_custom_class3 { diff --git a/tests/json/test_custom_class4.cpp b/tests/json/test_custom_class4.cpp index 7fe7dcbd3..2f2e43a8a 100644 --- a/tests/json/test_custom_class4.cpp +++ b/tests/json/test_custom_class4.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_custom_class4 { diff --git a/tests/json/test_custom_constructor.cpp b/tests/json/test_custom_constructor.cpp index 467a69dd1..0d53ba149 100644 --- a/tests/json/test_custom_constructor.cpp +++ b/tests/json/test_custom_constructor.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_custom_constructor { diff --git a/tests/json/test_custom_enum1.cpp b/tests/json/test_custom_enum1.cpp index d3f69fe65..3ed8e5bd8 100644 --- a/tests/json/test_custom_enum1.cpp +++ b/tests/json/test_custom_enum1.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_custom_enum1 { diff --git a/tests/json/test_deep_nested.cpp b/tests/json/test_deep_nested.cpp index cb3b3c84d..094a50b91 100644 --- a/tests/json/test_deep_nested.cpp +++ b/tests/json/test_deep_nested.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_deep_nested { diff --git a/tests/json/test_default_if_missing.cpp b/tests/json/test_default_if_missing.cpp index 9287dac01..0d1b926e1 100644 --- a/tests/json/test_default_if_missing.cpp +++ b/tests/json/test_default_if_missing.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_default_if_missing { diff --git a/tests/json/test_default_if_missing_no_field_names.cpp b/tests/json/test_default_if_missing_no_field_names.cpp index 9bb274930..1740e155f 100644 --- a/tests/json/test_default_if_missing_no_field_names.cpp +++ b/tests/json/test_default_if_missing_no_field_names.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_default_if_missing_no_field_names { diff --git a/tests/json/test_default_val.cpp b/tests/json/test_default_val.cpp index e2c893521..7dbdd71bb 100644 --- a/tests/json/test_default_val.cpp +++ b/tests/json/test_default_val.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_default_val { diff --git a/tests/json/test_default_val_no_field_names.cpp b/tests/json/test_default_val_no_field_names.cpp index 6997611d7..8c860d393 100644 --- a/tests/json/test_default_val_no_field_names.cpp +++ b/tests/json/test_default_val_no_field_names.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_default_val_no_field_names { diff --git a/tests/json/test_default_values.cpp b/tests/json/test_default_values.cpp index 126b9846f..1c4294880 100644 --- a/tests/json/test_default_values.cpp +++ b/tests/json/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_default_values { diff --git a/tests/json/test_deque.cpp b/tests/json/test_deque.cpp index 1bff0c16e..711abe800 100644 --- a/tests/json/test_deque.cpp +++ b/tests/json/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/json/test_duration.cpp b/tests/json/test_duration.cpp index 3266aa94e..a44ac69c3 100644 --- a/tests/json/test_duration.cpp +++ b/tests/json/test_duration.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_duration { diff --git a/tests/json/test_duration_conversion.cpp b/tests/json/test_duration_conversion.cpp index 9bdcc5b4c..52100d434 100644 --- a/tests/json/test_duration_conversion.cpp +++ b/tests/json/test_duration_conversion.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_duration_conversion { diff --git a/tests/json/test_duration_default.cpp b/tests/json/test_duration_default.cpp index 2c12635fa..e24bdde02 100644 --- a/tests/json/test_duration_default.cpp +++ b/tests/json/test_duration_default.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_duration_default { diff --git a/tests/json/test_email.cpp b/tests/json/test_email.cpp index e52edf25b..1e226339b 100644 --- a/tests/json/test_email.cpp +++ b/tests/json/test_email.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_email { diff --git a/tests/json/test_empty_object.cpp b/tests/json/test_empty_object.cpp index e10629adb..8317446c2 100644 --- a/tests/json/test_empty_object.cpp +++ b/tests/json/test_empty_object.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_empty_object { diff --git a/tests/json/test_enum1.cpp b/tests/json/test_enum1.cpp index 1457372e5..8b974ad01 100644 --- a/tests/json/test_enum1.cpp +++ b/tests/json/test_enum1.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_enum1 { diff --git a/tests/json/test_enum2.cpp b/tests/json/test_enum2.cpp index 7fbae425c..187f4f6da 100644 --- a/tests/json/test_enum2.cpp +++ b/tests/json/test_enum2.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_enum2 { diff --git a/tests/json/test_enum3.cpp b/tests/json/test_enum3.cpp index 2412a99db..70f73e362 100644 --- a/tests/json/test_enum3.cpp +++ b/tests/json/test_enum3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_enum3 { diff --git a/tests/json/test_enum4.cpp b/tests/json/test_enum4.cpp index 2bfdde670..5e139a4f0 100644 --- a/tests/json/test_enum4.cpp +++ b/tests/json/test_enum4.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_enum4 { diff --git a/tests/json/test_enum5.cpp b/tests/json/test_enum5.cpp index 56c2202f5..8249a976d 100644 --- a/tests/json/test_enum5.cpp +++ b/tests/json/test_enum5.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_enum5 { diff --git a/tests/json/test_enum6.cpp b/tests/json/test_enum6.cpp index 01fe4efa6..d2d70f818 100644 --- a/tests/json/test_enum6.cpp +++ b/tests/json/test_enum6.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_enum6 { diff --git a/tests/json/test_enum7.cpp b/tests/json/test_enum7.cpp index 29cd8cdeb..bbdab7d20 100644 --- a/tests/json/test_enum7.cpp +++ b/tests/json/test_enum7.cpp @@ -1,8 +1,8 @@ #include #include -import rfl; -import rfl.json; +#include +#include namespace test_enum7 { diff --git a/tests/json/test_enum8.cpp b/tests/json/test_enum8.cpp index f1f173889..a84308861 100644 --- a/tests/json/test_enum8.cpp +++ b/tests/json/test_enum8.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_enum8 { diff --git a/tests/json/test_enum_descriptions.cpp b/tests/json/test_enum_descriptions.cpp index ac32699cd..ba964f8c7 100644 --- a/tests/json/test_enum_descriptions.cpp +++ b/tests/json/test_enum_descriptions.cpp @@ -2,8 +2,8 @@ #include #include -import rfl; -import rfl.json; +#include +#include namespace test_enum_descriptions { diff --git a/tests/json/test_enum_error_messages.cpp b/tests/json/test_enum_error_messages.cpp index 52efac8e5..90596a599 100644 --- a/tests/json/test_enum_error_messages.cpp +++ b/tests/json/test_enum_error_messages.cpp @@ -3,8 +3,8 @@ #include #include -import rfl; -import rfl.json; +#include +#include namespace test_enum_error_messages { diff --git a/tests/json/test_enum_underlying.cpp b/tests/json/test_enum_underlying.cpp index 4f0e5293c..cfac2ca5b 100644 --- a/tests/json/test_enum_underlying.cpp +++ b/tests/json/test_enum_underlying.cpp @@ -1,5 +1,5 @@ #include -import rfl.json; +#include diff --git a/tests/json/test_error_messages.cpp b/tests/json/test_error_messages.cpp index 0a7bb8833..1196f39c3 100644 --- a/tests/json/test_error_messages.cpp +++ b/tests/json/test_error_messages.cpp @@ -2,8 +2,8 @@ #include #include -import rfl; -import rfl.json; +#include +#include namespace test_error_messages { diff --git a/tests/json/test_extra_fields.cpp b/tests/json/test_extra_fields.cpp index ac46e036c..36be991a7 100644 --- a/tests/json/test_extra_fields.cpp +++ b/tests/json/test_extra_fields.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_extra_fields { diff --git a/tests/json/test_extra_fields_with_no_extra_fields.cpp b/tests/json/test_extra_fields_with_no_extra_fields.cpp index 6966781c8..6590be2c4 100644 --- a/tests/json/test_extra_fields_with_no_extra_fields.cpp +++ b/tests/json/test_extra_fields_with_no_extra_fields.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_extra_fields_with_no_extra_fields { diff --git a/tests/json/test_field_variant.cpp b/tests/json/test_field_variant.cpp index 5528fb0d5..8c5e626d8 100644 --- a/tests/json/test_field_variant.cpp +++ b/tests/json/test_field_variant.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_field_variant { diff --git a/tests/json/test_field_variant_std.cpp b/tests/json/test_field_variant_std.cpp index a182e79fe..af5c7ac29 100644 --- a/tests/json/test_field_variant_std.cpp +++ b/tests/json/test_field_variant_std.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_field_variant_std { diff --git a/tests/json/test_filepath.cpp b/tests/json/test_filepath.cpp index 7cfe4e5af..3442ee911 100644 --- a/tests/json/test_filepath.cpp +++ b/tests/json/test_filepath.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_filepath { diff --git a/tests/json/test_flag_enum1.cpp b/tests/json/test_flag_enum1.cpp index 505e482b5..642800260 100644 --- a/tests/json/test_flag_enum1.cpp +++ b/tests/json/test_flag_enum1.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_flag_enum1 { diff --git a/tests/json/test_flag_enum2.cpp b/tests/json/test_flag_enum2.cpp index d89a75d15..cdee4a725 100644 --- a/tests/json/test_flag_enum2.cpp +++ b/tests/json/test_flag_enum2.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_flag_enum2 { diff --git a/tests/json/test_flag_enum_with_int.cpp b/tests/json/test_flag_enum_with_int.cpp index bf7271b73..f65c0f3a5 100644 --- a/tests/json/test_flag_enum_with_int.cpp +++ b/tests/json/test_flag_enum_with_int.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/json/test_flatten.cpp b/tests/json/test_flatten.cpp index 5eeeb6cbb..89f8f8f37 100644 --- a/tests/json/test_flatten.cpp +++ b/tests/json/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_flatten { diff --git a/tests/json/test_flatten_anonymous.cpp b/tests/json/test_flatten_anonymous.cpp index 2428d6b26..f9c465eaf 100644 --- a/tests/json/test_flatten_anonymous.cpp +++ b/tests/json/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/json/test_forward_list.cpp b/tests/json/test_forward_list.cpp index 114ef5bfd..b1bb61e91 100644 --- a/tests/json/test_forward_list.cpp +++ b/tests/json/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/json/test_generic.cpp b/tests/json/test_generic.cpp index 7afcc7787..15549e19a 100644 --- a/tests/json/test_generic.cpp +++ b/tests/json/test_generic.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_generic { diff --git a/tests/json/test_generic2.cpp b/tests/json/test_generic2.cpp index 9da4e683a..01ff7908e 100644 --- a/tests/json/test_generic2.cpp +++ b/tests/json/test_generic2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_generic2 { diff --git a/tests/json/test_hex.cpp b/tests/json/test_hex.cpp index 576d45a9e..ce185607d 100644 --- a/tests/json/test_hex.cpp +++ b/tests/json/test_hex.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_hex { diff --git a/tests/json/test_inside_function.cpp b/tests/json/test_inside_function.cpp index a75e31841..792d5865f 100644 --- a/tests/json/test_inside_function.cpp +++ b/tests/json/test_inside_function.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_inside_function { diff --git a/tests/json/test_integers.cpp b/tests/json/test_integers.cpp index d151e4286..f59a06574 100644 --- a/tests/json/test_integers.cpp +++ b/tests/json/test_integers.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_integers { diff --git a/tests/json/test_json_schema.cpp b/tests/json/test_json_schema.cpp index e9a966b6b..a7e89303d 100644 --- a/tests/json/test_json_schema.cpp +++ b/tests/json/test_json_schema.cpp @@ -4,8 +4,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_json_schema { diff --git a/tests/json/test_json_schema2.cpp b/tests/json/test_json_schema2.cpp index 416df088b..a5c86a12e 100644 --- a/tests/json/test_json_schema2.cpp +++ b/tests/json/test_json_schema2.cpp @@ -4,8 +4,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_json_schema2 { diff --git a/tests/json/test_json_schema3.cpp b/tests/json/test_json_schema3.cpp index 34268a81f..95b35b716 100644 --- a/tests/json/test_json_schema3.cpp +++ b/tests/json/test_json_schema3.cpp @@ -4,8 +4,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_json_schema3 { diff --git a/tests/json/test_json_schema4.cpp b/tests/json/test_json_schema4.cpp index 1b4107bd5..34dbc8971 100644 --- a/tests/json/test_json_schema4.cpp +++ b/tests/json/test_json_schema4.cpp @@ -4,8 +4,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_json_schema4 { diff --git a/tests/json/test_json_schema5.cpp b/tests/json/test_json_schema5.cpp index 3f753e7e4..f44e6bd78 100644 --- a/tests/json/test_json_schema5.cpp +++ b/tests/json/test_json_schema5.cpp @@ -1,7 +1,9 @@ +#include + #include #include -import rfl; -import rfl.json; +#include +#include namespace test_json_schema5 { diff --git a/tests/json/test_json_schema6.cpp b/tests/json/test_json_schema6.cpp index 2bfe0c638..66d2b7405 100644 --- a/tests/json/test_json_schema6.cpp +++ b/tests/json/test_json_schema6.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include diff --git a/tests/json/test_json_schema7.cpp b/tests/json/test_json_schema7.cpp index 565b52e70..1be02b737 100644 --- a/tests/json/test_json_schema7.cpp +++ b/tests/json/test_json_schema7.cpp @@ -1,5 +1,7 @@ -import rfl; -import rfl.json; +#include + +#include +#include namespace test_json_schema7 { diff --git a/tests/json/test_json_schema_default_vals.cpp b/tests/json/test_json_schema_default_vals.cpp index 9236a329e..36bfaa361 100644 --- a/tests/json/test_json_schema_default_vals.cpp +++ b/tests/json/test_json_schema_default_vals.cpp @@ -1,9 +1,12 @@ +#include + #include -#include -#include #include #include +#include +#include + namespace test_schema_default { struct Config { diff --git a/tests/json/test_json_schema_deprecation.cpp b/tests/json/test_json_schema_deprecation.cpp index 2c3faed6a..edfefe2f0 100644 --- a/tests/json/test_json_schema_deprecation.cpp +++ b/tests/json/test_json_schema_deprecation.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_deprecated_schema { diff --git a/tests/json/test_json_schema_size_validation.cpp b/tests/json/test_json_schema_size_validation.cpp index f9c4378e2..d34771cb5 100644 --- a/tests/json/test_json_schema_size_validation.cpp +++ b/tests/json/test_json_schema_size_validation.cpp @@ -3,8 +3,8 @@ #include #include "gtest/gtest.h" -import rfl; -import rfl.json; +#include +#include namespace test_json_schema_size_validation { diff --git a/tests/json/test_leak.cpp b/tests/json/test_leak.cpp index f41a4a079..39bdf3672 100644 --- a/tests/json/test_leak.cpp +++ b/tests/json/test_leak.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_leak { diff --git a/tests/json/test_leak_arr.cpp b/tests/json/test_leak_arr.cpp index d0c98b2ad..1a17429db 100644 --- a/tests/json/test_leak_arr.cpp +++ b/tests/json/test_leak_arr.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_leak_arr { diff --git a/tests/json/test_leak_rfl_tup.cpp b/tests/json/test_leak_rfl_tup.cpp index e4b6e4ed6..4d5eb9f7f 100644 --- a/tests/json/test_leak_rfl_tup.cpp +++ b/tests/json/test_leak_rfl_tup.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_leak_rfl_tup { diff --git a/tests/json/test_leak_tup.cpp b/tests/json/test_leak_tup.cpp index 26c984d5c..307e5534e 100644 --- a/tests/json/test_leak_tup.cpp +++ b/tests/json/test_leak_tup.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_leak_tup { diff --git a/tests/json/test_list.cpp b/tests/json/test_list.cpp index 6d8ff7b44..fafbf78c6 100644 --- a/tests/json/test_list.cpp +++ b/tests/json/test_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_list { diff --git a/tests/json/test_literal.cpp b/tests/json/test_literal.cpp index b511bf90b..1cd029703 100644 --- a/tests/json/test_literal.cpp +++ b/tests/json/test_literal.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_literal { diff --git a/tests/json/test_literal_map.cpp b/tests/json/test_literal_map.cpp index b67e5a8b3..9c77b9c84 100644 --- a/tests/json/test_literal_map.cpp +++ b/tests/json/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_literal_map { diff --git a/tests/json/test_literal_unordered_map.cpp b/tests/json/test_literal_unordered_map.cpp index 35012df03..86edbb4a7 100644 --- a/tests/json/test_literal_unordered_map.cpp +++ b/tests/json/test_literal_unordered_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_literal_unordered_map { diff --git a/tests/json/test_many_fields.cpp b/tests/json/test_many_fields.cpp index c4c43453f..32c9f19fc 100644 --- a/tests/json/test_many_fields.cpp +++ b/tests/json/test_many_fields.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_many_fields { diff --git a/tests/json/test_map.cpp b/tests/json/test_map.cpp index 6f8045f3e..5723a46c6 100644 --- a/tests/json/test_map.cpp +++ b/tests/json/test_map.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_map { diff --git a/tests/json/test_map_with_custom_less.cpp b/tests/json/test_map_with_custom_less.cpp index b3790d3b8..0142f5136 100644 --- a/tests/json/test_map_with_custom_less.cpp +++ b/tests/json/test_map_with_custom_less.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_map_with_custom_less { diff --git a/tests/json/test_map_with_key_validation.cpp b/tests/json/test_map_with_key_validation.cpp index 43ed5b52f..a8f5da461 100644 --- a/tests/json/test_map_with_key_validation.cpp +++ b/tests/json/test_map_with_key_validation.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_map_with_key_validation { diff --git a/tests/json/test_meta_fields.cpp b/tests/json/test_meta_fields.cpp index fc30eab69..6a56cf39d 100644 --- a/tests/json/test_meta_fields.cpp +++ b/tests/json/test_meta_fields.cpp @@ -3,7 +3,7 @@ #include #include -import rfl; +#include namespace test_meta_fields { diff --git a/tests/json/test_monster_example.cpp b/tests/json/test_monster_example.cpp index b577509c2..584170cc5 100644 --- a/tests/json/test_monster_example.cpp +++ b/tests/json/test_monster_example.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_monster_example { diff --git a/tests/json/test_movable.cpp b/tests/json/test_movable.cpp index 86a208693..e79b26e16 100644 --- a/tests/json/test_movable.cpp +++ b/tests/json/test_movable.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include diff --git a/tests/json/test_move_replace.cpp b/tests/json/test_move_replace.cpp index 92e0801bf..ee63d5fc8 100644 --- a/tests/json/test_move_replace.cpp +++ b/tests/json/test_move_replace.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_move_replace { diff --git a/tests/json/test_multimap.cpp b/tests/json/test_multimap.cpp index e6cce680d..d6128c814 100644 --- a/tests/json/test_multimap.cpp +++ b/tests/json/test_multimap.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_multimap { diff --git a/tests/json/test_multiset.cpp b/tests/json/test_multiset.cpp index 1366619db..835a14393 100644 --- a/tests/json/test_multiset.cpp +++ b/tests/json/test_multiset.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_multiset { diff --git a/tests/json/test_named_tuple.cpp b/tests/json/test_named_tuple.cpp index d193eb26a..e7a3a6ca8 100644 --- a/tests/json/test_named_tuple.cpp +++ b/tests/json/test_named_tuple.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_named_tuple { diff --git a/tests/json/test_no_extra_fields.cpp b/tests/json/test_no_extra_fields.cpp index 8e25880e9..0f4120ec6 100644 --- a/tests/json/test_no_extra_fields.cpp +++ b/tests/json/test_no_extra_fields.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_no_extra_fields { diff --git a/tests/json/test_no_extra_fields_with_default.cpp b/tests/json/test_no_extra_fields_with_default.cpp index 10dad435c..27c13df10 100644 --- a/tests/json/test_no_extra_fields_with_default.cpp +++ b/tests/json/test_no_extra_fields_with_default.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_no_extra_fields_with_default { diff --git a/tests/json/test_no_optionals.cpp b/tests/json/test_no_optionals.cpp index bf62e6939..a8469d393 100644 --- a/tests/json/test_no_optionals.cpp +++ b/tests/json/test_no_optionals.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_no_optionals { diff --git a/tests/json/test_object.cpp b/tests/json/test_object.cpp index 522aa1ca8..12b64bb31 100644 --- a/tests/json/test_object.cpp +++ b/tests/json/test_object.cpp @@ -1,6 +1,6 @@ #include "write_and_read.hpp" -import rfl; +#include namespace test_object { diff --git a/tests/json/test_oct.cpp b/tests/json/test_oct.cpp index d4afba9c2..e96cacee3 100644 --- a/tests/json/test_oct.cpp +++ b/tests/json/test_oct.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_oct { diff --git a/tests/json/test_one_of.cpp b/tests/json/test_one_of.cpp index a0e1e1976..7f290748f 100644 --- a/tests/json/test_one_of.cpp +++ b/tests/json/test_one_of.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_one_of { diff --git a/tests/json/test_optional_fields.cpp b/tests/json/test_optional_fields.cpp index 65f602c5e..242640b99 100644 --- a/tests/json/test_optional_fields.cpp +++ b/tests/json/test_optional_fields.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_optional_fields { diff --git a/tests/json/test_pointer_fields.cpp b/tests/json/test_pointer_fields.cpp index 6a68eb0de..a47f6c5f0 100644 --- a/tests/json/test_pointer_fields.cpp +++ b/tests/json/test_pointer_fields.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_pointer_fields { diff --git a/tests/json/test_positional_and_short.cpp b/tests/json/test_positional_and_short.cpp index 76cd666ba..63a9f605f 100644 --- a/tests/json/test_positional_and_short.cpp +++ b/tests/json/test_positional_and_short.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_positional_and_short_json { diff --git a/tests/json/test_readme_example.cpp b/tests/json/test_readme_example.cpp index 851cdb746..280a27e16 100644 --- a/tests/json/test_readme_example.cpp +++ b/tests/json/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_readme_example { diff --git a/tests/json/test_ref.cpp b/tests/json/test_ref.cpp index 0f5a2be51..b5d2aa80f 100644 --- a/tests/json/test_ref.cpp +++ b/tests/json/test_ref.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/json/test_reflector.cpp b/tests/json/test_reflector.cpp index a930b7b2a..221a951b5 100644 --- a/tests/json/test_reflector.cpp +++ b/tests/json/test_reflector.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_reflector { diff --git a/tests/json/test_reflector_read.cpp b/tests/json/test_reflector_read.cpp index 0e3620a32..ebaecf1b7 100644 --- a/tests/json/test_reflector_read.cpp +++ b/tests/json/test_reflector_read.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_reflector_read { diff --git a/tests/json/test_reflector_schema.cpp b/tests/json/test_reflector_schema.cpp index b818927ab..2b6ca43a9 100644 --- a/tests/json/test_reflector_schema.cpp +++ b/tests/json/test_reflector_schema.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_reflector_schema { diff --git a/tests/json/test_reflector_write.cpp b/tests/json/test_reflector_write.cpp index 4c701bab2..f7d2d18af 100644 --- a/tests/json/test_reflector_write.cpp +++ b/tests/json/test_reflector_write.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_reflector_write { diff --git a/tests/json/test_regression_bugs.cpp b/tests/json/test_regression_bugs.cpp index d4d2d4af3..0fd75634a 100644 --- a/tests/json/test_regression_bugs.cpp +++ b/tests/json/test_regression_bugs.cpp @@ -5,8 +5,8 @@ #include #include -import rfl; -import rfl.json; +#include +#include diff --git a/tests/json/test_replace.cpp b/tests/json/test_replace.cpp index 6624fa2bc..b39170790 100644 --- a/tests/json/test_replace.cpp +++ b/tests/json/test_replace.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_replace { diff --git a/tests/json/test_replace2.cpp b/tests/json/test_replace2.cpp index 958b268e7..2359eba60 100644 --- a/tests/json/test_replace2.cpp +++ b/tests/json/test_replace2.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_replace2 { diff --git a/tests/json/test_replace_flatten.cpp b/tests/json/test_replace_flatten.cpp index 8f017c190..0941fcc66 100644 --- a/tests/json/test_replace_flatten.cpp +++ b/tests/json/test_replace_flatten.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_replace_flatten { diff --git a/tests/json/test_replace_flatten2.cpp b/tests/json/test_replace_flatten2.cpp index b717e63f2..6ad3f5b48 100644 --- a/tests/json/test_replace_flatten2.cpp +++ b/tests/json/test_replace_flatten2.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_replace_flatten2 { diff --git a/tests/json/test_replace_with_other_struct.cpp b/tests/json/test_replace_with_other_struct.cpp index 9e73e3078..178f75c50 100644 --- a/tests/json/test_replace_with_other_struct.cpp +++ b/tests/json/test_replace_with_other_struct.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_replace_with_other_struct { diff --git a/tests/json/test_replace_with_other_struct2.cpp b/tests/json/test_replace_with_other_struct2.cpp index 46d9662f3..68fea946e 100644 --- a/tests/json/test_replace_with_other_struct2.cpp +++ b/tests/json/test_replace_with_other_struct2.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_replace_with_other_struct2 { diff --git a/tests/json/test_result.cpp b/tests/json/test_result.cpp index 0080cb60e..81dd875cb 100644 --- a/tests/json/test_result.cpp +++ b/tests/json/test_result.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_result { diff --git a/tests/json/test_rfl_tagged_union_visit_move_only.cpp b/tests/json/test_rfl_tagged_union_visit_move_only.cpp index 38da75c4d..e024c7e25 100644 --- a/tests/json/test_rfl_tagged_union_visit_move_only.cpp +++ b/tests/json/test_rfl_tagged_union_visit_move_only.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_rfl_tagged_union_visit_move_only { diff --git a/tests/json/test_rfl_tuple.cpp b/tests/json/test_rfl_tuple.cpp index f777a085e..039ca216b 100644 --- a/tests/json/test_rfl_tuple.cpp +++ b/tests/json/test_rfl_tuple.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_rfl_tuple { diff --git a/tests/json/test_rfl_variant.cpp b/tests/json/test_rfl_variant.cpp index 7e2ce0a70..ddda84c23 100644 --- a/tests/json/test_rfl_variant.cpp +++ b/tests/json/test_rfl_variant.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_rfl_variant { diff --git a/tests/json/test_rfl_variant_emplace.cpp b/tests/json/test_rfl_variant_emplace.cpp index 3ff0970d8..ba323b074 100644 --- a/tests/json/test_rfl_variant_emplace.cpp +++ b/tests/json/test_rfl_variant_emplace.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_rfl_variant_emplace { diff --git a/tests/json/test_rfl_variant_get_if.cpp b/tests/json/test_rfl_variant_get_if.cpp index ba4a3c17b..ffec7d78a 100644 --- a/tests/json/test_rfl_variant_get_if.cpp +++ b/tests/json/test_rfl_variant_get_if.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_rfl_variant_get_if { diff --git a/tests/json/test_rfl_variant_holds_alternative.cpp b/tests/json/test_rfl_variant_holds_alternative.cpp index 5f2d9fe7f..e7b08565c 100644 --- a/tests/json/test_rfl_variant_holds_alternative.cpp +++ b/tests/json/test_rfl_variant_holds_alternative.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_rfl_variant_holds_alternative { diff --git a/tests/json/test_rfl_variant_swap.cpp b/tests/json/test_rfl_variant_swap.cpp index 542340e94..b2d90a8a1 100644 --- a/tests/json/test_rfl_variant_swap.cpp +++ b/tests/json/test_rfl_variant_swap.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_rfl_variant_swap { diff --git a/tests/json/test_rfl_variant_visit.cpp b/tests/json/test_rfl_variant_visit.cpp index c0497d167..48c6994ba 100644 --- a/tests/json/test_rfl_variant_visit.cpp +++ b/tests/json/test_rfl_variant_visit.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_rfl_variant_visit { diff --git a/tests/json/test_rfl_variant_visit_in_place.cpp b/tests/json/test_rfl_variant_visit_in_place.cpp index 1b59f5331..e5b092a81 100644 --- a/tests/json/test_rfl_variant_visit_in_place.cpp +++ b/tests/json/test_rfl_variant_visit_in_place.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_rfl_variant_visit_in_place { diff --git a/tests/json/test_rfl_variant_visit_lvalues.cpp b/tests/json/test_rfl_variant_visit_lvalues.cpp index 0e40df2d2..79c0b8e75 100644 --- a/tests/json/test_rfl_variant_visit_lvalues.cpp +++ b/tests/json/test_rfl_variant_visit_lvalues.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_rfl_variant_visit_lvalues { diff --git a/tests/json/test_rfl_variant_visit_move_only.cpp b/tests/json/test_rfl_variant_visit_move_only.cpp index 8ecd7ff67..ff558eabb 100644 --- a/tests/json/test_rfl_variant_visit_move_only.cpp +++ b/tests/json/test_rfl_variant_visit_move_only.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_rfl_variant_visit_move_only { diff --git a/tests/json/test_save_load.cpp b/tests/json/test_save_load.cpp index f010f0ceb..ab6d3406d 100644 --- a/tests/json/test_save_load.cpp +++ b/tests/json/test_save_load.cpp @@ -4,8 +4,8 @@ #include #include -import rfl; -import rfl.json; +#include +#include namespace test_save_load { diff --git a/tests/json/test_segfault.cpp b/tests/json/test_segfault.cpp index c3b8e5d63..8ea111cfa 100644 --- a/tests/json/test_segfault.cpp +++ b/tests/json/test_segfault.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include // This example had led to a segfault on GCC 12. diff --git a/tests/json/test_set.cpp b/tests/json/test_set.cpp index e48fc65cc..2f96225d0 100644 --- a/tests/json/test_set.cpp +++ b/tests/json/test_set.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/json/test_shared_ptr.cpp b/tests/json/test_shared_ptr.cpp index a6a0df337..477cb7b36 100644 --- a/tests/json/test_shared_ptr.cpp +++ b/tests/json/test_shared_ptr.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_shared_ptr { diff --git a/tests/json/test_size.cpp b/tests/json/test_size.cpp index b733e50c4..a060eb53d 100644 --- a/tests/json/test_size.cpp +++ b/tests/json/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_size { diff --git a/tests/json/test_skip.cpp b/tests/json/test_skip.cpp index 00e83e95c..d3ca897be 100644 --- a/tests/json/test_skip.cpp +++ b/tests/json/test_skip.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_skip { diff --git a/tests/json/test_skip2.cpp b/tests/json/test_skip2.cpp index 8efc6b59d..433ce2938 100644 --- a/tests/json/test_skip2.cpp +++ b/tests/json/test_skip2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_skip2 { diff --git a/tests/json/test_snake_case_to_camel_case.cpp b/tests/json/test_snake_case_to_camel_case.cpp index e6f7abc46..1b1f99e47 100644 --- a/tests/json/test_snake_case_to_camel_case.cpp +++ b/tests/json/test_snake_case_to_camel_case.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_snake_case_to_camel_case { diff --git a/tests/json/test_snake_case_to_camel_case_rename.cpp b/tests/json/test_snake_case_to_camel_case_rename.cpp index 39ea2f180..f2aa30021 100644 --- a/tests/json/test_snake_case_to_camel_case_rename.cpp +++ b/tests/json/test_snake_case_to_camel_case_rename.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_snake_case_to_camel_case_rename { diff --git a/tests/json/test_snake_case_to_pascal_case.cpp b/tests/json/test_snake_case_to_pascal_case.cpp index be59b6de8..06af9fa0c 100644 --- a/tests/json/test_snake_case_to_pascal_case.cpp +++ b/tests/json/test_snake_case_to_pascal_case.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_snake_case_to_pascal_case { diff --git a/tests/json/test_snake_case_to_pascal_case_rename.cpp b/tests/json/test_snake_case_to_pascal_case_rename.cpp index 819ee0505..6463ffa2c 100644 --- a/tests/json/test_snake_case_to_pascal_case_rename.cpp +++ b/tests/json/test_snake_case_to_pascal_case_rename.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_pascal_case_to_camel_case_rename { diff --git a/tests/json/test_span.cpp b/tests/json/test_span.cpp index 70ea18831..90d8424a3 100644 --- a/tests/json/test_span.cpp +++ b/tests/json/test_span.cpp @@ -4,8 +4,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_span { diff --git a/tests/json/test_std_ref.cpp b/tests/json/test_std_ref.cpp index 46bdc7e4f..9be8d10e5 100644 --- a/tests/json/test_std_ref.cpp +++ b/tests/json/test_std_ref.cpp @@ -3,8 +3,8 @@ #include #include -import rfl; -import rfl.json; +#include +#include namespace test_std_ref { diff --git a/tests/json/test_string_map.cpp b/tests/json/test_string_map.cpp index f2e464a6b..5cd05f618 100644 --- a/tests/json/test_string_map.cpp +++ b/tests/json/test_string_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_string_map { diff --git a/tests/json/test_string_unordered_map.cpp b/tests/json/test_string_unordered_map.cpp index 07e05bd1e..9c385b907 100644 --- a/tests/json/test_string_unordered_map.cpp +++ b/tests/json/test_string_unordered_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_string_unordered_map { diff --git a/tests/json/test_string_view.cpp b/tests/json/test_string_view.cpp index 27edffc80..14b7215db 100644 --- a/tests/json/test_string_view.cpp +++ b/tests/json/test_string_view.cpp @@ -4,8 +4,8 @@ #include #include -import rfl; -import rfl.json; +#include +#include namespace test_string_view { diff --git a/tests/json/test_strip_field_names.cpp b/tests/json/test_strip_field_names.cpp index d87e0ef2f..4373ca6f4 100644 --- a/tests/json/test_strip_field_names.cpp +++ b/tests/json/test_strip_field_names.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_strip_field_names { diff --git a/tests/json/test_tagged_union.cpp b/tests/json/test_tagged_union.cpp index c34f1b121..531004ac4 100644 --- a/tests/json/test_tagged_union.cpp +++ b/tests/json/test_tagged_union.cpp @@ -1,7 +1,7 @@ #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_tagged_union { diff --git a/tests/json/test_tagged_union2.cpp b/tests/json/test_tagged_union2.cpp index cb805ce3c..2a00a565d 100644 --- a/tests/json/test_tagged_union2.cpp +++ b/tests/json/test_tagged_union2.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_tagged_union2 { diff --git a/tests/json/test_tagged_union3.cpp b/tests/json/test_tagged_union3.cpp index b96426323..957a8c677 100644 --- a/tests/json/test_tagged_union3.cpp +++ b/tests/json/test_tagged_union3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_tagged_union3 { diff --git a/tests/json/test_tagged_union4.cpp b/tests/json/test_tagged_union4.cpp index 340df3ec9..a224f173e 100644 --- a/tests/json/test_tagged_union4.cpp +++ b/tests/json/test_tagged_union4.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_tagged_union4 { diff --git a/tests/json/test_tagged_union5.cpp b/tests/json/test_tagged_union5.cpp index a67e7a558..d2396efb3 100644 --- a/tests/json/test_tagged_union5.cpp +++ b/tests/json/test_tagged_union5.cpp @@ -4,8 +4,8 @@ #include #include -import rfl; -import rfl.json; +#include +#include namespace test_tagged_union5 { diff --git a/tests/json/test_tagged_union_with_no_extra_fields.cpp b/tests/json/test_tagged_union_with_no_extra_fields.cpp index c15b7b7bd..62be44214 100644 --- a/tests/json/test_tagged_union_with_no_extra_fields.cpp +++ b/tests/json/test_tagged_union_with_no_extra_fields.cpp @@ -1,7 +1,7 @@ #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_tagged_union_with_no_extra_fields { diff --git a/tests/json/test_template.cpp b/tests/json/test_template.cpp index 5de96bbd6..199376d50 100644 --- a/tests/json/test_template.cpp +++ b/tests/json/test_template.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_template { diff --git a/tests/json/test_time_point.cpp b/tests/json/test_time_point.cpp index ddbcd1435..deee412af 100644 --- a/tests/json/test_time_point.cpp +++ b/tests/json/test_time_point.cpp @@ -2,8 +2,8 @@ #include #include -import rfl; -import rfl.json; +#include +#include namespace test_time_point { diff --git a/tests/json/test_timestamp.cpp b/tests/json/test_timestamp.cpp index da17eb702..9f0ffcf9e 100644 --- a/tests/json/test_timestamp.cpp +++ b/tests/json/test_timestamp.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_timestamp { diff --git a/tests/json/test_transform.cpp b/tests/json/test_transform.cpp index 47516d223..c7c2a3654 100644 --- a/tests/json/test_transform.cpp +++ b/tests/json/test_transform.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_transform { diff --git a/tests/json/test_tuple.cpp b/tests/json/test_tuple.cpp index a7634185c..142776e2e 100644 --- a/tests/json/test_tuple.cpp +++ b/tests/json/test_tuple.cpp @@ -3,11 +3,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_tuple { diff --git a/tests/json/test_underlying_enums.cpp b/tests/json/test_underlying_enums.cpp index db8a8b3d1..dca84ec8e 100644 --- a/tests/json/test_underlying_enums.cpp +++ b/tests/json/test_underlying_enums.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_underlying_enums { diff --git a/tests/json/test_unique_ptr.cpp b/tests/json/test_unique_ptr.cpp index 4f4ebd09d..9d5eee97f 100644 --- a/tests/json/test_unique_ptr.cpp +++ b/tests/json/test_unique_ptr.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr { diff --git a/tests/json/test_unique_ptr2.cpp b/tests/json/test_unique_ptr2.cpp index 9dfa9428f..6af71eb32 100644 --- a/tests/json/test_unique_ptr2.cpp +++ b/tests/json/test_unique_ptr2.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/json/test_unnamed_namespace.cpp b/tests/json/test_unnamed_namespace.cpp index 7dcc3cb30..c98e7bd98 100644 --- a/tests/json/test_unnamed_namespace.cpp +++ b/tests/json/test_unnamed_namespace.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_unnamed_namespace { diff --git a/tests/json/test_unordered_map.cpp b/tests/json/test_unordered_map.cpp index 6a761631a..4f063c014 100644 --- a/tests/json/test_unordered_map.cpp +++ b/tests/json/test_unordered_map.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_unordered_map { diff --git a/tests/json/test_unordered_map_with_custom_hash.cpp b/tests/json/test_unordered_map_with_custom_hash.cpp index 2d3809961..cedcaba05 100644 --- a/tests/json/test_unordered_map_with_custom_hash.cpp +++ b/tests/json/test_unordered_map_with_custom_hash.cpp @@ -1,13 +1,14 @@ #include #include -#include "write_and_read.hpp" #include #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_unordered_map_with_custom_hash { diff --git a/tests/json/test_unordered_multimap.cpp b/tests/json/test_unordered_multimap.cpp index e259e01f2..3127d0ac5 100644 --- a/tests/json/test_unordered_multimap.cpp +++ b/tests/json/test_unordered_multimap.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_unordered_multimap { diff --git a/tests/json/test_unordered_multiset.cpp b/tests/json/test_unordered_multiset.cpp index 2204d1aed..ea03560e2 100644 --- a/tests/json/test_unordered_multiset.cpp +++ b/tests/json/test_unordered_multiset.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_unordered_multiset { diff --git a/tests/json/test_unordered_set.cpp b/tests/json/test_unordered_set.cpp index 628206bab..78aa4d365 100644 --- a/tests/json/test_unordered_set.cpp +++ b/tests/json/test_unordered_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_unordered_set { diff --git a/tests/json/test_uuid.cpp b/tests/json/test_uuid.cpp index 60ae4eaf3..1b61fba9c 100644 --- a/tests/json/test_uuid.cpp +++ b/tests/json/test_uuid.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_uuid { diff --git a/tests/json/test_validation_with_fields.cpp b/tests/json/test_validation_with_fields.cpp index ba45e33b3..27a083bc6 100644 --- a/tests/json/test_validation_with_fields.cpp +++ b/tests/json/test_validation_with_fields.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_validation_with_fields { diff --git a/tests/json/test_variant.cpp b/tests/json/test_variant.cpp index 77cb1ec4d..5f14ce825 100644 --- a/tests/json/test_variant.cpp +++ b/tests/json/test_variant.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/json/test_view.cpp b/tests/json/test_view.cpp index e2875b540..cef289e8d 100644 --- a/tests/json/test_view.cpp +++ b/tests/json/test_view.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_view { diff --git a/tests/json/test_wstring.cpp b/tests/json/test_wstring.cpp index beeac414f..32b95b5be 100644 --- a/tests/json/test_wstring.cpp +++ b/tests/json/test_wstring.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.json; +#include +#include namespace test_wstring { diff --git a/tests/json/write_and_read.hpp b/tests/json/write_and_read.hpp index 8b6d46c1e..f02b4200d 100644 --- a/tests/json/write_and_read.hpp +++ b/tests/json/write_and_read.hpp @@ -6,7 +6,7 @@ #include #include #include -import rfl.json; +#include diff --git a/tests/json_c_arrays_and_inheritance/CMakeLists.txt b/tests/json_c_arrays_and_inheritance/CMakeLists.txt index 44aba6e43..9513410ea 100644 --- a/tests/json_c_arrays_and_inheritance/CMakeLists.txt +++ b/tests/json_c_arrays_and_inheritance/CMakeLists.txt @@ -12,6 +12,10 @@ target_precompile_headers(reflect-cpp-json-c-arrays-and-inheritance-tests PRIVAT target_include_directories(reflect-cpp-json-c-arrays-and-inheritance-tests SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") target_link_libraries(reflect-cpp-json-c-arrays-and-inheritance-tests PRIVATE reflectcpp_tests_crt) +# Reflection reconstructs nested C arrays using valid aggregate brace elision. +target_compile_options(reflect-cpp-json-c-arrays-and-inheritance-tests PRIVATE + $<$:-Wno-missing-braces> +) add_custom_command(TARGET reflect-cpp-json-c-arrays-and-inheritance-tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy -t $ $ diff --git a/tests/json_c_arrays_and_inheritance/test_inheritance.cpp b/tests/json_c_arrays_and_inheritance/test_inheritance.cpp index 5657c9da5..ad1901bd2 100644 --- a/tests/json_c_arrays_and_inheritance/test_inheritance.cpp +++ b/tests/json_c_arrays_and_inheritance/test_inheritance.cpp @@ -1,7 +1,7 @@ #include #include -import rfl.c_arrays_and_inheritance; +#include namespace test_inheritance { diff --git a/tests/json_c_arrays_and_inheritance/test_inheritance2.cpp b/tests/json_c_arrays_and_inheritance/test_inheritance2.cpp index 5860371f4..28259f8da 100644 --- a/tests/json_c_arrays_and_inheritance/test_inheritance2.cpp +++ b/tests/json_c_arrays_and_inheritance/test_inheritance2.cpp @@ -1,7 +1,7 @@ #include #include -import rfl.c_arrays_and_inheritance; +#include diff --git a/tests/json_c_arrays_and_inheritance/write_and_read.hpp b/tests/json_c_arrays_and_inheritance/write_and_read.hpp index 8ccb294a1..55623c5b0 100644 --- a/tests/json_c_arrays_and_inheritance/write_and_read.hpp +++ b/tests/json_c_arrays_and_inheritance/write_and_read.hpp @@ -6,7 +6,7 @@ #include #include #include -import rfl.c_arrays_and_inheritance; +#include diff --git a/tests/msgpack/test_add_struct_name.cpp b/tests/msgpack/test_add_struct_name.cpp index 16bb200ba..09547fe8a 100644 --- a/tests/msgpack/test_add_struct_name.cpp +++ b/tests/msgpack/test_add_struct_name.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; +#include namespace test_add_struct_name { diff --git a/tests/msgpack/test_array.cpp b/tests/msgpack/test_array.cpp index 0e2295a54..ca062290c 100644 --- a/tests/msgpack/test_array.cpp +++ b/tests/msgpack/test_array.cpp @@ -5,11 +5,12 @@ // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include "write_and_read.hpp" #include -import rfl; -import rfl.msgpack; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/msgpack/test_box.cpp b/tests/msgpack/test_box.cpp index c97b29a81..0d799ed5d 100644 --- a/tests/msgpack/test_box.cpp +++ b/tests/msgpack/test_box.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.msgpack; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/msgpack/test_bytestring.cpp b/tests/msgpack/test_bytestring.cpp index 999983fee..846189ce0 100644 --- a/tests/msgpack/test_bytestring.cpp +++ b/tests/msgpack/test_bytestring.cpp @@ -1,9 +1,10 @@ -#include "write_and_read.hpp" #include -import rfl.msgpack; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_bytestring { diff --git a/tests/msgpack/test_combined_processors.cpp b/tests/msgpack/test_combined_processors.cpp index 390e529ab..c332e2b48 100644 --- a/tests/msgpack/test_combined_processors.cpp +++ b/tests/msgpack/test_combined_processors.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; +#include namespace test_combined_processors { diff --git a/tests/msgpack/test_custom_class1.cpp b/tests/msgpack/test_custom_class1.cpp index 130c60b54..5f3a51b9e 100644 --- a/tests/msgpack/test_custom_class1.cpp +++ b/tests/msgpack/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_custom_class1 { diff --git a/tests/msgpack/test_custom_class3.cpp b/tests/msgpack/test_custom_class3.cpp index 1391d544a..363dd97e4 100644 --- a/tests/msgpack/test_custom_class3.cpp +++ b/tests/msgpack/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_custom_class3 { diff --git a/tests/msgpack/test_custom_class4.cpp b/tests/msgpack/test_custom_class4.cpp index 82774b735..10ecedebf 100644 --- a/tests/msgpack/test_custom_class4.cpp +++ b/tests/msgpack/test_custom_class4.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_custom_class4 { diff --git a/tests/msgpack/test_default_values.cpp b/tests/msgpack/test_default_values.cpp index ecd332ef1..e9b9c0179 100644 --- a/tests/msgpack/test_default_values.cpp +++ b/tests/msgpack/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_default_values { diff --git a/tests/msgpack/test_deque.cpp b/tests/msgpack/test_deque.cpp index 0ca2cebf6..5de665009 100644 --- a/tests/msgpack/test_deque.cpp +++ b/tests/msgpack/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.msgpack; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/msgpack/test_enum.cpp b/tests/msgpack/test_enum.cpp index b57224f19..18e00006d 100644 --- a/tests/msgpack/test_enum.cpp +++ b/tests/msgpack/test_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_enum { diff --git a/tests/msgpack/test_extra_fields.cpp b/tests/msgpack/test_extra_fields.cpp index ea1459ad2..bf38209fd 100644 --- a/tests/msgpack/test_extra_fields.cpp +++ b/tests/msgpack/test_extra_fields.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_extra_fields { diff --git a/tests/msgpack/test_field_variant.cpp b/tests/msgpack/test_field_variant.cpp index 314ba74e9..20bbd2821 100644 --- a/tests/msgpack/test_field_variant.cpp +++ b/tests/msgpack/test_field_variant.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_field_variant { diff --git a/tests/msgpack/test_flag_enum.cpp b/tests/msgpack/test_flag_enum.cpp index bf5855ebf..4493ee104 100644 --- a/tests/msgpack/test_flag_enum.cpp +++ b/tests/msgpack/test_flag_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_flag_enum { diff --git a/tests/msgpack/test_flag_enum_with_int.cpp b/tests/msgpack/test_flag_enum_with_int.cpp index 94324d746..b6566fffc 100644 --- a/tests/msgpack/test_flag_enum_with_int.cpp +++ b/tests/msgpack/test_flag_enum_with_int.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/msgpack/test_flatten.cpp b/tests/msgpack/test_flatten.cpp index c52cee555..eb0750001 100644 --- a/tests/msgpack/test_flatten.cpp +++ b/tests/msgpack/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_flatten { diff --git a/tests/msgpack/test_flatten_anonymous.cpp b/tests/msgpack/test_flatten_anonymous.cpp index de716eb61..b70ed17ea 100644 --- a/tests/msgpack/test_flatten_anonymous.cpp +++ b/tests/msgpack/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/msgpack/test_forward_list.cpp b/tests/msgpack/test_forward_list.cpp index 8748fab73..70f77ca7d 100644 --- a/tests/msgpack/test_forward_list.cpp +++ b/tests/msgpack/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.msgpack; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/msgpack/test_generic_float.cpp b/tests/msgpack/test_generic_float.cpp index 6a16d38a6..2dc3ad599 100644 --- a/tests/msgpack/test_generic_float.cpp +++ b/tests/msgpack/test_generic_float.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_generic_float { diff --git a/tests/msgpack/test_literal.cpp b/tests/msgpack/test_literal.cpp index 4cb46ea1e..c55c737ab 100644 --- a/tests/msgpack/test_literal.cpp +++ b/tests/msgpack/test_literal.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_literal { diff --git a/tests/msgpack/test_literal_map.cpp b/tests/msgpack/test_literal_map.cpp index 6f26725a6..54edbd552 100644 --- a/tests/msgpack/test_literal_map.cpp +++ b/tests/msgpack/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_literal_map { diff --git a/tests/msgpack/test_map.cpp b/tests/msgpack/test_map.cpp index 252909f41..6111fe5bb 100644 --- a/tests/msgpack/test_map.cpp +++ b/tests/msgpack/test_map.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.msgpack; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map { diff --git a/tests/msgpack/test_map_with_key_validation.cpp b/tests/msgpack/test_map_with_key_validation.cpp index b91e9ca5b..4ee8dbd4c 100644 --- a/tests/msgpack/test_map_with_key_validation.cpp +++ b/tests/msgpack/test_map_with_key_validation.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl.msgpack; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map_with_key_validation { diff --git a/tests/msgpack/test_monster_example.cpp b/tests/msgpack/test_monster_example.cpp index f11c2c661..c6f642205 100644 --- a/tests/msgpack/test_monster_example.cpp +++ b/tests/msgpack/test_monster_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_monster_example { diff --git a/tests/msgpack/test_readme_example.cpp b/tests/msgpack/test_readme_example.cpp index 3e4d55a68..0047325a9 100644 --- a/tests/msgpack/test_readme_example.cpp +++ b/tests/msgpack/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_readme_example { diff --git a/tests/msgpack/test_readme_example2.cpp b/tests/msgpack/test_readme_example2.cpp index 9bb556be7..a25c39b25 100644 --- a/tests/msgpack/test_readme_example2.cpp +++ b/tests/msgpack/test_readme_example2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_readme_example2 { diff --git a/tests/msgpack/test_ref.cpp b/tests/msgpack/test_ref.cpp index 6c35f5c4a..6d3510950 100644 --- a/tests/msgpack/test_ref.cpp +++ b/tests/msgpack/test_ref.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.msgpack; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/msgpack/test_regression_bugs.cpp b/tests/msgpack/test_regression_bugs.cpp index 954cdb420..b01ce981b 100644 --- a/tests/msgpack/test_regression_bugs.cpp +++ b/tests/msgpack/test_regression_bugs.cpp @@ -6,8 +6,8 @@ #include #include #include -import rfl; -import rfl.msgpack; +#include +#include diff --git a/tests/msgpack/test_save_load.cpp b/tests/msgpack/test_save_load.cpp index 880cb9749..07c840b0e 100644 --- a/tests/msgpack/test_save_load.cpp +++ b/tests/msgpack/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include -import rfl; -import rfl.msgpack; +#include +#include namespace test_save_load { diff --git a/tests/msgpack/test_set.cpp b/tests/msgpack/test_set.cpp index 3ff27289a..b6653a44a 100644 --- a/tests/msgpack/test_set.cpp +++ b/tests/msgpack/test_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.msgpack; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/msgpack/test_size.cpp b/tests/msgpack/test_size.cpp index 857c0b658..10656d68a 100644 --- a/tests/msgpack/test_size.cpp +++ b/tests/msgpack/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_size { diff --git a/tests/msgpack/test_skip.cpp b/tests/msgpack/test_skip.cpp index d88cee46e..96ef18f49 100644 --- a/tests/msgpack/test_skip.cpp +++ b/tests/msgpack/test_skip.cpp @@ -1,7 +1,7 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; +#include namespace test_skip { diff --git a/tests/msgpack/test_snake_case_to_camel_case.cpp b/tests/msgpack/test_snake_case_to_camel_case.cpp index 7baf173dd..0ff6ecbcd 100644 --- a/tests/msgpack/test_snake_case_to_camel_case.cpp +++ b/tests/msgpack/test_snake_case_to_camel_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; +#include namespace test_snake_case_to_camel_case { diff --git a/tests/msgpack/test_snake_case_to_pascal_case.cpp b/tests/msgpack/test_snake_case_to_pascal_case.cpp index b4f0e345a..bf2990819 100644 --- a/tests/msgpack/test_snake_case_to_pascal_case.cpp +++ b/tests/msgpack/test_snake_case_to_pascal_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; +#include namespace test_snake_case_to_pascal_case { diff --git a/tests/msgpack/test_string_map.cpp b/tests/msgpack/test_string_map.cpp index e17a15d71..142e5a0b1 100644 --- a/tests/msgpack/test_string_map.cpp +++ b/tests/msgpack/test_string_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_string_map { diff --git a/tests/msgpack/test_tagged_union.cpp b/tests/msgpack/test_tagged_union.cpp index 67ed23827..7b2fb03a1 100644 --- a/tests/msgpack/test_tagged_union.cpp +++ b/tests/msgpack/test_tagged_union.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_tagged_union { diff --git a/tests/msgpack/test_tagged_union2.cpp b/tests/msgpack/test_tagged_union2.cpp index e4ad1e5bb..e12a29295 100644 --- a/tests/msgpack/test_tagged_union2.cpp +++ b/tests/msgpack/test_tagged_union2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_tagged_union2 { diff --git a/tests/msgpack/test_timestamp.cpp b/tests/msgpack/test_timestamp.cpp index 5b9f06e33..9a990c5a9 100644 --- a/tests/msgpack/test_timestamp.cpp +++ b/tests/msgpack/test_timestamp.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_timestamp { diff --git a/tests/msgpack/test_unique_ptr.cpp b/tests/msgpack/test_unique_ptr.cpp index 02a981a76..818c96c4c 100644 --- a/tests/msgpack/test_unique_ptr.cpp +++ b/tests/msgpack/test_unique_ptr.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.msgpack; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr { diff --git a/tests/msgpack/test_unique_ptr2.cpp b/tests/msgpack/test_unique_ptr2.cpp index a84002692..bda33f6b8 100644 --- a/tests/msgpack/test_unique_ptr2.cpp +++ b/tests/msgpack/test_unique_ptr2.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.msgpack; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/msgpack/test_variant.cpp b/tests/msgpack/test_variant.cpp index e0619d08f..da892f889 100644 --- a/tests/msgpack/test_variant.cpp +++ b/tests/msgpack/test_variant.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.msgpack; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/msgpack/test_vectorstring.cpp b/tests/msgpack/test_vectorstring.cpp index 360c4a9a8..23cabfa5d 100644 --- a/tests/msgpack/test_vectorstring.cpp +++ b/tests/msgpack/test_vectorstring.cpp @@ -1,7 +1,7 @@ #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include namespace test_vectorstring { diff --git a/tests/msgpack/test_wstring.cpp b/tests/msgpack/test_wstring.cpp index 9ffb5dce7..b5d93c310 100644 --- a/tests/msgpack/test_wstring.cpp +++ b/tests/msgpack/test_wstring.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.msgpack; -import rfl; +#include +#include struct TestStruct { diff --git a/tests/msgpack/write_and_read.hpp b/tests/msgpack/write_and_read.hpp index a3fcfd9ad..f39cae4e9 100644 --- a/tests/msgpack/write_and_read.hpp +++ b/tests/msgpack/write_and_read.hpp @@ -4,7 +4,7 @@ #include #include -import rfl.msgpack; +#include diff --git a/tests/parquet/test_boolean.cpp b/tests/parquet/test_boolean.cpp index 2594c0993..968182fcf 100644 --- a/tests/parquet/test_boolean.cpp +++ b/tests/parquet/test_boolean.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.parquet; +#include namespace test_boolean { diff --git a/tests/parquet/test_box.cpp b/tests/parquet/test_box.cpp index d4e25d36f..58dbfbc13 100644 --- a/tests/parquet/test_box.cpp +++ b/tests/parquet/test_box.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.parquet; +#include namespace test_box { diff --git a/tests/parquet/test_bytestring.cpp b/tests/parquet/test_bytestring.cpp index be2e2c318..9c7f615b4 100644 --- a/tests/parquet/test_bytestring.cpp +++ b/tests/parquet/test_bytestring.cpp @@ -1,9 +1,10 @@ #include -#include "write_and_read.hpp" #include -import rfl.parquet; +#include "write_and_read.hpp" + +#include namespace test_bytestring { diff --git a/tests/parquet/test_camel_case.cpp b/tests/parquet/test_camel_case.cpp index db809408c..3bcea9f44 100644 --- a/tests/parquet/test_camel_case.cpp +++ b/tests/parquet/test_camel_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.parquet; +#include namespace test_camel_case { diff --git a/tests/parquet/test_deque.cpp b/tests/parquet/test_deque.cpp index 2935f67e3..c72fbb9b7 100644 --- a/tests/parquet/test_deque.cpp +++ b/tests/parquet/test_deque.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.parquet; +#include namespace test_deque { diff --git a/tests/parquet/test_enums.cpp b/tests/parquet/test_enums.cpp index 22c2a3f73..913e8b0c4 100644 --- a/tests/parquet/test_enums.cpp +++ b/tests/parquet/test_enums.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.parquet; +#include namespace test_enums { diff --git a/tests/parquet/test_flatten.cpp b/tests/parquet/test_flatten.cpp index 71d22d079..7efe2b2f8 100644 --- a/tests/parquet/test_flatten.cpp +++ b/tests/parquet/test_flatten.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.parquet; +#include namespace test_flatten { diff --git a/tests/parquet/test_gzip.cpp b/tests/parquet/test_gzip.cpp index f50c7b9d8..4c52e06af 100644 --- a/tests/parquet/test_gzip.cpp +++ b/tests/parquet/test_gzip.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.parquet; +#include namespace test_gzip { diff --git a/tests/parquet/test_literal.cpp b/tests/parquet/test_literal.cpp index 1b77a3ad7..0ec599208 100644 --- a/tests/parquet/test_literal.cpp +++ b/tests/parquet/test_literal.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.parquet; +#include namespace test_literal { diff --git a/tests/parquet/test_optionals.cpp b/tests/parquet/test_optionals.cpp index f7665f5f0..dc24ff244 100644 --- a/tests/parquet/test_optionals.cpp +++ b/tests/parquet/test_optionals.cpp @@ -3,7 +3,7 @@ #include #include "write_and_read.hpp" -import rfl.parquet; +#include namespace test_optionals { diff --git a/tests/parquet/test_readme_example.cpp b/tests/parquet/test_readme_example.cpp index 99acc4898..b164c7988 100644 --- a/tests/parquet/test_readme_example.cpp +++ b/tests/parquet/test_readme_example.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.parquet; +#include namespace test_readme_example { diff --git a/tests/parquet/test_ref.cpp b/tests/parquet/test_ref.cpp index fca832c5e..10d4692ae 100644 --- a/tests/parquet/test_ref.cpp +++ b/tests/parquet/test_ref.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.parquet; +#include namespace test_ref { diff --git a/tests/parquet/test_save_load.cpp b/tests/parquet/test_save_load.cpp index 42fdebfe3..4316da5fb 100644 --- a/tests/parquet/test_save_load.cpp +++ b/tests/parquet/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include #include -import rfl; -import rfl.parquet; +#include +#include namespace test_save_load { diff --git a/tests/parquet/test_shared_ptr.cpp b/tests/parquet/test_shared_ptr.cpp index fc5d92ea9..0e761bac9 100644 --- a/tests/parquet/test_shared_ptr.cpp +++ b/tests/parquet/test_shared_ptr.cpp @@ -3,7 +3,7 @@ #include #include "write_and_read.hpp" -import rfl.parquet; +#include namespace test_shared_ptr { diff --git a/tests/parquet/test_unique_ptr.cpp b/tests/parquet/test_unique_ptr.cpp index 725f38457..db352026f 100644 --- a/tests/parquet/test_unique_ptr.cpp +++ b/tests/parquet/test_unique_ptr.cpp @@ -3,7 +3,7 @@ #include #include "write_and_read.hpp" -import rfl.parquet; +#include namespace test_unique_ptr { diff --git a/tests/parquet/write_and_read.hpp b/tests/parquet/write_and_read.hpp index 2fc2b0306..128706b25 100644 --- a/tests/parquet/write_and_read.hpp +++ b/tests/parquet/write_and_read.hpp @@ -4,7 +4,7 @@ #include #include -import rfl.parquet; +#include diff --git a/tests/test_rfl.hpp.in b/tests/test_rfl.hpp.in new file mode 100644 index 000000000..f1b7ce0f3 --- /dev/null +++ b/tests/test_rfl.hpp.in @@ -0,0 +1,3 @@ +#pragma once + +@REFLECTCPP_TEST_DEPENDENCY@ diff --git a/tests/toml/test_add_struct_name.cpp b/tests/toml/test_add_struct_name.cpp index 1c7d1f682..aa179ac1e 100644 --- a/tests/toml/test_add_struct_name.cpp +++ b/tests/toml/test_add_struct_name.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.toml; +#include namespace test_add_struct_name { diff --git a/tests/toml/test_array.cpp b/tests/toml/test_array.cpp index 4d96199da..4e8ad15eb 100644 --- a/tests/toml/test_array.cpp +++ b/tests/toml/test_array.cpp @@ -5,11 +5,12 @@ // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include "write_and_read.hpp" #include -import rfl; -import rfl.toml; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/toml/test_box.cpp b/tests/toml/test_box.cpp index 01cc473fc..8c925b491 100644 --- a/tests/toml/test_box.cpp +++ b/tests/toml/test_box.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.toml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/toml/test_combined_processors.cpp b/tests/toml/test_combined_processors.cpp index 4009fc5e3..9f2aa4225 100644 --- a/tests/toml/test_combined_processors.cpp +++ b/tests/toml/test_combined_processors.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.toml; +#include namespace test_combined_processors { diff --git a/tests/toml/test_custom_class1.cpp b/tests/toml/test_custom_class1.cpp index 3bfb9eeb1..4762c8e46 100644 --- a/tests/toml/test_custom_class1.cpp +++ b/tests/toml/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_custom_class1 { diff --git a/tests/toml/test_custom_class3.cpp b/tests/toml/test_custom_class3.cpp index fda4a8e1d..a2a0153be 100644 --- a/tests/toml/test_custom_class3.cpp +++ b/tests/toml/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_custom_class3 { diff --git a/tests/toml/test_custom_class4.cpp b/tests/toml/test_custom_class4.cpp index 22b86e578..b76f7f1a2 100644 --- a/tests/toml/test_custom_class4.cpp +++ b/tests/toml/test_custom_class4.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_custom_class4 { diff --git a/tests/toml/test_default_values.cpp b/tests/toml/test_default_values.cpp index d82724bc4..5fccbc1e7 100644 --- a/tests/toml/test_default_values.cpp +++ b/tests/toml/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_default_values { diff --git a/tests/toml/test_deque.cpp b/tests/toml/test_deque.cpp index b3929dd87..2fcdac55e 100644 --- a/tests/toml/test_deque.cpp +++ b/tests/toml/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.toml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/toml/test_enum.cpp b/tests/toml/test_enum.cpp index cea42ac51..7dbfb40d3 100644 --- a/tests/toml/test_enum.cpp +++ b/tests/toml/test_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_enum { diff --git a/tests/toml/test_field_variant.cpp b/tests/toml/test_field_variant.cpp index 09576af5d..ce590a811 100644 --- a/tests/toml/test_field_variant.cpp +++ b/tests/toml/test_field_variant.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_field_variant { diff --git a/tests/toml/test_flag_enum.cpp b/tests/toml/test_flag_enum.cpp index 3654c2003..1604437ac 100644 --- a/tests/toml/test_flag_enum.cpp +++ b/tests/toml/test_flag_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_flag_enum { diff --git a/tests/toml/test_flag_enum_with_int.cpp b/tests/toml/test_flag_enum_with_int.cpp index 60f5fed7c..4348e44d4 100644 --- a/tests/toml/test_flag_enum_with_int.cpp +++ b/tests/toml/test_flag_enum_with_int.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/toml/test_flatten.cpp b/tests/toml/test_flatten.cpp index 7aee5908d..dd9df0bf2 100644 --- a/tests/toml/test_flatten.cpp +++ b/tests/toml/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_flatten { diff --git a/tests/toml/test_flatten_anonymous.cpp b/tests/toml/test_flatten_anonymous.cpp index ca44a8592..849689b0b 100644 --- a/tests/toml/test_flatten_anonymous.cpp +++ b/tests/toml/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/toml/test_forward_list.cpp b/tests/toml/test_forward_list.cpp index cc5bbef16..2fcabcd61 100644 --- a/tests/toml/test_forward_list.cpp +++ b/tests/toml/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.toml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/toml/test_literal.cpp b/tests/toml/test_literal.cpp index 2dd8888db..037db0ccd 100644 --- a/tests/toml/test_literal.cpp +++ b/tests/toml/test_literal.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_literal { diff --git a/tests/toml/test_literal_map.cpp b/tests/toml/test_literal_map.cpp index 56d330308..3cdbcceed 100644 --- a/tests/toml/test_literal_map.cpp +++ b/tests/toml/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_literal_map { diff --git a/tests/toml/test_map.cpp b/tests/toml/test_map.cpp index 6bdd7cdd5..8fe0f6b48 100644 --- a/tests/toml/test_map.cpp +++ b/tests/toml/test_map.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.toml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map { diff --git a/tests/toml/test_map_with_key_validation.cpp b/tests/toml/test_map_with_key_validation.cpp index b07315987..dca384993 100644 --- a/tests/toml/test_map_with_key_validation.cpp +++ b/tests/toml/test_map_with_key_validation.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl.toml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map_with_key_validation { diff --git a/tests/toml/test_monster_example.cpp b/tests/toml/test_monster_example.cpp index b39bec02b..f1f6e454f 100644 --- a/tests/toml/test_monster_example.cpp +++ b/tests/toml/test_monster_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_monster_example { diff --git a/tests/toml/test_readme_example.cpp b/tests/toml/test_readme_example.cpp index 752abd425..6d009e480 100644 --- a/tests/toml/test_readme_example.cpp +++ b/tests/toml/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_readme_example { diff --git a/tests/toml/test_readme_example2.cpp b/tests/toml/test_readme_example2.cpp index b47dcc64f..36ec957b6 100644 --- a/tests/toml/test_readme_example2.cpp +++ b/tests/toml/test_readme_example2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_readme_example2 { diff --git a/tests/toml/test_ref.cpp b/tests/toml/test_ref.cpp index cf1461b44..7279b682f 100644 --- a/tests/toml/test_ref.cpp +++ b/tests/toml/test_ref.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.toml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/toml/test_regression_bugs.cpp b/tests/toml/test_regression_bugs.cpp index 297d025ee..ee4f09238 100644 --- a/tests/toml/test_regression_bugs.cpp +++ b/tests/toml/test_regression_bugs.cpp @@ -4,8 +4,8 @@ #include #include -import rfl; -import rfl.toml; +#include +#include diff --git a/tests/toml/test_save_load.cpp b/tests/toml/test_save_load.cpp index 8ffa1e653..b263685cc 100644 --- a/tests/toml/test_save_load.cpp +++ b/tests/toml/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include -import rfl; -import rfl.toml; +#include +#include namespace test_save_load { diff --git a/tests/toml/test_set.cpp b/tests/toml/test_set.cpp index c63ccffd9..a90ca2240 100644 --- a/tests/toml/test_set.cpp +++ b/tests/toml/test_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.toml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/toml/test_size.cpp b/tests/toml/test_size.cpp index 3b0205af3..567dcbc54 100644 --- a/tests/toml/test_size.cpp +++ b/tests/toml/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_size { diff --git a/tests/toml/test_snake_case_to_camel_case.cpp b/tests/toml/test_snake_case_to_camel_case.cpp index 06f576cfd..8fda25270 100644 --- a/tests/toml/test_snake_case_to_camel_case.cpp +++ b/tests/toml/test_snake_case_to_camel_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.toml; +#include namespace test_snake_case_to_camel_case { diff --git a/tests/toml/test_snake_case_to_pascal_case.cpp b/tests/toml/test_snake_case_to_pascal_case.cpp index 13b6d4881..fddd5cba3 100644 --- a/tests/toml/test_snake_case_to_pascal_case.cpp +++ b/tests/toml/test_snake_case_to_pascal_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.toml; +#include namespace test_snake_case_to_pascal_case { diff --git a/tests/toml/test_string_map.cpp b/tests/toml/test_string_map.cpp index c67847782..0e4095bf4 100644 --- a/tests/toml/test_string_map.cpp +++ b/tests/toml/test_string_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_string_map { diff --git a/tests/toml/test_tagged_union.cpp b/tests/toml/test_tagged_union.cpp index bf0fca3d1..7ee3b76fc 100644 --- a/tests/toml/test_tagged_union.cpp +++ b/tests/toml/test_tagged_union.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_tagged_union { diff --git a/tests/toml/test_timestamp.cpp b/tests/toml/test_timestamp.cpp index 379003e48..ff7087bcf 100644 --- a/tests/toml/test_timestamp.cpp +++ b/tests/toml/test_timestamp.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include namespace test_timestamp { diff --git a/tests/toml/test_unique_ptr.cpp b/tests/toml/test_unique_ptr.cpp index 7d2d31f61..36d06ebb7 100644 --- a/tests/toml/test_unique_ptr.cpp +++ b/tests/toml/test_unique_ptr.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.toml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr { diff --git a/tests/toml/test_unique_ptr2.cpp b/tests/toml/test_unique_ptr2.cpp index 6953e9d81..11541163d 100644 --- a/tests/toml/test_unique_ptr2.cpp +++ b/tests/toml/test_unique_ptr2.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.toml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/toml/test_variant.cpp b/tests/toml/test_variant.cpp index 7d9afd408..40390a3e2 100644 --- a/tests/toml/test_variant.cpp +++ b/tests/toml/test_variant.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.toml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/toml/test_wstring.cpp b/tests/toml/test_wstring.cpp index 933c031c9..af77ec05f 100644 --- a/tests/toml/test_wstring.cpp +++ b/tests/toml/test_wstring.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.toml; -import rfl; +#include +#include struct TestStruct { diff --git a/tests/toml/write_and_read.hpp b/tests/toml/write_and_read.hpp index 6d2e98e83..707d829fd 100644 --- a/tests/toml/write_and_read.hpp +++ b/tests/toml/write_and_read.hpp @@ -5,7 +5,7 @@ #include #include -import rfl.toml; +#include diff --git a/tests/ubjson/test_add_struct_name.cpp b/tests/ubjson/test_add_struct_name.cpp index b182a280f..45e1ec3d3 100644 --- a/tests/ubjson/test_add_struct_name.cpp +++ b/tests/ubjson/test_add_struct_name.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; +#include namespace test_add_struct_name { diff --git a/tests/ubjson/test_array.cpp b/tests/ubjson/test_array.cpp index 6a9ba91fb..3f8c5c421 100644 --- a/tests/ubjson/test_array.cpp +++ b/tests/ubjson/test_array.cpp @@ -5,11 +5,12 @@ // Make sure things still compile when // rfl.hpp is included after rfl/ubjson.hpp. -#include "write_and_read.hpp" #include -import rfl; -import rfl.ubjson; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/ubjson/test_box.cpp b/tests/ubjson/test_box.cpp index 8663b9313..4e53207f1 100644 --- a/tests/ubjson/test_box.cpp +++ b/tests/ubjson/test_box.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.ubjson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/ubjson/test_bytestring.cpp b/tests/ubjson/test_bytestring.cpp index cd52cc4b4..2200e1eed 100644 --- a/tests/ubjson/test_bytestring.cpp +++ b/tests/ubjson/test_bytestring.cpp @@ -1,9 +1,10 @@ -#include "write_and_read.hpp" #include -import rfl.ubjson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_bytestring { diff --git a/tests/ubjson/test_combined_processors.cpp b/tests/ubjson/test_combined_processors.cpp index ae4b5e034..2c7c5ecbb 100644 --- a/tests/ubjson/test_combined_processors.cpp +++ b/tests/ubjson/test_combined_processors.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; +#include namespace test_combined_processors { diff --git a/tests/ubjson/test_custom_class1.cpp b/tests/ubjson/test_custom_class1.cpp index 213eb6615..bb486aba0 100644 --- a/tests/ubjson/test_custom_class1.cpp +++ b/tests/ubjson/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_custom_class1 { diff --git a/tests/ubjson/test_custom_class3.cpp b/tests/ubjson/test_custom_class3.cpp index 661350619..2b90fce55 100644 --- a/tests/ubjson/test_custom_class3.cpp +++ b/tests/ubjson/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_custom_class3 { diff --git a/tests/ubjson/test_custom_class4.cpp b/tests/ubjson/test_custom_class4.cpp index d005287ec..7f52f0f54 100644 --- a/tests/ubjson/test_custom_class4.cpp +++ b/tests/ubjson/test_custom_class4.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_custom_class4 { diff --git a/tests/ubjson/test_default_values.cpp b/tests/ubjson/test_default_values.cpp index 44b69f6fa..03819485f 100644 --- a/tests/ubjson/test_default_values.cpp +++ b/tests/ubjson/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_default_values { diff --git a/tests/ubjson/test_deque.cpp b/tests/ubjson/test_deque.cpp index 2d6f227cc..c23e20ffd 100644 --- a/tests/ubjson/test_deque.cpp +++ b/tests/ubjson/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.ubjson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/ubjson/test_enum.cpp b/tests/ubjson/test_enum.cpp index 2d58eef69..77fff7c4b 100644 --- a/tests/ubjson/test_enum.cpp +++ b/tests/ubjson/test_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_enum { diff --git a/tests/ubjson/test_error_messages.cpp b/tests/ubjson/test_error_messages.cpp index b48b66a68..b39683aa8 100644 --- a/tests/ubjson/test_error_messages.cpp +++ b/tests/ubjson/test_error_messages.cpp @@ -2,9 +2,9 @@ #include #include -import rfl; -import rfl.json; -import rfl.ubjson; +#include +#include +#include namespace test_error_messages { diff --git a/tests/ubjson/test_extra_fields.cpp b/tests/ubjson/test_extra_fields.cpp index a4725cf55..1aa6a4b79 100644 --- a/tests/ubjson/test_extra_fields.cpp +++ b/tests/ubjson/test_extra_fields.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_extra_fields { diff --git a/tests/ubjson/test_field_variant.cpp b/tests/ubjson/test_field_variant.cpp index 90f0e43d0..696f92348 100644 --- a/tests/ubjson/test_field_variant.cpp +++ b/tests/ubjson/test_field_variant.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_field_variant { diff --git a/tests/ubjson/test_flag_enum.cpp b/tests/ubjson/test_flag_enum.cpp index 4abacda5d..f4ebee978 100644 --- a/tests/ubjson/test_flag_enum.cpp +++ b/tests/ubjson/test_flag_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_flag_enum { diff --git a/tests/ubjson/test_flag_enum_with_int.cpp b/tests/ubjson/test_flag_enum_with_int.cpp index 64cdc685f..0cad9b727 100644 --- a/tests/ubjson/test_flag_enum_with_int.cpp +++ b/tests/ubjson/test_flag_enum_with_int.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/ubjson/test_flatten.cpp b/tests/ubjson/test_flatten.cpp index a970c680f..644f2eee3 100644 --- a/tests/ubjson/test_flatten.cpp +++ b/tests/ubjson/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_flatten { diff --git a/tests/ubjson/test_flatten_anonymous.cpp b/tests/ubjson/test_flatten_anonymous.cpp index b5e38d5b0..6304fd362 100644 --- a/tests/ubjson/test_flatten_anonymous.cpp +++ b/tests/ubjson/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/ubjson/test_forward_list.cpp b/tests/ubjson/test_forward_list.cpp index 40f8c5963..db4a14e73 100644 --- a/tests/ubjson/test_forward_list.cpp +++ b/tests/ubjson/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.ubjson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/ubjson/test_literal.cpp b/tests/ubjson/test_literal.cpp index ddc2d02c6..c863b24a1 100644 --- a/tests/ubjson/test_literal.cpp +++ b/tests/ubjson/test_literal.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_literal { diff --git a/tests/ubjson/test_literal_map.cpp b/tests/ubjson/test_literal_map.cpp index 53cc7d3bb..61e643994 100644 --- a/tests/ubjson/test_literal_map.cpp +++ b/tests/ubjson/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_literal_map { diff --git a/tests/ubjson/test_map.cpp b/tests/ubjson/test_map.cpp index ff68e3436..e647372cb 100644 --- a/tests/ubjson/test_map.cpp +++ b/tests/ubjson/test_map.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.ubjson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map { diff --git a/tests/ubjson/test_map_with_key_validation.cpp b/tests/ubjson/test_map_with_key_validation.cpp index 00cb0f3b0..4420fa37a 100644 --- a/tests/ubjson/test_map_with_key_validation.cpp +++ b/tests/ubjson/test_map_with_key_validation.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl.ubjson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map_with_key_validation { diff --git a/tests/ubjson/test_monster_example.cpp b/tests/ubjson/test_monster_example.cpp index d87f75913..3b9c968cb 100644 --- a/tests/ubjson/test_monster_example.cpp +++ b/tests/ubjson/test_monster_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_monster_example { diff --git a/tests/ubjson/test_read_byte_containers.cpp b/tests/ubjson/test_read_byte_containers.cpp index bdd5746b0..d2444b1fb 100644 --- a/tests/ubjson/test_read_byte_containers.cpp +++ b/tests/ubjson/test_read_byte_containers.cpp @@ -6,8 +6,8 @@ #include #include -import rfl; -import rfl.ubjson; +#include +#include // Make sure things still compile when diff --git a/tests/ubjson/test_readme_example.cpp b/tests/ubjson/test_readme_example.cpp index f9cc8f779..7eea14acd 100644 --- a/tests/ubjson/test_readme_example.cpp +++ b/tests/ubjson/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_readme_example { diff --git a/tests/ubjson/test_readme_example2.cpp b/tests/ubjson/test_readme_example2.cpp index 6139e5a62..eec3c2a2e 100644 --- a/tests/ubjson/test_readme_example2.cpp +++ b/tests/ubjson/test_readme_example2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_readme_example2 { diff --git a/tests/ubjson/test_ref.cpp b/tests/ubjson/test_ref.cpp index 36288ae5e..163b5c8dd 100644 --- a/tests/ubjson/test_ref.cpp +++ b/tests/ubjson/test_ref.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.ubjson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/ubjson/test_save_load.cpp b/tests/ubjson/test_save_load.cpp index 05d3e45fc..3da5bedb9 100644 --- a/tests/ubjson/test_save_load.cpp +++ b/tests/ubjson/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include -import rfl; -import rfl.ubjson; +#include +#include namespace test_save_load { diff --git a/tests/ubjson/test_set.cpp b/tests/ubjson/test_set.cpp index c90d545fe..af603a404 100644 --- a/tests/ubjson/test_set.cpp +++ b/tests/ubjson/test_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.ubjson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/ubjson/test_size.cpp b/tests/ubjson/test_size.cpp index 1cb472cab..2b4da7ea7 100644 --- a/tests/ubjson/test_size.cpp +++ b/tests/ubjson/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_size { diff --git a/tests/ubjson/test_snake_case_to_camel_case.cpp b/tests/ubjson/test_snake_case_to_camel_case.cpp index bd0df7858..7b979767f 100644 --- a/tests/ubjson/test_snake_case_to_camel_case.cpp +++ b/tests/ubjson/test_snake_case_to_camel_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; +#include namespace test_snake_case_to_camel_case { diff --git a/tests/ubjson/test_snake_case_to_pascal_case.cpp b/tests/ubjson/test_snake_case_to_pascal_case.cpp index a21053324..4a5980d25 100644 --- a/tests/ubjson/test_snake_case_to_pascal_case.cpp +++ b/tests/ubjson/test_snake_case_to_pascal_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; +#include namespace test_snake_case_to_pascal_case { diff --git a/tests/ubjson/test_string_map.cpp b/tests/ubjson/test_string_map.cpp index 2b757a3a1..07aea91e4 100644 --- a/tests/ubjson/test_string_map.cpp +++ b/tests/ubjson/test_string_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_string_map { diff --git a/tests/ubjson/test_tagged_union.cpp b/tests/ubjson/test_tagged_union.cpp index 177a6a214..78b66a614 100644 --- a/tests/ubjson/test_tagged_union.cpp +++ b/tests/ubjson/test_tagged_union.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_tagged_union { diff --git a/tests/ubjson/test_tagged_union2.cpp b/tests/ubjson/test_tagged_union2.cpp index 2556074f0..5a45a6a1d 100644 --- a/tests/ubjson/test_tagged_union2.cpp +++ b/tests/ubjson/test_tagged_union2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_tagged_union2 { diff --git a/tests/ubjson/test_timestamp.cpp b/tests/ubjson/test_timestamp.cpp index eaa35a6b3..b9555358a 100644 --- a/tests/ubjson/test_timestamp.cpp +++ b/tests/ubjson/test_timestamp.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_timestamp { diff --git a/tests/ubjson/test_unique_ptr.cpp b/tests/ubjson/test_unique_ptr.cpp index 7098742ec..b504d3b20 100644 --- a/tests/ubjson/test_unique_ptr.cpp +++ b/tests/ubjson/test_unique_ptr.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.ubjson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr { diff --git a/tests/ubjson/test_unique_ptr2.cpp b/tests/ubjson/test_unique_ptr2.cpp index aeb98469c..18d7d1d0d 100644 --- a/tests/ubjson/test_unique_ptr2.cpp +++ b/tests/ubjson/test_unique_ptr2.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.ubjson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/ubjson/test_variant.cpp b/tests/ubjson/test_variant.cpp index c2227a4db..96f28aa2a 100644 --- a/tests/ubjson/test_variant.cpp +++ b/tests/ubjson/test_variant.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.ubjson; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/ubjson/test_vectorstring.cpp b/tests/ubjson/test_vectorstring.cpp index 2d800ad24..f596171f0 100644 --- a/tests/ubjson/test_vectorstring.cpp +++ b/tests/ubjson/test_vectorstring.cpp @@ -1,7 +1,7 @@ #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include namespace test_vectorstring { diff --git a/tests/ubjson/test_wstring.cpp b/tests/ubjson/test_wstring.cpp index 77cab113f..bb76be27a 100644 --- a/tests/ubjson/test_wstring.cpp +++ b/tests/ubjson/test_wstring.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.ubjson; -import rfl; +#include +#include struct TestStruct { diff --git a/tests/ubjson/write_and_read.hpp b/tests/ubjson/write_and_read.hpp index b5f4462f3..41c1294f6 100644 --- a/tests/ubjson/write_and_read.hpp +++ b/tests/ubjson/write_and_read.hpp @@ -4,7 +4,7 @@ #include #include -import rfl.ubjson; +#include diff --git a/tests/xml/test_add_struct_name.cpp b/tests/xml/test_add_struct_name.cpp index 96e9c36c9..e952bc81b 100644 --- a/tests/xml/test_add_struct_name.cpp +++ b/tests/xml/test_add_struct_name.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.xml; +#include namespace test_add_struct_name { diff --git a/tests/xml/test_array.cpp b/tests/xml/test_array.cpp index 5d8de57cc..1f5705b08 100644 --- a/tests/xml/test_array.cpp +++ b/tests/xml/test_array.cpp @@ -5,11 +5,12 @@ // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include "write_and_read.hpp" #include -import rfl; -import rfl.xml; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/xml/test_attribute_rename.cpp b/tests/xml/test_attribute_rename.cpp index c6f80db2a..aed0026cf 100644 --- a/tests/xml/test_attribute_rename.cpp +++ b/tests/xml/test_attribute_rename.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_attribute_rename { diff --git a/tests/xml/test_box.cpp b/tests/xml/test_box.cpp index 785af5bda..a9e86e90e 100644 --- a/tests/xml/test_box.cpp +++ b/tests/xml/test_box.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.xml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/xml/test_combined_processors.cpp b/tests/xml/test_combined_processors.cpp index 26e398cad..88008d6bd 100644 --- a/tests/xml/test_combined_processors.cpp +++ b/tests/xml/test_combined_processors.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.xml; +#include namespace test_combined_processors { diff --git a/tests/xml/test_comment.cpp b/tests/xml/test_comment.cpp index 414a334a9..821811456 100644 --- a/tests/xml/test_comment.cpp +++ b/tests/xml/test_comment.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_comment { diff --git a/tests/xml/test_custom_class1.cpp b/tests/xml/test_custom_class1.cpp index bd110c12f..813e73fd7 100644 --- a/tests/xml/test_custom_class1.cpp +++ b/tests/xml/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_custom_class1 { diff --git a/tests/xml/test_custom_class3.cpp b/tests/xml/test_custom_class3.cpp index a33a7f4e8..34b141191 100644 --- a/tests/xml/test_custom_class3.cpp +++ b/tests/xml/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_custom_class3 { diff --git a/tests/xml/test_custom_class4.cpp b/tests/xml/test_custom_class4.cpp index 9c534ca13..aff70aec1 100644 --- a/tests/xml/test_custom_class4.cpp +++ b/tests/xml/test_custom_class4.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_custom_class4 { diff --git a/tests/xml/test_default_if_missing.cpp b/tests/xml/test_default_if_missing.cpp index 6d8f6503e..0da485cee 100644 --- a/tests/xml/test_default_if_missing.cpp +++ b/tests/xml/test_default_if_missing.cpp @@ -3,9 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; -import rfl.json; +#include +#include namespace test_default_if_missing { diff --git a/tests/xml/test_default_values.cpp b/tests/xml/test_default_values.cpp index c738b2203..b879c6c14 100644 --- a/tests/xml/test_default_values.cpp +++ b/tests/xml/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_default_values { diff --git a/tests/xml/test_deque.cpp b/tests/xml/test_deque.cpp index c65b3b2a2..6e140a3d7 100644 --- a/tests/xml/test_deque.cpp +++ b/tests/xml/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.xml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/xml/test_enum.cpp b/tests/xml/test_enum.cpp index d741cc0c4..665643496 100644 --- a/tests/xml/test_enum.cpp +++ b/tests/xml/test_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_enum { diff --git a/tests/xml/test_field_variant.cpp b/tests/xml/test_field_variant.cpp index ca1d8112b..161a192b0 100644 --- a/tests/xml/test_field_variant.cpp +++ b/tests/xml/test_field_variant.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_field_variant { diff --git a/tests/xml/test_flag_enum.cpp b/tests/xml/test_flag_enum.cpp index d8d423f3b..d21cdf156 100644 --- a/tests/xml/test_flag_enum.cpp +++ b/tests/xml/test_flag_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_flag_enum { diff --git a/tests/xml/test_flag_enum_with_int.cpp b/tests/xml/test_flag_enum_with_int.cpp index 7ae02731b..3134bd244 100644 --- a/tests/xml/test_flag_enum_with_int.cpp +++ b/tests/xml/test_flag_enum_with_int.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/xml/test_flatten.cpp b/tests/xml/test_flatten.cpp index e9aaf5365..24a856d8e 100644 --- a/tests/xml/test_flatten.cpp +++ b/tests/xml/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_flatten { diff --git a/tests/xml/test_flatten_anonymous.cpp b/tests/xml/test_flatten_anonymous.cpp index 22f7beeeb..2c78fb272 100644 --- a/tests/xml/test_flatten_anonymous.cpp +++ b/tests/xml/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/xml/test_forward_list.cpp b/tests/xml/test_forward_list.cpp index 6ac1ef67a..115706361 100644 --- a/tests/xml/test_forward_list.cpp +++ b/tests/xml/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.xml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/xml/test_generic.cpp b/tests/xml/test_generic.cpp index 3f5a28d47..d784e3f23 100644 --- a/tests/xml/test_generic.cpp +++ b/tests/xml/test_generic.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_generic { diff --git a/tests/xml/test_literal.cpp b/tests/xml/test_literal.cpp index eaeaa1394..bfab27729 100644 --- a/tests/xml/test_literal.cpp +++ b/tests/xml/test_literal.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_literal { diff --git a/tests/xml/test_literal_map.cpp b/tests/xml/test_literal_map.cpp index 063183c3d..7285bc5cf 100644 --- a/tests/xml/test_literal_map.cpp +++ b/tests/xml/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_literal_map { diff --git a/tests/xml/test_map.cpp b/tests/xml/test_map.cpp index 0b153a39c..10f119072 100644 --- a/tests/xml/test_map.cpp +++ b/tests/xml/test_map.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.xml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map { diff --git a/tests/xml/test_map_with_key_validation.cpp b/tests/xml/test_map_with_key_validation.cpp index a87c4445d..0730f2c71 100644 --- a/tests/xml/test_map_with_key_validation.cpp +++ b/tests/xml/test_map_with_key_validation.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl.xml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map_with_key_validation { diff --git a/tests/xml/test_monster_example.cpp b/tests/xml/test_monster_example.cpp index 0e351c522..861436eee 100644 --- a/tests/xml/test_monster_example.cpp +++ b/tests/xml/test_monster_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_monster_example { diff --git a/tests/xml/test_readme_example.cpp b/tests/xml/test_readme_example.cpp index 7e24bb10a..81c3ec4c0 100644 --- a/tests/xml/test_readme_example.cpp +++ b/tests/xml/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_readme_example { diff --git a/tests/xml/test_readme_example2.cpp b/tests/xml/test_readme_example2.cpp index 2856565ad..2e4a49e97 100644 --- a/tests/xml/test_readme_example2.cpp +++ b/tests/xml/test_readme_example2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_readme_example2 { diff --git a/tests/xml/test_ref.cpp b/tests/xml/test_ref.cpp index 2ed9a03ea..943be3ac0 100644 --- a/tests/xml/test_ref.cpp +++ b/tests/xml/test_ref.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.xml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/xml/test_regression_bugs.cpp b/tests/xml/test_regression_bugs.cpp index 9c2c72fd3..2d71ffa07 100644 --- a/tests/xml/test_regression_bugs.cpp +++ b/tests/xml/test_regression_bugs.cpp @@ -3,8 +3,8 @@ #include #include #include -import rfl; -import rfl.xml; +#include +#include diff --git a/tests/xml/test_save_load.cpp b/tests/xml/test_save_load.cpp index dfbf3c897..a09a7b874 100644 --- a/tests/xml/test_save_load.cpp +++ b/tests/xml/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include -import rfl; -import rfl.xml; +#include +#include namespace test_save_load { diff --git a/tests/xml/test_set.cpp b/tests/xml/test_set.cpp index d6e8d7d66..1d67ac31f 100644 --- a/tests/xml/test_set.cpp +++ b/tests/xml/test_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.xml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/xml/test_size.cpp b/tests/xml/test_size.cpp index 2120e1788..40157f132 100644 --- a/tests/xml/test_size.cpp +++ b/tests/xml/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_size { diff --git a/tests/xml/test_snake_case_to_camel_case.cpp b/tests/xml/test_snake_case_to_camel_case.cpp index b1f0641f2..6360319a7 100644 --- a/tests/xml/test_snake_case_to_camel_case.cpp +++ b/tests/xml/test_snake_case_to_camel_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.xml; +#include namespace test_snake_case_to_camel_case { diff --git a/tests/xml/test_snake_case_to_pascal_case.cpp b/tests/xml/test_snake_case_to_pascal_case.cpp index 33791aaed..d0eccfc0d 100644 --- a/tests/xml/test_snake_case_to_pascal_case.cpp +++ b/tests/xml/test_snake_case_to_pascal_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.xml; +#include namespace test_snake_case_to_pascal_case { diff --git a/tests/xml/test_string_map.cpp b/tests/xml/test_string_map.cpp index 6a94c292e..ed4ff4253 100644 --- a/tests/xml/test_string_map.cpp +++ b/tests/xml/test_string_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_string_map { diff --git a/tests/xml/test_tagged_union.cpp b/tests/xml/test_tagged_union.cpp index 812164e6d..633b067a6 100644 --- a/tests/xml/test_tagged_union.cpp +++ b/tests/xml/test_tagged_union.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_tagged_union { diff --git a/tests/xml/test_timestamp.cpp b/tests/xml/test_timestamp.cpp index 186124996..2f88f5b31 100644 --- a/tests/xml/test_timestamp.cpp +++ b/tests/xml/test_timestamp.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include namespace test_timestamp { diff --git a/tests/xml/test_unique_ptr.cpp b/tests/xml/test_unique_ptr.cpp index 95ffde01b..319d12cf3 100644 --- a/tests/xml/test_unique_ptr.cpp +++ b/tests/xml/test_unique_ptr.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.xml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr { diff --git a/tests/xml/test_unique_ptr2.cpp b/tests/xml/test_unique_ptr2.cpp index 0d0122491..a1fb3019c 100644 --- a/tests/xml/test_unique_ptr2.cpp +++ b/tests/xml/test_unique_ptr2.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.xml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/xml/test_variant.cpp b/tests/xml/test_variant.cpp index 309b4ea77..c2c10a86f 100644 --- a/tests/xml/test_variant.cpp +++ b/tests/xml/test_variant.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.xml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/xml/test_wstring.cpp b/tests/xml/test_wstring.cpp index a80d6ed9b..6cab54cd4 100644 --- a/tests/xml/test_wstring.cpp +++ b/tests/xml/test_wstring.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; +#include +#include struct TestStruct { diff --git a/tests/xml/test_xml_content.cpp b/tests/xml/test_xml_content.cpp index 3f0740e6d..8b93ba769 100644 --- a/tests/xml/test_xml_content.cpp +++ b/tests/xml/test_xml_content.cpp @@ -2,9 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; -import rfl.json; +#include +#include namespace test_xml_content { diff --git a/tests/xml/test_xml_content2.cpp b/tests/xml/test_xml_content2.cpp index 87fd0309a..0b160877e 100644 --- a/tests/xml/test_xml_content2.cpp +++ b/tests/xml/test_xml_content2.cpp @@ -2,9 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.xml; -import rfl; -import rfl.json; +#include +#include namespace test_xml_content2 { diff --git a/tests/xml/write_and_read.hpp b/tests/xml/write_and_read.hpp index 7234c79a4..1cab0e9d6 100644 --- a/tests/xml/write_and_read.hpp +++ b/tests/xml/write_and_read.hpp @@ -4,8 +4,8 @@ #include #include -import rfl; -import rfl.xml; +#include +#include diff --git a/tests/yaml/test_add_struct_name.cpp b/tests/yaml/test_add_struct_name.cpp index 6299d77f2..bc5f9928a 100644 --- a/tests/yaml/test_add_struct_name.cpp +++ b/tests/yaml/test_add_struct_name.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.yaml; +#include namespace test_add_struct_name { diff --git a/tests/yaml/test_array.cpp b/tests/yaml/test_array.cpp index 831485ee6..a248a48ad 100644 --- a/tests/yaml/test_array.cpp +++ b/tests/yaml/test_array.cpp @@ -5,11 +5,12 @@ // Make sure things still compile when // rfl.hpp is included after rfl/cbor.hpp. -#include "write_and_read.hpp" #include -import rfl; -import rfl.yaml; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/yaml/test_box.cpp b/tests/yaml/test_box.cpp index 0e303c4f5..10380333b 100644 --- a/tests/yaml/test_box.cpp +++ b/tests/yaml/test_box.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.yaml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/yaml/test_combined_processors.cpp b/tests/yaml/test_combined_processors.cpp index e2401d4fa..4e6778313 100644 --- a/tests/yaml/test_combined_processors.cpp +++ b/tests/yaml/test_combined_processors.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.yaml; +#include namespace test_combined_processors { diff --git a/tests/yaml/test_comment.cpp b/tests/yaml/test_comment.cpp index 4940c75d1..70bb18f1e 100644 --- a/tests/yaml/test_comment.cpp +++ b/tests/yaml/test_comment.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_comment { diff --git a/tests/yaml/test_comment_optional_array.cpp b/tests/yaml/test_comment_optional_array.cpp index 98faf56bf..fa9fb10bb 100644 --- a/tests/yaml/test_comment_optional_array.cpp +++ b/tests/yaml/test_comment_optional_array.cpp @@ -4,8 +4,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.yaml; +#include +#include namespace test_comment_optional_array { diff --git a/tests/yaml/test_custom_class1.cpp b/tests/yaml/test_custom_class1.cpp index eb127b8a7..b25613947 100644 --- a/tests/yaml/test_custom_class1.cpp +++ b/tests/yaml/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_custom_class1 { diff --git a/tests/yaml/test_custom_class3.cpp b/tests/yaml/test_custom_class3.cpp index c54fd2c61..70be6f702 100644 --- a/tests/yaml/test_custom_class3.cpp +++ b/tests/yaml/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_custom_class3 { diff --git a/tests/yaml/test_custom_class4.cpp b/tests/yaml/test_custom_class4.cpp index d4d792041..b319e2ce2 100644 --- a/tests/yaml/test_custom_class4.cpp +++ b/tests/yaml/test_custom_class4.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_custom_class4 { diff --git a/tests/yaml/test_default_values.cpp b/tests/yaml/test_default_values.cpp index 36a052c19..d44eb893a 100644 --- a/tests/yaml/test_default_values.cpp +++ b/tests/yaml/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_default_values { diff --git a/tests/yaml/test_deque.cpp b/tests/yaml/test_deque.cpp index 2570653a9..bae117b79 100644 --- a/tests/yaml/test_deque.cpp +++ b/tests/yaml/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.yaml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/yaml/test_double.cpp b/tests/yaml/test_double.cpp index 3b39cd552..f2e454ea1 100644 --- a/tests/yaml/test_double.cpp +++ b/tests/yaml/test_double.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_double { diff --git a/tests/yaml/test_enum.cpp b/tests/yaml/test_enum.cpp index 3b5afddf0..21ec1b5ca 100644 --- a/tests/yaml/test_enum.cpp +++ b/tests/yaml/test_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_enum { diff --git a/tests/yaml/test_field_variant.cpp b/tests/yaml/test_field_variant.cpp index 02e8a0446..2c7eaf184 100644 --- a/tests/yaml/test_field_variant.cpp +++ b/tests/yaml/test_field_variant.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_field_variant { diff --git a/tests/yaml/test_flag_enum.cpp b/tests/yaml/test_flag_enum.cpp index 4d2419964..7fd97972f 100644 --- a/tests/yaml/test_flag_enum.cpp +++ b/tests/yaml/test_flag_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_flag_enum { diff --git a/tests/yaml/test_flag_enum_with_int.cpp b/tests/yaml/test_flag_enum_with_int.cpp index 1c70bfb2c..b5564de9d 100644 --- a/tests/yaml/test_flag_enum_with_int.cpp +++ b/tests/yaml/test_flag_enum_with_int.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/yaml/test_flatten.cpp b/tests/yaml/test_flatten.cpp index 2d482355d..e4c2894b0 100644 --- a/tests/yaml/test_flatten.cpp +++ b/tests/yaml/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_flatten { diff --git a/tests/yaml/test_flatten_anonymous.cpp b/tests/yaml/test_flatten_anonymous.cpp index fd9814c61..f5dd92a35 100644 --- a/tests/yaml/test_flatten_anonymous.cpp +++ b/tests/yaml/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/yaml/test_forward_list.cpp b/tests/yaml/test_forward_list.cpp index 092a16f7f..68449e336 100644 --- a/tests/yaml/test_forward_list.cpp +++ b/tests/yaml/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.yaml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/yaml/test_literal.cpp b/tests/yaml/test_literal.cpp index 5365a7042..0c1d45a76 100644 --- a/tests/yaml/test_literal.cpp +++ b/tests/yaml/test_literal.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_literal { diff --git a/tests/yaml/test_literal_map.cpp b/tests/yaml/test_literal_map.cpp index 223652340..991e89257 100644 --- a/tests/yaml/test_literal_map.cpp +++ b/tests/yaml/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_literal_map { diff --git a/tests/yaml/test_map.cpp b/tests/yaml/test_map.cpp index 70645984b..2685865b2 100644 --- a/tests/yaml/test_map.cpp +++ b/tests/yaml/test_map.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.yaml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map { diff --git a/tests/yaml/test_map_with_key_validation.cpp b/tests/yaml/test_map_with_key_validation.cpp index dab96e0ef..fc5fe5ace 100644 --- a/tests/yaml/test_map_with_key_validation.cpp +++ b/tests/yaml/test_map_with_key_validation.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl.yaml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_map_with_key_validation { diff --git a/tests/yaml/test_monster_example.cpp b/tests/yaml/test_monster_example.cpp index 964d794a4..2efe462b4 100644 --- a/tests/yaml/test_monster_example.cpp +++ b/tests/yaml/test_monster_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_monster_example { diff --git a/tests/yaml/test_multiline.cpp b/tests/yaml/test_multiline.cpp index 176ab3a15..19b660b92 100644 --- a/tests/yaml/test_multiline.cpp +++ b/tests/yaml/test_multiline.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include struct MultilineTestStruct { diff --git a/tests/yaml/test_read_null.cpp b/tests/yaml/test_read_null.cpp index 87d85b0e8..396a2163b 100644 --- a/tests/yaml/test_read_null.cpp +++ b/tests/yaml/test_read_null.cpp @@ -7,7 +7,7 @@ #include #include -import rfl.yaml; +#include namespace test_read_null { diff --git a/tests/yaml/test_readme_example.cpp b/tests/yaml/test_readme_example.cpp index 16cf91bf9..1712281a4 100644 --- a/tests/yaml/test_readme_example.cpp +++ b/tests/yaml/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_readme_example { diff --git a/tests/yaml/test_readme_example2.cpp b/tests/yaml/test_readme_example2.cpp index 4b8918d17..5d5e63c71 100644 --- a/tests/yaml/test_readme_example2.cpp +++ b/tests/yaml/test_readme_example2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_readme_example2 { diff --git a/tests/yaml/test_ref.cpp b/tests/yaml/test_ref.cpp index 202298107..1dd8e7c8d 100644 --- a/tests/yaml/test_ref.cpp +++ b/tests/yaml/test_ref.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.yaml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/yaml/test_save_load.cpp b/tests/yaml/test_save_load.cpp index 0002b3e75..69cc0f8cf 100644 --- a/tests/yaml/test_save_load.cpp +++ b/tests/yaml/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include -import rfl; -import rfl.yaml; +#include +#include namespace test_save_load { diff --git a/tests/yaml/test_set.cpp b/tests/yaml/test_set.cpp index 38029c6c5..cb226f1ed 100644 --- a/tests/yaml/test_set.cpp +++ b/tests/yaml/test_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.yaml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/yaml/test_size.cpp b/tests/yaml/test_size.cpp index b1dd5a4a0..f725e409c 100644 --- a/tests/yaml/test_size.cpp +++ b/tests/yaml/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_size { diff --git a/tests/yaml/test_skip.cpp b/tests/yaml/test_skip.cpp index 0afa89912..2556b0da2 100644 --- a/tests/yaml/test_skip.cpp +++ b/tests/yaml/test_skip.cpp @@ -1,9 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; -import rfl.json; +#include +#include namespace test_skip { diff --git a/tests/yaml/test_snake_case_to_camel_case.cpp b/tests/yaml/test_snake_case_to_camel_case.cpp index c8cd5c96e..126df5754 100644 --- a/tests/yaml/test_snake_case_to_camel_case.cpp +++ b/tests/yaml/test_snake_case_to_camel_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.yaml; +#include namespace test_snake_case_to_camel_case { diff --git a/tests/yaml/test_snake_case_to_pascal_case.cpp b/tests/yaml/test_snake_case_to_pascal_case.cpp index 24677e152..2ffc16bd8 100644 --- a/tests/yaml/test_snake_case_to_pascal_case.cpp +++ b/tests/yaml/test_snake_case_to_pascal_case.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.yaml; +#include namespace test_snake_case_to_pascal_case { diff --git a/tests/yaml/test_string_map.cpp b/tests/yaml/test_string_map.cpp index fd14cfaf3..d4417a524 100644 --- a/tests/yaml/test_string_map.cpp +++ b/tests/yaml/test_string_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_string_map { diff --git a/tests/yaml/test_tagged_union.cpp b/tests/yaml/test_tagged_union.cpp index 6e23d3dc3..f50104aaf 100644 --- a/tests/yaml/test_tagged_union.cpp +++ b/tests/yaml/test_tagged_union.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_tagged_union { diff --git a/tests/yaml/test_timestamp.cpp b/tests/yaml/test_timestamp.cpp index d231171d3..e47dc7633 100644 --- a/tests/yaml/test_timestamp.cpp +++ b/tests/yaml/test_timestamp.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include namespace test_timestamp { diff --git a/tests/yaml/test_unique_ptr.cpp b/tests/yaml/test_unique_ptr.cpp index 078a1af6b..36d3cabe3 100644 --- a/tests/yaml/test_unique_ptr.cpp +++ b/tests/yaml/test_unique_ptr.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.yaml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr { diff --git a/tests/yaml/test_unique_ptr2.cpp b/tests/yaml/test_unique_ptr2.cpp index fa32908c5..4839d8b4b 100644 --- a/tests/yaml/test_unique_ptr2.cpp +++ b/tests/yaml/test_unique_ptr2.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.yaml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/yaml/test_variant.cpp b/tests/yaml/test_variant.cpp index 28848113b..d9818b057 100644 --- a/tests/yaml/test_variant.cpp +++ b/tests/yaml/test_variant.cpp @@ -1,10 +1,11 @@ -#include "write_and_read.hpp" #include #include -import rfl.yaml; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/yaml/test_wstring.cpp b/tests/yaml/test_wstring.cpp index 30c683322..affe15814 100644 --- a/tests/yaml/test_wstring.cpp +++ b/tests/yaml/test_wstring.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yaml; -import rfl; +#include +#include struct TestStruct { diff --git a/tests/yaml/write_and_read.hpp b/tests/yaml/write_and_read.hpp index e481d9eae..9e955c6a8 100644 --- a/tests/yaml/write_and_read.hpp +++ b/tests/yaml/write_and_read.hpp @@ -5,7 +5,7 @@ #include #include -import rfl.yaml; +#include diff --git a/tests/yas/test_add_struct_name.cpp b/tests/yas/test_add_struct_name.cpp index 1d55fb544..35104477d 100644 --- a/tests/yas/test_add_struct_name.cpp +++ b/tests/yas/test_add_struct_name.cpp @@ -2,7 +2,7 @@ #include #include "write_and_read.hpp" -import rfl.yas; +#include namespace test_add_struct_name { diff --git a/tests/yas/test_array.cpp b/tests/yas/test_array.cpp index 2c94c1b0a..3eed6d0f7 100644 --- a/tests/yas/test_array.cpp +++ b/tests/yas/test_array.cpp @@ -3,11 +3,12 @@ #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.yas; +#include "write_and_read.hpp" + +#include +#include namespace test_array { diff --git a/tests/yas/test_box.cpp b/tests/yas/test_box.cpp index 3037065dd..a3317535e 100644 --- a/tests/yas/test_box.cpp +++ b/tests/yas/test_box.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.yas; +#include "write_and_read.hpp" + +#include +#include namespace test_box { diff --git a/tests/yas/test_bytestring.cpp b/tests/yas/test_bytestring.cpp index a04538211..2b18c6bf8 100644 --- a/tests/yas/test_bytestring.cpp +++ b/tests/yas/test_bytestring.cpp @@ -1,9 +1,10 @@ -#include "write_and_read.hpp" #include -import rfl.yas; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_bytestring { diff --git a/tests/yas/test_custom_class1.cpp b/tests/yas/test_custom_class1.cpp index 974465958..2752cf9da 100644 --- a/tests/yas/test_custom_class1.cpp +++ b/tests/yas/test_custom_class1.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include namespace test_custom_class1 { diff --git a/tests/yas/test_custom_class3.cpp b/tests/yas/test_custom_class3.cpp index b833818a7..7e2aba53f 100644 --- a/tests/yas/test_custom_class3.cpp +++ b/tests/yas/test_custom_class3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include namespace test_custom_class3 { diff --git a/tests/yas/test_custom_class4.cpp b/tests/yas/test_custom_class4.cpp index bbafa1d9c..ea5a4ba8f 100644 --- a/tests/yas/test_custom_class4.cpp +++ b/tests/yas/test_custom_class4.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.yas; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_custom_class4 { diff --git a/tests/yas/test_default_values.cpp b/tests/yas/test_default_values.cpp index 468b9cac5..8f6ad78b8 100644 --- a/tests/yas/test_default_values.cpp +++ b/tests/yas/test_default_values.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include namespace test_default_values { diff --git a/tests/yas/test_deque.cpp b/tests/yas/test_deque.cpp index 0c1d0e7dd..de6bd7e2b 100644 --- a/tests/yas/test_deque.cpp +++ b/tests/yas/test_deque.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.yas; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_deque { diff --git a/tests/yas/test_enum.cpp b/tests/yas/test_enum.cpp index 5492325ee..36ba14878 100644 --- a/tests/yas/test_enum.cpp +++ b/tests/yas/test_enum.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.yas; +#include +#include namespace test_enum { diff --git a/tests/yas/test_field_variant.cpp b/tests/yas/test_field_variant.cpp index 167d013b4..946fdfc29 100644 --- a/tests/yas/test_field_variant.cpp +++ b/tests/yas/test_field_variant.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include namespace test_field_variant { diff --git a/tests/yas/test_field_variant_std.cpp b/tests/yas/test_field_variant_std.cpp index 4ad1a063c..b8bc81135 100644 --- a/tests/yas/test_field_variant_std.cpp +++ b/tests/yas/test_field_variant_std.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.yas; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_field_variant_std { diff --git a/tests/yas/test_flag_enum.cpp b/tests/yas/test_flag_enum.cpp index dff771d37..b6b5a77bd 100644 --- a/tests/yas/test_flag_enum.cpp +++ b/tests/yas/test_flag_enum.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include namespace test_flag_enum { diff --git a/tests/yas/test_flag_enum_with_int.cpp b/tests/yas/test_flag_enum_with_int.cpp index fc06db3f4..d2049e0f5 100644 --- a/tests/yas/test_flag_enum_with_int.cpp +++ b/tests/yas/test_flag_enum_with_int.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include namespace test_flag_enum_with_int { diff --git a/tests/yas/test_flatten.cpp b/tests/yas/test_flatten.cpp index 5aaa2dda8..9a9478da5 100644 --- a/tests/yas/test_flatten.cpp +++ b/tests/yas/test_flatten.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include namespace test_flatten { diff --git a/tests/yas/test_flatten_anonymous.cpp b/tests/yas/test_flatten_anonymous.cpp index dd40f99ab..9b7d04fe3 100644 --- a/tests/yas/test_flatten_anonymous.cpp +++ b/tests/yas/test_flatten_anonymous.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include namespace test_flatten_anonymous { diff --git a/tests/yas/test_forward_list.cpp b/tests/yas/test_forward_list.cpp index a0e680318..b0dfacdb4 100644 --- a/tests/yas/test_forward_list.cpp +++ b/tests/yas/test_forward_list.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.yas; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_forward_list { diff --git a/tests/yas/test_generic.cpp b/tests/yas/test_generic.cpp index f32eac1b5..a65c61e81 100644 --- a/tests/yas/test_generic.cpp +++ b/tests/yas/test_generic.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.yas; +#include +#include namespace test_generic { diff --git a/tests/yas/test_literal.cpp b/tests/yas/test_literal.cpp index 76a512e48..f485a7430 100644 --- a/tests/yas/test_literal.cpp +++ b/tests/yas/test_literal.cpp @@ -2,9 +2,9 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; -import rfl.json; +#include +#include +#include namespace test_literal { diff --git a/tests/yas/test_literal_map.cpp b/tests/yas/test_literal_map.cpp index 9978b6ccf..13aa21a6b 100644 --- a/tests/yas/test_literal_map.cpp +++ b/tests/yas/test_literal_map.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include namespace test_literal_map { diff --git a/tests/yas/test_map.cpp b/tests/yas/test_map.cpp index 3fd9d2f93..396f9a522 100644 --- a/tests/yas/test_map.cpp +++ b/tests/yas/test_map.cpp @@ -3,12 +3,13 @@ #include #include -#include "write_and_read.hpp" #include #include -import rfl; -import rfl.yas; +#include "write_and_read.hpp" + +#include +#include namespace test_map { diff --git a/tests/yas/test_map2.cpp b/tests/yas/test_map2.cpp index d1d7010a7..3cdbe1431 100644 --- a/tests/yas/test_map2.cpp +++ b/tests/yas/test_map2.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.yas; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_map2 { diff --git a/tests/yas/test_monster_example.cpp b/tests/yas/test_monster_example.cpp index 66bed74a8..31de17bf2 100644 --- a/tests/yas/test_monster_example.cpp +++ b/tests/yas/test_monster_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include namespace test_monster_example { diff --git a/tests/yas/test_optional_fields.cpp b/tests/yas/test_optional_fields.cpp index d51a327da..06c439618 100644 --- a/tests/yas/test_optional_fields.cpp +++ b/tests/yas/test_optional_fields.cpp @@ -1,11 +1,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.yas; +#include "write_and_read.hpp" + +#include +#include namespace test_optional_fields { diff --git a/tests/yas/test_optionals_in_vectors.cpp b/tests/yas/test_optionals_in_vectors.cpp index 39e49fd75..281b1e0c5 100644 --- a/tests/yas/test_optionals_in_vectors.cpp +++ b/tests/yas/test_optionals_in_vectors.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.yas; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_optionals_in_vectors { diff --git a/tests/yas/test_person.cpp b/tests/yas/test_person.cpp index 3a833ee3f..12fa9093b 100644 --- a/tests/yas/test_person.cpp +++ b/tests/yas/test_person.cpp @@ -4,8 +4,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.yas; +#include +#include namespace test_person { diff --git a/tests/yas/test_readme_example.cpp b/tests/yas/test_readme_example.cpp index ab452f446..1ae00984f 100644 --- a/tests/yas/test_readme_example.cpp +++ b/tests/yas/test_readme_example.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.yas; +#include +#include namespace test_readme_example { diff --git a/tests/yas/test_readme_example2.cpp b/tests/yas/test_readme_example2.cpp index 7a6430812..a515da72d 100644 --- a/tests/yas/test_readme_example2.cpp +++ b/tests/yas/test_readme_example2.cpp @@ -1,8 +1,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include namespace test_readme_example2 { diff --git a/tests/yas/test_readme_example3.cpp b/tests/yas/test_readme_example3.cpp index f622249b0..76416da9f 100644 --- a/tests/yas/test_readme_example3.cpp +++ b/tests/yas/test_readme_example3.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include namespace test_readme_example3 { diff --git a/tests/yas/test_ref.cpp b/tests/yas/test_ref.cpp index a8ff4a2de..b4f370962 100644 --- a/tests/yas/test_ref.cpp +++ b/tests/yas/test_ref.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.yas; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_ref { diff --git a/tests/yas/test_rfl_tuple.cpp b/tests/yas/test_rfl_tuple.cpp index 592cf6cc2..6d06cfa76 100644 --- a/tests/yas/test_rfl_tuple.cpp +++ b/tests/yas/test_rfl_tuple.cpp @@ -2,12 +2,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.yas; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_rfl_tuple { diff --git a/tests/yas/test_rfl_variant.cpp b/tests/yas/test_rfl_variant.cpp index e8ff600cb..a4c1448c6 100644 --- a/tests/yas/test_rfl_variant.cpp +++ b/tests/yas/test_rfl_variant.cpp @@ -1,10 +1,11 @@ #include -#include "write_and_read.hpp" #include -import rfl.yas; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/yas/test_save_load.cpp b/tests/yas/test_save_load.cpp index d3029f470..796ede5b6 100644 --- a/tests/yas/test_save_load.cpp +++ b/tests/yas/test_save_load.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.yas; +#include +#include namespace test_save_load { diff --git a/tests/yas/test_set.cpp b/tests/yas/test_set.cpp index bc49df85e..fb7151f86 100644 --- a/tests/yas/test_set.cpp +++ b/tests/yas/test_set.cpp @@ -1,12 +1,13 @@ #include -#include "write_and_read.hpp" #include #include #include -import rfl.yas; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_set { diff --git a/tests/yas/test_shared_ptr.cpp b/tests/yas/test_shared_ptr.cpp index 5d0966a79..cf870570f 100644 --- a/tests/yas/test_shared_ptr.cpp +++ b/tests/yas/test_shared_ptr.cpp @@ -2,12 +2,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.yas; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_shared_ptr { diff --git a/tests/yas/test_size.cpp b/tests/yas/test_size.cpp index 7334169c6..c575b7510 100644 --- a/tests/yas/test_size.cpp +++ b/tests/yas/test_size.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include namespace test_size { diff --git a/tests/yas/test_string_map.cpp b/tests/yas/test_string_map.cpp index d76ac9797..db4256568 100644 --- a/tests/yas/test_string_map.cpp +++ b/tests/yas/test_string_map.cpp @@ -3,9 +3,9 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; -import rfl.json; +#include +#include +#include namespace test_string_map { diff --git a/tests/yas/test_tagged_union.cpp b/tests/yas/test_tagged_union.cpp index 35fbf82b3..2ea591893 100644 --- a/tests/yas/test_tagged_union.cpp +++ b/tests/yas/test_tagged_union.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.yas; +#include +#include namespace test_tagged_union { diff --git a/tests/yas/test_timestamp.cpp b/tests/yas/test_timestamp.cpp index b57dfe4a2..c82495a41 100644 --- a/tests/yas/test_timestamp.cpp +++ b/tests/yas/test_timestamp.cpp @@ -3,8 +3,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.yas; +#include +#include namespace test_timestamp { diff --git a/tests/yas/test_tuple.cpp b/tests/yas/test_tuple.cpp index a87e3305d..7024007dc 100644 --- a/tests/yas/test_tuple.cpp +++ b/tests/yas/test_tuple.cpp @@ -4,8 +4,8 @@ #include #include "write_and_read.hpp" -import rfl; -import rfl.yas; +#include +#include namespace test_tuple { diff --git a/tests/yas/test_unique_ptr.cpp b/tests/yas/test_unique_ptr.cpp index 8a3a35c16..b7e9f5c59 100644 --- a/tests/yas/test_unique_ptr.cpp +++ b/tests/yas/test_unique_ptr.cpp @@ -3,11 +3,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.yas; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr { diff --git a/tests/yas/test_unique_ptr2.cpp b/tests/yas/test_unique_ptr2.cpp index b0ae476a1..9c6f7ad66 100644 --- a/tests/yas/test_unique_ptr2.cpp +++ b/tests/yas/test_unique_ptr2.cpp @@ -1,11 +1,12 @@ #include -#include "write_and_read.hpp" #include #include -import rfl.yas; -import rfl; +#include "write_and_read.hpp" + +#include +#include namespace test_unique_ptr2 { diff --git a/tests/yas/test_variant.cpp b/tests/yas/test_variant.cpp index b633aadbe..ea3f9d939 100644 --- a/tests/yas/test_variant.cpp +++ b/tests/yas/test_variant.cpp @@ -2,11 +2,12 @@ #include #include -#include "write_and_read.hpp" #include -import rfl; -import rfl.yas; +#include "write_and_read.hpp" + +#include +#include namespace test_variant { diff --git a/tests/yas/test_variants_in_vectors.cpp b/tests/yas/test_variants_in_vectors.cpp index 4d8c2a9eb..7b29293e4 100644 --- a/tests/yas/test_variants_in_vectors.cpp +++ b/tests/yas/test_variants_in_vectors.cpp @@ -1,12 +1,13 @@ #include #include -#include "write_and_read.hpp" #include -import rfl.yas; -import rfl; -import rfl.json; +#include "write_and_read.hpp" + +#include +#include +#include namespace test_variants_in_vectors { diff --git a/tests/yas/test_wstring.cpp b/tests/yas/test_wstring.cpp index a2b67ed77..00753cea1 100644 --- a/tests/yas/test_wstring.cpp +++ b/tests/yas/test_wstring.cpp @@ -2,8 +2,8 @@ #include #include "write_and_read.hpp" -import rfl.yas; -import rfl; +#include +#include struct TestStruct { diff --git a/tests/yas/write_and_read.hpp b/tests/yas/write_and_read.hpp index 981dd7082..3ebd3521d 100644 --- a/tests/yas/write_and_read.hpp +++ b/tests/yas/write_and_read.hpp @@ -4,8 +4,8 @@ #include #include -import rfl.json; -import rfl.yas; +#include +#include From b9cece1834aa6b29925b566931e9042cae327830 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Sat, 17 Oct 2026 19:14:00 +0800 Subject: [PATCH 09/18] Fix CI configurations and support GCC 15 modules --- .github/workflows/linux.yaml | 27 ++++++- .github/workflows/macos.yaml | 11 +++ .github/workflows/windows.yaml | 17 +++++ CMakeLists.txt | 13 ++-- include/rfl/Box.hpp | 2 + include/rfl/Ref.hpp | 2 + include/rfl/msgpack/Writer.hpp | 72 +++++-------------- modules/rfl.ctre.cppm | 9 ++- scripts/ci/Containerfile | 5 +- scripts/ci/README.md | 21 ++++-- scripts/ci_matrix.py | 6 +- src/rfl/msgpack/Writer.cpp | 60 ++++++++++++++++ tests/boost_serialization/write_and_read.hpp | 13 ---- tests/capnproto/test_enum.cpp | 1 - tests/capnproto/test_literal.cpp | 1 - tests/capnproto/test_map.cpp | 1 - tests/capnproto/test_map2.cpp | 1 - tests/capnproto/test_optional_fields.cpp | 1 - tests/capnproto/test_optionals_in_vectors.cpp | 1 - tests/capnproto/test_rfl_tuple.cpp | 1 - tests/capnproto/test_shared_ptr.cpp | 1 - tests/capnproto/test_string_map.cpp | 1 - tests/capnproto/test_tuple.cpp | 1 - tests/capnproto/test_unique_ptr.cpp | 1 - tests/capnproto/test_variants_in_vectors.cpp | 1 - tests/cereal/test_literal.cpp | 1 - tests/cereal/test_map2.cpp | 1 - tests/cereal/test_optionals_in_vectors.cpp | 1 - tests/cereal/test_rfl_tuple.cpp | 1 - tests/cereal/test_shared_ptr.cpp | 1 - tests/cereal/test_string_map.cpp | 1 - tests/cereal/test_variants_in_vectors.cpp | 1 - .../generic/test_box_default_constructor.cpp | 39 ++++++++++ tests/yas/test_literal.cpp | 1 - tests/yas/test_map2.cpp | 1 - tests/yas/test_optionals_in_vectors.cpp | 1 - tests/yas/test_rfl_tuple.cpp | 1 - tests/yas/test_shared_ptr.cpp | 1 - tests/yas/test_string_map.cpp | 1 - tests/yas/test_variants_in_vectors.cpp | 1 - tests/yas/write_and_read.hpp | 1 - 41 files changed, 212 insertions(+), 112 deletions(-) create mode 100644 tests/generic/test_box_default_constructor.cpp diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index a2d951e05..bf09e8118 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -12,7 +12,7 @@ jobs: matrix: format: ["JSON", "AVRO", "BOOST_SERIALIZATION", "CAPNPROTO", "CBOR", "CEREAL", "FLEXBUFFERS", "MSGPACK", "PARQUET", "TOML", "UBJSON", "XML", "YAML", "benchmarks", "headers"] compiler: [llvm, gcc] - compiler-version: [11, 12, 13, 14, 16, 17, 18, 19] + compiler-version: [11, 12, 13, 14, 15, 16, 17, 18, 19] cxx: [20, 23] modules: ["OFF", "ON"] exclude: @@ -34,6 +34,14 @@ jobs: - compiler: gcc compiler-version: 13 modules: "ON" + - compiler: gcc + compiler-version: 14 + modules: "ON" + # Keep the matrix below GitHub's 256-job limit: GCC 14 covers headers, + # while GCC 15 covers the minimum supported module compiler. + - compiler: gcc + compiler-version: 15 + modules: "OFF" - compiler: gcc compiler-version: 16 - compiler: gcc @@ -42,6 +50,8 @@ jobs: compiler-version: 18 - compiler: gcc compiler-version: 19 + - compiler: llvm + compiler-version: 15 - compiler: llvm compiler-version: 11 - compiler: llvm @@ -81,11 +91,26 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Run vcpkg uses: lukka/run-vcpkg@v11 + - name: Set up Python for benchmark tooling + if: matrix.format == 'benchmarks' + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Use CMake 3.31.6 for the pinned benchmark port + if: matrix.format == 'benchmarks' + shell: bash + run: | + python -m pip install cmake==3.31.6 + python -c "import cmake; print(cmake.CMAKE_BIN_DIR)" >> "$GITHUB_PATH" - name: Install dependencies run: | sudo apt update if [[ "${{ matrix.compiler-version }}" == 11 ]]; then sudo apt install -y ninja-build g++-11 + elif [[ "${{ matrix.compiler }}" == "gcc" && "${{ matrix.compiler-version }}" == 15 ]]; then + sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + sudo apt update + sudo apt install -y ninja-build g++-15 elif [[ "${{ matrix.compiler }}" == "llvm" && "${{ matrix.compiler-version }}" == 19 ]]; then sudo apt install -y ninja-build clang-19 clang-tools-19 else diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index a6a59bf7b..01d3b8577 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -31,6 +31,17 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Run vcpkg uses: lukka/run-vcpkg@v11 + - name: Set up Python for benchmark tooling + if: matrix.format == 'benchmarks' + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Use CMake 3.31.6 for the pinned benchmark port + if: matrix.format == 'benchmarks' + shell: bash + run: | + python -m pip install cmake==3.31.6 + python -c "import cmake; print(cmake.CMAKE_BIN_DIR)" >> "$GITHUB_PATH" - name: Install bison run: brew install bison openssl@3 - name: Install ninja diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 59e76349e..a5edbece4 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -30,6 +30,21 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - uses: ilammy/msvc-dev-cmd@v1 - uses: lukka/run-vcpkg@v11 + - name: Set up Python for benchmark tooling + if: matrix.format == 'benchmarks' + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Use CMake 3.31.6 for the pinned benchmark port + if: matrix.format == 'benchmarks' + shell: bash + run: | + python -m pip install cmake==3.31.6 + python -c "import cmake; print(cmake.CMAKE_BIN_DIR)" >> "$GITHUB_PATH" + - name: Add vcpkg runtime DLLs to PATH + # Some ports expose UNKNOWN imported targets, so TARGET_RUNTIME_DLLS + # cannot stage their DLLs for GoogleTest discovery during the build. + run: '"${{ github.workspace }}\build\vcpkg_installed\x64-windows\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append' - name: Compile benchmarks if: matrix.format == 'benchmarks' run: | @@ -94,6 +109,8 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - uses: ilammy/msvc-dev-cmd@v1 - uses: lukka/run-vcpkg@v11 + - name: Add vcpkg runtime DLLs to PATH + run: '"${{ github.workspace }}\build\vcpkg_installed\x64-windows\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append' - name: Compile tests (JSON) if: matrix.format == 'JSON' run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 326b2d290..d3a85624a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,9 +189,9 @@ if(REFLECTCPP_BUILD_MODULES) if(NOT CMAKE_GENERATOR MATCHES "Ninja|Visual Studio") message(FATAL_ERROR "REFLECTCPP_BUILD_MODULES requires Ninja or Visual Studio") endif() - if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14) + if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15) OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)) - message(FATAL_ERROR "REFLECTCPP_BUILD_MODULES requires GCC 14+ or Clang 19+; use headers with older compilers") + message(FATAL_ERROR "REFLECTCPP_BUILD_MODULES requires GCC 15+ or Clang 19+; use headers with older compilers") endif() else() # Keep ordinary header builds working with older compilers and generators. @@ -267,11 +267,12 @@ set(REFLECT_CPP_MODULES modules/rfl.cppm ) +# AVRO, CBOR, and UBJSON use JSON internally and in their round-trip tests. +if (_REFLECTCPP_NEEDS_JSON_IMPL OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_MODULES modules/rfl.json.cppm) +endif () if (REFLECTCPP_JSON OR REFLECTCPP_CHECK_HEADERS) - list(APPEND REFLECT_CPP_MODULES - modules/rfl.json.cppm - modules/rfl.c_arrays_and_inheritance.cppm - ) + list(APPEND REFLECT_CPP_MODULES modules/rfl.c_arrays_and_inheritance.cppm) endif () target_include_directories( diff --git a/include/rfl/Box.hpp b/include/rfl/Box.hpp index e06552203..ec4070fd0 100644 --- a/include/rfl/Box.hpp +++ b/include/rfl/Box.hpp @@ -50,6 +50,8 @@ class Box { } /// Default constructor - creates a Box containing a default-constructed T. + // Delay checking T's constructor so recursive, incomplete T remains valid. + template Box() : ptr_(std::make_unique()) {} /// Copy constructor - only available when C == Copyability::COPYABLE. diff --git a/include/rfl/Ref.hpp b/include/rfl/Ref.hpp index 296ff33ce..5f95809f6 100644 --- a/include/rfl/Ref.hpp +++ b/include/rfl/Ref.hpp @@ -48,6 +48,8 @@ class Ref { } /// Default constructor - creates a Ref containing a default-constructed T. + // Delay checking T's constructor so recursive, incomplete T remains valid. + template Ref() : ptr_(std::make_shared()) {} /// Copy constructor. diff --git a/include/rfl/msgpack/Writer.hpp b/include/rfl/msgpack/Writer.hpp index 91b6ab3f6..f93bd856b 100644 --- a/include/rfl/msgpack/Writer.hpp +++ b/include/rfl/msgpack/Writer.hpp @@ -63,14 +63,7 @@ class RFL_API Writer { template OutputVarType add_value_to_object(const std::string_view& _name, const T& _var, OutputObjectType*) const { - auto err = msgpack_pack_str(pk_, _name.size()); - if (err) { - throw std::runtime_error("Could not pack string."); - } - err = msgpack_pack_str_body(pk_, _name.data(), _name.size()); - if (err) { - throw std::runtime_error("Could not pack string body."); - } + write_name(_name); return new_value(_var); } @@ -92,63 +85,32 @@ class RFL_API Writer { OutputVarType new_value(const T& _var) const { using Type = std::remove_cvref_t; if constexpr (std::is_same()) { - auto err = msgpack_pack_str(pk_, _var.size()); - if (err) { - throw std::runtime_error("Could not pack string."); - } - err = msgpack_pack_str_body(pk_, _var.c_str(), _var.size()); - if (err) { - throw std::runtime_error("Could not pack string body."); - } - + return new_string(_var); } else if constexpr (concepts::MutableContiguousByteContainer) { - auto err = msgpack_pack_bin(pk_, _var.size()); - if (err) { - throw std::runtime_error("Could not pack binary string."); - } - err = msgpack_pack_bin_body(pk_, _var.data(), _var.size()); - if (err) { - throw std::runtime_error("Could not pack binary string."); - } - + return new_binary(_var.data(), _var.size()); } else if constexpr (std::is_same()) { - if (_var) { - const auto err = msgpack_pack_true(pk_); - if (err) { - throw std::runtime_error("Could not pack boolean."); - } - } else { - const auto err = msgpack_pack_false(pk_); - if (err) { - throw std::runtime_error("Could not pack boolean."); - } - } - + return new_bool(_var); } else if constexpr (std::is_floating_point()) { - const auto err = msgpack_pack_double(pk_, static_cast(_var)); - if (err) { - throw std::runtime_error("Could not pack double."); - } - + return new_double(static_cast(_var)); } else if constexpr (std::is_unsigned()) { - const auto err = - msgpack_pack_uint64(pk_, static_cast(_var)); - if (err) { - throw std::runtime_error("Could not pack uint."); - } - + return new_uint64(static_cast(_var)); } else if constexpr (std::is_integral()) { - const auto err = msgpack_pack_int64(pk_, static_cast(_var)); - if (err) { - throw std::runtime_error("Could not pack int."); - } - + return new_int64(static_cast(_var)); } else { static_assert(rfl::always_false_v, "Unsupported type."); } - return OutputVarType{}; } + // Keep calls to MessagePack's static inline functions out of exported templates. + void write_name(const std::string_view& _name) const; + + OutputVarType new_string(const std::string_view& _value) const; + OutputVarType new_binary(const void* _data, size_t _size) const; + OutputVarType new_bool(bool _value) const; + OutputVarType new_double(double _value) const; + OutputVarType new_uint64(std::uint64_t _value) const; + OutputVarType new_int64(std::int64_t _value) const; + private: /// The underlying packer. msgpack_packer* pk_; diff --git a/modules/rfl.ctre.cppm b/modules/rfl.ctre.cppm index 8d0b7d24d..0196d25f9 100644 --- a/modules/rfl.ctre.cppm +++ b/modules/rfl.ctre.cppm @@ -4,12 +4,19 @@ module; export module rfl.ctre; -// Keep CTRE's implementation in this module; only the rfl adapter is exported. +// GCC 15 loses CTRE's non-exported ADL overloads when instantiating an imported +// template. rfl imports this module privately, so these names stay out of rfl's API. +#if defined(__GNUC__) && __GNUC__ == 15 && !defined(__clang__) +export { +#endif #if __has_include() #include #else #include "rfl/thirdparty/ctre.hpp" #endif +#if defined(__GNUC__) && __GNUC__ == 15 && !defined(__clang__) +} +#endif export namespace rfl::internal { template diff --git a/scripts/ci/Containerfile b/scripts/ci/Containerfile index 53d9388c6..ca1d27d29 100644 --- a/scripts/ci/Containerfile +++ b/scripts/ci/Containerfile @@ -1,9 +1,12 @@ FROM ubuntu:24.04 ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends \ + software-properties-common ca-certificates && \ + add-apt-repository -y ppa:ubuntu-toolchain-r/test && \ + apt-get update && apt-get install -y --no-install-recommends \ ca-certificates curl git zip unzip tar pkg-config python3 python3-yaml \ python3-venv ninja-build build-essential \ - g++-11 g++-12 g++-13 g++-14 \ + g++-11 g++-12 g++-13 g++-14 g++-15 \ clang-16 clang-tools-16 clang-17 clang-tools-17 clang-18 clang-tools-18 \ clang-19 clang-tools-19 \ libgtest-dev libyaml-cpp-dev libtomlplusplus-dev libpugixml-dev \ diff --git a/scripts/ci/README.md b/scripts/ci/README.md index 3f4f31bd6..e44497cd1 100644 --- a/scripts/ci/README.md +++ b/scripts/ci/README.md @@ -21,14 +21,17 @@ podman build -f scripts/ci/Containerfile -t reflectcpp-ci . git submodule update --init --recursive ``` -The image provides GCC 11–14, Clang 16–19, their dependency scanners, Ninja, +The image provides GCC 11–15, Clang 16–19, their dependency scanners, Ninja, CMake 3.31.6, and several system dependencies. By default the runner uses the repository's pinned vcpkg submodule, like CI. The source tree and build cache -remain on the host. First-time vcpkg dependency builds require network access. +remain on the host. GCC 15 comes from the Ubuntu toolchain test PPA. +First-time vcpkg dependency builds require network access. +CI also pins CMake 3.31.6 for benchmarks: the pinned vcpkg benchmark port passes +an unrecognized warning category that CMake 4.4 rejects during configuration. ```sh python3 scripts/ci_matrix.py --container reflectcpp-ci \ - --compiler gcc-14 --compiler llvm-19 --format JSON --cxx 20 --modules ON + --compiler gcc-15 --compiler llvm-19 --format JSON --cxx 20 --modules ON # Original header compatibility matrix, followed by module-capable jobs: python3 scripts/ci_matrix.py --container reflectcpp-ci @@ -73,13 +76,21 @@ guarantee that a compiler implements every module feature or can compile this library and its dependencies. In particular, `import std` has different requirements and is not used by these module interfaces. -This project's Clang module builds require Clang 19 or newer. Clang 18 and older -remain in the header-build compatibility matrix. Clang 18 module importers fail +This project's module builds require GCC 15 or Clang 19 or newer. GCC 14 +remains supported through headers: its CTRE module importer fails with +`Bad file data`. GCC 15 requires an ADL visibility workaround in the private +`rfl.ctre` dependency; CTRE is not re-exported by `rfl`. + +Clang 18 and older remain in the header-build compatibility matrix. Clang 18 module importers fail with PCH enabled, so that combination is no longer supported. Library and test PCH remain enabled by default; `-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON` can disable them explicitly. Module interface sources keep `SKIP_PRECOMPILE_HEADERS` because their global module fragments must precede declarations. +With PCH enabled, GCC 15.2 (Ubuntu 24.04, C++20), GCC 15.3 (C++20 and C++23), +and GCC 16.2.1 (C++20) passed +the full JSON/CLI module suite: 342 tests passed and one locale test was skipped. + Sources: [CMake 3.31](https://cmake.org/cmake/help/v3.31/manual/cmake-cxxmodules.7.html), [GCC 14](https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/C_002b_002b-Modules.html), [Clang status](https://clang.llvm.org/cxx_status.html). diff --git a/scripts/ci_matrix.py b/scripts/ci_matrix.py index 9d130aa1c..9a9c45264 100644 --- a/scripts/ci_matrix.py +++ b/scripts/ci_matrix.py @@ -33,7 +33,7 @@ def matrix_jobs(): def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('--list', action='store_true', help='print selected jobs without running them') - parser.add_argument('--compiler', action='append', help='filter, e.g. gcc-14 or llvm-19; repeatable') + parser.add_argument('--compiler', action='append', help='filter, e.g. gcc-15 or llvm-19; repeatable') parser.add_argument('--format', action='append', help='filter formats; repeatable') parser.add_argument('--cxx', type=int, choices=(20, 23), help='filter language standard') parser.add_argument('--modules', choices=('ON', 'OFF'), default='OFF') @@ -75,11 +75,11 @@ def main(): continue if args.cxx and job['cxx'] != args.cxx: continue - if args.modules == 'ON' and job['compiler-version'] < (14 if job['compiler'] == 'gcc' else 19): + if args.modules == 'ON' and job['compiler-version'] < (15 if job['compiler'] == 'gcc' else 19): continue selected.append((job, compiler)) if not selected: - parser.error('no matching jobs (module jobs require GCC 14+ or Clang 19+)') + parser.error('no matching jobs (module jobs require GCC 15+ or Clang 19+)') if args.list: for job, compiler in selected: print(f"{job['format']}-cxx{job['cxx']}-{compiler}-modules-{args.modules}") diff --git a/src/rfl/msgpack/Writer.cpp b/src/rfl/msgpack/Writer.cpp index 359ec2c57..47459cca2 100644 --- a/src/rfl/msgpack/Writer.cpp +++ b/src/rfl/msgpack/Writer.cpp @@ -115,4 +115,64 @@ Writer::OutputObjectType Writer::new_object(const size_t _size) const { return OutputObjectType{}; } +void Writer::write_name(const std::string_view& _name) const { + auto err = msgpack_pack_str(pk_, _name.size()); + if (err) { + throw std::runtime_error("Could not pack string."); + } + err = msgpack_pack_str_body(pk_, _name.data(), _name.size()); + if (err) { + throw std::runtime_error("Could not pack string body."); + } +} + +Writer::OutputVarType Writer::new_string(const std::string_view& _value) const { + write_name(_value); + return OutputVarType{}; +} + +Writer::OutputVarType Writer::new_binary(const void* _data, size_t _size) const { + auto err = msgpack_pack_bin(pk_, _size); + if (err) { + throw std::runtime_error("Could not pack binary string."); + } + err = msgpack_pack_bin_body(pk_, _data, _size); + if (err) { + throw std::runtime_error("Could not pack binary string."); + } + return OutputVarType{}; +} + +Writer::OutputVarType Writer::new_bool(bool _value) const { + const auto err = _value ? msgpack_pack_true(pk_) : msgpack_pack_false(pk_); + if (err) { + throw std::runtime_error("Could not pack boolean."); + } + return OutputVarType{}; +} + +Writer::OutputVarType Writer::new_double(double _value) const { + const auto err = msgpack_pack_double(pk_, _value); + if (err) { + throw std::runtime_error("Could not pack double."); + } + return OutputVarType{}; +} + +Writer::OutputVarType Writer::new_uint64(std::uint64_t _value) const { + const auto err = msgpack_pack_uint64(pk_, _value); + if (err) { + throw std::runtime_error("Could not pack uint."); + } + return OutputVarType{}; +} + +Writer::OutputVarType Writer::new_int64(std::int64_t _value) const { + const auto err = msgpack_pack_int64(pk_, _value); + if (err) { + throw std::runtime_error("Could not pack int."); + } + return OutputVarType{}; +} + } // namespace rfl::msgpack diff --git a/tests/boost_serialization/write_and_read.hpp b/tests/boost_serialization/write_and_read.hpp index 6b7b8e1b1..555f5b311 100644 --- a/tests/boost_serialization/write_and_read.hpp +++ b/tests/boost_serialization/write_and_read.hpp @@ -6,7 +6,6 @@ #include #include -#include #include @@ -21,16 +20,4 @@ void write_and_read(const auto& _struct) { EXPECT_EQ(serialized1, serialized2); } -template -void write_and_read_with_json(const auto& _struct) { - using T = std::remove_cvref_t; - const auto serialized1 = rfl::boost_serialization::write(_struct); - const auto res = rfl::boost_serialization::read(serialized1); - EXPECT_TRUE(res && true) << "Test failed on read. Error: " - << res.error().what(); - const auto serialized2 = rfl::boost_serialization::write(res.value()); - EXPECT_EQ(serialized1, serialized2); - EXPECT_EQ(rfl::json::write(_struct), - rfl::json::write(res.value())); -} #endif diff --git a/tests/capnproto/test_enum.cpp b/tests/capnproto/test_enum.cpp index 78480c98d..cdcc47d4c 100644 --- a/tests/capnproto/test_enum.cpp +++ b/tests/capnproto/test_enum.cpp @@ -3,7 +3,6 @@ #include "write_and_read.hpp" #include #include -#include namespace test_enum { diff --git a/tests/capnproto/test_literal.cpp b/tests/capnproto/test_literal.cpp index c11153e75..09aa864a9 100644 --- a/tests/capnproto/test_literal.cpp +++ b/tests/capnproto/test_literal.cpp @@ -4,7 +4,6 @@ #include "write_and_read.hpp" #include #include -#include namespace test_literal { diff --git a/tests/capnproto/test_map.cpp b/tests/capnproto/test_map.cpp index 2349e981d..857a16b7b 100644 --- a/tests/capnproto/test_map.cpp +++ b/tests/capnproto/test_map.cpp @@ -8,7 +8,6 @@ #include #include -#include namespace test_map { diff --git a/tests/capnproto/test_map2.cpp b/tests/capnproto/test_map2.cpp index 7a1083ef3..506503097 100644 --- a/tests/capnproto/test_map2.cpp +++ b/tests/capnproto/test_map2.cpp @@ -7,7 +7,6 @@ #include #include -#include namespace test_map2 { diff --git a/tests/capnproto/test_optional_fields.cpp b/tests/capnproto/test_optional_fields.cpp index d6f652d34..ac05b42c9 100644 --- a/tests/capnproto/test_optional_fields.cpp +++ b/tests/capnproto/test_optional_fields.cpp @@ -7,7 +7,6 @@ #include #include -#include namespace test_optional_fields { diff --git a/tests/capnproto/test_optionals_in_vectors.cpp b/tests/capnproto/test_optionals_in_vectors.cpp index 64edc24a3..8756cad7b 100644 --- a/tests/capnproto/test_optionals_in_vectors.cpp +++ b/tests/capnproto/test_optionals_in_vectors.cpp @@ -7,7 +7,6 @@ #include #include -#include namespace test_optionals_in_vectors { diff --git a/tests/capnproto/test_rfl_tuple.cpp b/tests/capnproto/test_rfl_tuple.cpp index e743ccc17..be857a871 100644 --- a/tests/capnproto/test_rfl_tuple.cpp +++ b/tests/capnproto/test_rfl_tuple.cpp @@ -8,7 +8,6 @@ #include #include -#include namespace test_rfl_tuple { diff --git a/tests/capnproto/test_shared_ptr.cpp b/tests/capnproto/test_shared_ptr.cpp index c51fc627e..7f83ec1dd 100644 --- a/tests/capnproto/test_shared_ptr.cpp +++ b/tests/capnproto/test_shared_ptr.cpp @@ -8,7 +8,6 @@ #include #include -#include namespace test_shared_ptr { diff --git a/tests/capnproto/test_string_map.cpp b/tests/capnproto/test_string_map.cpp index a4a4a6e9c..84e83c665 100644 --- a/tests/capnproto/test_string_map.cpp +++ b/tests/capnproto/test_string_map.cpp @@ -5,7 +5,6 @@ #include "write_and_read.hpp" #include #include -#include namespace test_string_map { diff --git a/tests/capnproto/test_tuple.cpp b/tests/capnproto/test_tuple.cpp index 7aca8edf3..e7fd67399 100644 --- a/tests/capnproto/test_tuple.cpp +++ b/tests/capnproto/test_tuple.cpp @@ -9,7 +9,6 @@ #include #include -#include namespace test_tuple { diff --git a/tests/capnproto/test_unique_ptr.cpp b/tests/capnproto/test_unique_ptr.cpp index aa816dd38..bef071b8c 100644 --- a/tests/capnproto/test_unique_ptr.cpp +++ b/tests/capnproto/test_unique_ptr.cpp @@ -8,7 +8,6 @@ #include #include -#include namespace test_unique_ptr { diff --git a/tests/capnproto/test_variants_in_vectors.cpp b/tests/capnproto/test_variants_in_vectors.cpp index 48693a602..21cb8a597 100644 --- a/tests/capnproto/test_variants_in_vectors.cpp +++ b/tests/capnproto/test_variants_in_vectors.cpp @@ -7,7 +7,6 @@ #include #include -#include namespace test_variants_in_vectors { diff --git a/tests/cereal/test_literal.cpp b/tests/cereal/test_literal.cpp index 043a73a45..b67232fcd 100644 --- a/tests/cereal/test_literal.cpp +++ b/tests/cereal/test_literal.cpp @@ -4,7 +4,6 @@ #include "write_and_read.hpp" #include #include -#include namespace test_literal { diff --git a/tests/cereal/test_map2.cpp b/tests/cereal/test_map2.cpp index 2f72658f4..3bce72c34 100644 --- a/tests/cereal/test_map2.cpp +++ b/tests/cereal/test_map2.cpp @@ -7,7 +7,6 @@ #include #include -#include namespace test_map2 { diff --git a/tests/cereal/test_optionals_in_vectors.cpp b/tests/cereal/test_optionals_in_vectors.cpp index 2a13d2bb2..35d56d266 100644 --- a/tests/cereal/test_optionals_in_vectors.cpp +++ b/tests/cereal/test_optionals_in_vectors.cpp @@ -7,7 +7,6 @@ #include #include -#include namespace test_optionals_in_vectors { diff --git a/tests/cereal/test_rfl_tuple.cpp b/tests/cereal/test_rfl_tuple.cpp index 291980fe7..4bf6e0163 100644 --- a/tests/cereal/test_rfl_tuple.cpp +++ b/tests/cereal/test_rfl_tuple.cpp @@ -8,7 +8,6 @@ #include #include -#include namespace test_rfl_tuple { diff --git a/tests/cereal/test_shared_ptr.cpp b/tests/cereal/test_shared_ptr.cpp index 211e35641..0ceeea765 100644 --- a/tests/cereal/test_shared_ptr.cpp +++ b/tests/cereal/test_shared_ptr.cpp @@ -8,7 +8,6 @@ #include #include -#include namespace test_shared_ptr { diff --git a/tests/cereal/test_string_map.cpp b/tests/cereal/test_string_map.cpp index dfc68df1f..4a2be012e 100644 --- a/tests/cereal/test_string_map.cpp +++ b/tests/cereal/test_string_map.cpp @@ -5,7 +5,6 @@ #include "write_and_read.hpp" #include #include -#include namespace test_string_map { diff --git a/tests/cereal/test_variants_in_vectors.cpp b/tests/cereal/test_variants_in_vectors.cpp index c87eba4e5..ccff71231 100644 --- a/tests/cereal/test_variants_in_vectors.cpp +++ b/tests/cereal/test_variants_in_vectors.cpp @@ -7,7 +7,6 @@ #include #include -#include namespace test_variants_in_vectors { diff --git a/tests/generic/test_box_default_constructor.cpp b/tests/generic/test_box_default_constructor.cpp new file mode 100644 index 000000000..815823eb5 --- /dev/null +++ b/tests/generic/test_box_default_constructor.cpp @@ -0,0 +1,39 @@ +#include + +#include +#include + +// Keep standard headers before the generated module import. +// clang-format off +#include +// clang-format on + +namespace test_box_default_constructor { + +struct Recursive { + std::optional> next; + std::optional> shared; +}; + +struct NoDefault { + explicit NoDefault(int _value) : value(_value) {} + int value; +}; + +static_assert(std::is_default_constructible_v>); +static_assert(!std::is_default_constructible_v>); +static_assert(std::is_default_constructible_v>); +static_assert(!std::is_default_constructible_v>); + +TEST(generic, box_default_constructor) { + const rfl::Box recursive; + EXPECT_FALSE(recursive->next.has_value()); + const rfl::Box number; + EXPECT_EQ(*number, 0); + const auto value = rfl::make_box(42); + EXPECT_EQ(value->value, 42); + const rfl::Ref shared; + EXPECT_FALSE(shared->shared.has_value()); +} + +} // namespace test_box_default_constructor diff --git a/tests/yas/test_literal.cpp b/tests/yas/test_literal.cpp index f485a7430..a3ac54992 100644 --- a/tests/yas/test_literal.cpp +++ b/tests/yas/test_literal.cpp @@ -4,7 +4,6 @@ #include "write_and_read.hpp" #include #include -#include namespace test_literal { diff --git a/tests/yas/test_map2.cpp b/tests/yas/test_map2.cpp index 3cdbe1431..ba2e166bd 100644 --- a/tests/yas/test_map2.cpp +++ b/tests/yas/test_map2.cpp @@ -7,7 +7,6 @@ #include #include -#include namespace test_map2 { diff --git a/tests/yas/test_optionals_in_vectors.cpp b/tests/yas/test_optionals_in_vectors.cpp index 281b1e0c5..d609ba1d9 100644 --- a/tests/yas/test_optionals_in_vectors.cpp +++ b/tests/yas/test_optionals_in_vectors.cpp @@ -7,7 +7,6 @@ #include #include -#include namespace test_optionals_in_vectors { diff --git a/tests/yas/test_rfl_tuple.cpp b/tests/yas/test_rfl_tuple.cpp index 6d06cfa76..5f957cef0 100644 --- a/tests/yas/test_rfl_tuple.cpp +++ b/tests/yas/test_rfl_tuple.cpp @@ -8,7 +8,6 @@ #include #include -#include namespace test_rfl_tuple { diff --git a/tests/yas/test_shared_ptr.cpp b/tests/yas/test_shared_ptr.cpp index cf870570f..4b4f792a6 100644 --- a/tests/yas/test_shared_ptr.cpp +++ b/tests/yas/test_shared_ptr.cpp @@ -8,7 +8,6 @@ #include #include -#include namespace test_shared_ptr { diff --git a/tests/yas/test_string_map.cpp b/tests/yas/test_string_map.cpp index db4256568..946edb9f0 100644 --- a/tests/yas/test_string_map.cpp +++ b/tests/yas/test_string_map.cpp @@ -5,7 +5,6 @@ #include "write_and_read.hpp" #include #include -#include namespace test_string_map { diff --git a/tests/yas/test_variants_in_vectors.cpp b/tests/yas/test_variants_in_vectors.cpp index 7b29293e4..39222818f 100644 --- a/tests/yas/test_variants_in_vectors.cpp +++ b/tests/yas/test_variants_in_vectors.cpp @@ -7,7 +7,6 @@ #include #include -#include namespace test_variants_in_vectors { diff --git a/tests/yas/write_and_read.hpp b/tests/yas/write_and_read.hpp index 3ebd3521d..254c8cb80 100644 --- a/tests/yas/write_and_read.hpp +++ b/tests/yas/write_and_read.hpp @@ -4,7 +4,6 @@ #include #include -#include #include From ed28f09eabd4c23824982afe80655cd66f47098c Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Sun, 18 Oct 2026 10:24:02 +0800 Subject: [PATCH 10/18] Fix optional module consumers and benchmark PCH --- .github/workflows/macos.yaml | 2 - benchmarks/all/CMakeLists.txt | 5 +- benchmarks/json/CMakeLists.txt | 5 +- include/rfl/internal/get_field_names.hpp | 3 +- include/rfl/internal/xml_module_constants.hpp | 11 +++++ .../rfl/internal/yaml_module_constants.hpp | 10 ++++ include/rfl/msgpack/Buffers.hpp | 47 +++++++++++++++++++ include/rfl/msgpack/read.hpp | 15 ++---- include/rfl/msgpack/write.hpp | 11 ++--- include/rfl/xml/write.hpp | 2 +- include/rfl/yaml/Writer.hpp | 15 ++++-- modules/rfl.xml.cppm | 1 + modules/rfl.yaml.cppm | 1 + scripts/ci/README.md | 23 +++++++++ src/reflectcpp_msgpack.cpp | 1 + src/rfl/msgpack/Buffers.cpp | 31 ++++++++++++ src/rfl/yaml/Writer.cpp | 8 ++++ 17 files changed, 162 insertions(+), 29 deletions(-) create mode 100644 include/rfl/internal/xml_module_constants.hpp create mode 100644 include/rfl/internal/yaml_module_constants.hpp create mode 100644 include/rfl/msgpack/Buffers.hpp create mode 100644 src/rfl/msgpack/Buffers.cpp diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index 01d3b8577..9ab27ff05 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -32,12 +32,10 @@ jobs: - name: Run vcpkg uses: lukka/run-vcpkg@v11 - name: Set up Python for benchmark tooling - if: matrix.format == 'benchmarks' uses: actions/setup-python@v5 with: python-version: '3.12' - name: Use CMake 3.31.6 for the pinned benchmark port - if: matrix.format == 'benchmarks' shell: bash run: | python -m pip install cmake==3.31.6 diff --git a/benchmarks/all/CMakeLists.txt b/benchmarks/all/CMakeLists.txt index cbed30674..bc572d733 100644 --- a/benchmarks/all/CMakeLists.txt +++ b/benchmarks/all/CMakeLists.txt @@ -6,7 +6,10 @@ add_executable( reflect-cpp-all-format-benchmarks ${SOURCES} ) -target_precompile_headers(reflect-cpp-all-format-benchmarks PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-all-format-benchmarks PRIVATE ) +if(NOT REFLECTCPP_BUILD_MODULES) + target_precompile_headers(reflect-cpp-all-format-benchmarks PRIVATE [["rfl.hpp"]]) +endif() target_include_directories(reflect-cpp-all-format-benchmarks SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") target_include_directories(reflect-cpp-all-format-benchmarks SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/tinycbor") diff --git a/benchmarks/json/CMakeLists.txt b/benchmarks/json/CMakeLists.txt index 60dd74ddc..25c427233 100644 --- a/benchmarks/json/CMakeLists.txt +++ b/benchmarks/json/CMakeLists.txt @@ -6,7 +6,10 @@ add_executable( reflect-cpp-json-benchmarks ${SOURCES} ) -target_precompile_headers(reflect-cpp-json-benchmarks PRIVATE [["rfl.hpp"]] ) +target_precompile_headers(reflect-cpp-json-benchmarks PRIVATE ) +if(NOT REFLECTCPP_BUILD_MODULES) + target_precompile_headers(reflect-cpp-json-benchmarks PRIVATE [["rfl.hpp"]]) +endif() target_include_directories(reflect-cpp-json-benchmarks SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") diff --git a/include/rfl/internal/get_field_names.hpp b/include/rfl/internal/get_field_names.hpp index 683d5c756..6acad81b5 100644 --- a/include/rfl/internal/get_field_names.hpp +++ b/include/rfl/internal/get_field_names.hpp @@ -68,7 +68,8 @@ consteval auto get_field_name_str_view() { template consteval auto get_field_name_str_lit() { constexpr auto name = get_field_name_str_view(); - const auto to_str_lit = [&](std::index_sequence) { + const auto to_str_lit = [](std::index_sequence) { + constexpr auto name = get_field_name_str_view(); return StringLiteral{name[Ns]...}; }; return to_str_lit(std::make_index_sequence{}); diff --git a/include/rfl/internal/xml_module_constants.hpp b/include/rfl/internal/xml_module_constants.hpp new file mode 100644 index 000000000..73f798f60 --- /dev/null +++ b/include/rfl/internal/xml_module_constants.hpp @@ -0,0 +1,11 @@ +#pragma once + +// Give constants referenced by imported third-party declarations external +// linkage. Include only in the module interface, so there is exactly one +// definition. +#if defined(__GNUC__) && __GNUC__ == 15 && !defined(__clang__) +namespace pugi { +extern const unsigned int format_default; +extern const unsigned int parse_default; +} // namespace pugi +#endif diff --git a/include/rfl/internal/yaml_module_constants.hpp b/include/rfl/internal/yaml_module_constants.hpp new file mode 100644 index 000000000..c15eadf7f --- /dev/null +++ b/include/rfl/internal/yaml_module_constants.hpp @@ -0,0 +1,10 @@ +#pragma once + +// Give constants referenced by imported third-party declarations external +// linkage. Include only in the module interface, so there is exactly one +// definition. +#if defined(__GNUC__) && __GNUC__ == 15 && !defined(__clang__) +namespace YAML::ErrorMsg { +extern const char* const BAD_SUBSCRIPT; +} +#endif diff --git a/include/rfl/msgpack/Buffers.hpp b/include/rfl/msgpack/Buffers.hpp new file mode 100644 index 000000000..d68c6a1f1 --- /dev/null +++ b/include/rfl/msgpack/Buffers.hpp @@ -0,0 +1,47 @@ +#ifndef RFL_MSGPACK_BUFFERS_HPP_ +#define RFL_MSGPACK_BUFFERS_HPP_ + +#include + +#include +#include + +#include "../common.hpp" + +namespace rfl::msgpack::detail { + +// Keep MessagePack's static inline buffer functions in an implementation TU. +class RFL_API PackedBuffer { + public: + PackedBuffer(); + ~PackedBuffer(); + PackedBuffer(const PackedBuffer&) = delete; + PackedBuffer& operator=(const PackedBuffer&) = delete; + + msgpack_packer* packer(); + std::vector bytes() const; + + private: + msgpack_sbuffer buffer_; + msgpack_packer packer_; +}; + +class RFL_API UnpackedBuffer { + public: + UnpackedBuffer(const char* _bytes, std::size_t _size); + ~UnpackedBuffer(); + UnpackedBuffer(const UnpackedBuffer&) = delete; + UnpackedBuffer& operator=(const UnpackedBuffer&) = delete; + + bool valid() const; + const msgpack_object& object() const; + + private: + msgpack_zone zone_; + msgpack_object object_; + bool valid_; +}; + +} // namespace rfl::msgpack::detail + +#endif diff --git a/include/rfl/msgpack/read.hpp b/include/rfl/msgpack/read.hpp index af51e2bc5..3e30fa378 100644 --- a/include/rfl/msgpack/read.hpp +++ b/include/rfl/msgpack/read.hpp @@ -9,6 +9,7 @@ #include "../concepts.hpp" #include "../internal/ptr_cast.hpp" #include "../internal/wrap_in_rfl_array_t.hpp" +#include "Buffers.hpp" #include "Parser.hpp" #include "Reader.hpp" @@ -41,20 +42,12 @@ auto read(const InputVarType& _obj) { template Result> read( const concepts::ByteLike auto* _bytes, const size_t _size) { - msgpack_zone mempool; - msgpack_zone_init(&mempool, 2048); - msgpack_object deserialized; - const auto rc = msgpack_unpack( - internal::ptr_cast(_bytes), _size, NULL, &mempool, - &deserialized); - if (rc != MSGPACK_UNPACK_SUCCESS && rc != MSGPACK_UNPACK_EXTRA_BYTES) { - msgpack_zone_destroy(&mempool); + detail::UnpackedBuffer buffer(internal::ptr_cast(_bytes), _size); + if (!buffer.valid()) { return Result>( error("Failed to unpack msgpack data.")); } - auto r = read(deserialized); - msgpack_zone_destroy(&mempool); - return r; + return read(buffer.object()); } /// Parses an object from MSGPACK using reflection (contiguous container version). diff --git a/include/rfl/msgpack/write.hpp b/include/rfl/msgpack/write.hpp index bf036ee16..255c9c008 100644 --- a/include/rfl/msgpack/write.hpp +++ b/include/rfl/msgpack/write.hpp @@ -8,6 +8,7 @@ #include "../Processors.hpp" #include "../Result.hpp" #include "../parsing/Parent.hpp" +#include "Buffers.hpp" #include "Parser.hpp" namespace rfl::msgpack { @@ -22,20 +23,16 @@ template std::vector write(const auto& _obj) { using T = std::remove_cvref_t; using ParentType = parsing::Parent; - msgpack_sbuffer sbuf; - msgpack_sbuffer_init(&sbuf); - msgpack_packer pk; - msgpack_packer_init(&pk, &sbuf, msgpack_sbuffer_write); - auto w = Writer(&pk); + detail::PackedBuffer buffer; + auto w = Writer(buffer.packer()); const auto bytes = [&]() -> Result> { try { Parser>::write(w, _obj, typename ParentType::Root{}); - return std::vector(sbuf.data, sbuf.data + sbuf.size); + return buffer.bytes(); } catch (const std::exception& e) { return error(e.what()); } }(); - msgpack_sbuffer_destroy(&sbuf); return bytes.value(); } diff --git a/include/rfl/xml/write.hpp b/include/rfl/xml/write.hpp index c71d937a6..cc075648b 100644 --- a/include/rfl/xml/write.hpp +++ b/include/rfl/xml/write.hpp @@ -25,7 +25,7 @@ namespace xml { /// @return The root element name to use template consteval auto get_root_name() { - if constexpr (_root != internal::StringLiteral("")) { + if constexpr (_root.length != 0) { return _root; } else { return internal::remove_namespaces< diff --git a/include/rfl/yaml/Writer.hpp b/include/rfl/yaml/Writer.hpp index 04412791f..94c0ff607 100644 --- a/include/rfl/yaml/Writer.hpp +++ b/include/rfl/yaml/Writer.hpp @@ -202,12 +202,12 @@ class RFL_API Writer { std::remove_cvref_t>()) { (*out_) << YAML::Key << std::string(_name) << YAML::Value; insert_literal_block_if_needed(_var); - (*out_) << _var; + write_scalar(_var); } else if constexpr (std::is_floating_point>()) { // std::to_string is necessary to ensure that floating point values are // always written as floats. - (*out_) << YAML::Key << std::string(_name) << YAML::Value - << std::to_string(_var); + (*out_) << YAML::Key << std::string(_name) << YAML::Value; + write_scalar(std::to_string(_var)); } else if constexpr (std::is_integral>()) { (*out_) << YAML::Key << std::string(_name) << YAML::Value << static_cast(_var); @@ -228,11 +228,11 @@ class RFL_API Writer { std::is_same, std::remove_cvref_t>()) { insert_literal_block_if_needed(_var); - (*out_) << _var; + write_scalar(_var); } else if constexpr (std::is_floating_point>()) { // std::to_string is necessary to ensure that floating point values are // always written as floats. - (*out_) << std::to_string(_var); + write_scalar(std::to_string(_var)); } else if constexpr (std::is_integral>()) { (*out_) << static_cast(_var); } else { @@ -263,6 +263,11 @@ class RFL_API Writer { /// @return OutputObjectType representing the new object. OutputObjectType new_object() const; + private: + void write_scalar(const std::string& _value) const; + void write_scalar(bool _value) const; + void write_scalar(std::remove_cvref_t _value) const; + public: /// @brief Reference to the YAML emitter used for output. const Ref out_; diff --git a/modules/rfl.xml.cppm b/modules/rfl.xml.cppm index 4a859d7c1..58d392f53 100644 --- a/modules/rfl.xml.cppm +++ b/modules/rfl.xml.cppm @@ -1,5 +1,6 @@ module; +#include "rfl/internal/xml_module_constants.hpp" #include "rfl/xml.hpp" export module rfl.xml; diff --git a/modules/rfl.yaml.cppm b/modules/rfl.yaml.cppm index fefdef8f7..9ce803667 100644 --- a/modules/rfl.yaml.cppm +++ b/modules/rfl.yaml.cppm @@ -1,5 +1,6 @@ module; +#include "rfl/internal/yaml_module_constants.hpp" #include "rfl/yaml.hpp" export module rfl.yaml; diff --git a/scripts/ci/README.md b/scripts/ci/README.md index e44497cd1..0bb83a05d 100644 --- a/scripts/ci/README.md +++ b/scripts/ci/README.md @@ -91,6 +91,29 @@ With PCH enabled, GCC 15.2 (Ubuntu 24.04, C++20), GCC 15.3 (C++20 and C++23), and GCC 16.2.1 (C++20) passed the full JSON/CLI module suite: 342 tests passed and one locale test was skipped. +GCC 15.2 also passed the MessagePack, XML (pugixml 1.15), and YAML module +suites in C++20 and C++23. Their combined shared-library header build passed +200 tests, with one locale test skipped. Clang 19 passed the Parquet module +suite with Arrow 21.0.0 (61 tests passed, one locale test skipped). + +Benchmark PCH contains standard headers in module mode. `rfl.hpp` stays in +the PCH only in header mode, because CMake does not scan the PCH itself for +module imports. JSON benchmarks compiled and the reflect-cpp person benchmark +ran with PCH enabled on both GCC 15 and Clang 19. + +The compiler minimum does not imply that every optional dependency works as a +module. With the pinned dependency versions, GCC 16.2.1 still fails the +Cap'n Proto 1.2.0 and Cereal 1.3.2 module interfaces because of TU-local types. +CBOR/UBJSON with jsoncons 1.4.0 fail when imported templates cannot find +`make_error_code` through ADL. Parquet with Arrow 21.0.0 reaches the importer +tests, but GCC diagnoses an out-of-bounds access while inlining Arrow builder +virtual functions; the tests use `-Werror`. These failures were reproduced in +both C++20 and C++23 with PCH enabled, so upgrading from GCC 15 to GCC 16 alone +does not make the complete module matrix pass. +For diagnosis, a separate GCC 16.2.1 C++20 Parquet run added only +`-fno-devirtualize-speculatively`, retained `-Werror`, and passed 61 tests +(one locale test skipped). This optimization flag is not enabled by the project. + Sources: [CMake 3.31](https://cmake.org/cmake/help/v3.31/manual/cmake-cxxmodules.7.html), [GCC 14](https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/C_002b_002b-Modules.html), [Clang status](https://clang.llvm.org/cxx_status.html). diff --git a/src/reflectcpp_msgpack.cpp b/src/reflectcpp_msgpack.cpp index 235062e33..672884ab0 100644 --- a/src/reflectcpp_msgpack.cpp +++ b/src/reflectcpp_msgpack.cpp @@ -29,4 +29,5 @@ SOFTWARE. // Also, this speeds up compile time, compared to multiple separate .cpp files // compilation. +#include "rfl/msgpack/Buffers.cpp" #include "rfl/msgpack/Writer.cpp" diff --git a/src/rfl/msgpack/Buffers.cpp b/src/rfl/msgpack/Buffers.cpp new file mode 100644 index 000000000..2cb222a5f --- /dev/null +++ b/src/rfl/msgpack/Buffers.cpp @@ -0,0 +1,31 @@ +#include "rfl/msgpack/Buffers.hpp" + +namespace rfl::msgpack::detail { + +PackedBuffer::PackedBuffer() { + msgpack_sbuffer_init(&buffer_); + msgpack_packer_init(&packer_, &buffer_, msgpack_sbuffer_write); +} + +PackedBuffer::~PackedBuffer() { msgpack_sbuffer_destroy(&buffer_); } + +msgpack_packer* PackedBuffer::packer() { return &packer_; } + +std::vector PackedBuffer::bytes() const { + return std::vector(buffer_.data, buffer_.data + buffer_.size); +} + +UnpackedBuffer::UnpackedBuffer(const char* _bytes, std::size_t _size) { + msgpack_zone_init(&zone_, 2048); + const auto result = msgpack_unpack(_bytes, _size, nullptr, &zone_, &object_); + valid_ = + result == MSGPACK_UNPACK_SUCCESS || result == MSGPACK_UNPACK_EXTRA_BYTES; +} + +UnpackedBuffer::~UnpackedBuffer() { msgpack_zone_destroy(&zone_); } + +bool UnpackedBuffer::valid() const { return valid_; } + +const msgpack_object& UnpackedBuffer::object() const { return object_; } + +} // namespace rfl::msgpack::detail diff --git a/src/rfl/yaml/Writer.cpp b/src/rfl/yaml/Writer.cpp index a0d3b8c4c..4eb2c4e23 100644 --- a/src/rfl/yaml/Writer.cpp +++ b/src/rfl/yaml/Writer.cpp @@ -93,4 +93,12 @@ Writer::OutputObjectType Writer::new_object() const { return OutputObjectType{}; } +void Writer::write_scalar(const std::string& _value) const { (*out_) << _value; } + +void Writer::write_scalar(bool _value) const { (*out_) << _value; } + +void Writer::write_scalar(std::remove_cvref_t _value) const { + (*out_) << _value; +} + } // namespace rfl::yaml From d1d289292094a1d54b135a9e362d41c1aece7cf4 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Sun, 18 Oct 2026 10:53:43 +0800 Subject: [PATCH 11/18] Isolate binary format dependencies from module templates --- CMakeLists.txt | 12 +- docs/install.md | 2 +- include/rfl/cbor/Buffers.hpp | 33 +++ include/rfl/cbor/Reader.hpp | 131 +++++------- include/rfl/cbor/Writer.hpp | 26 ++- include/rfl/cbor/read.hpp | 18 +- include/rfl/cbor/write.hpp | 11 +- include/rfl/cereal/Archive.hpp | 141 +++++++++++++ include/rfl/cereal/Reader.hpp | 25 +-- include/rfl/cereal/Writer.hpp | 16 +- include/rfl/cereal/read.hpp | 11 +- include/rfl/cereal/write.hpp | 8 +- include/rfl/internal/jsoncons_module_fwd.hpp | 30 +++ include/rfl/parsing/tabular/ArrowTypes.hpp | 13 +- .../tabular/arrow_builder_operations.hpp | 17 ++ include/rfl/ubjson/Buffers.hpp | 33 +++ include/rfl/ubjson/Reader.hpp | 130 +++++------- include/rfl/ubjson/Writer.hpp | 23 ++- include/rfl/ubjson/read.hpp | 18 +- include/rfl/ubjson/write.hpp | 11 +- modules/rfl.cbor.cppm | 2 + modules/rfl.cereal.cppm | 2 + modules/rfl.ubjson.cppm | 2 + scripts/ci/README.md | 43 ++-- src/reflectcpp_arrow.cpp | 11 + src/reflectcpp_cbor.cpp | 2 + src/reflectcpp_cereal.cpp | 1 + src/reflectcpp_ubjson.cpp | 2 + src/rfl/cbor/Buffers.cpp | 38 ++++ src/rfl/cbor/Reader.cpp | 96 +++++++++ src/rfl/cbor/Writer.cpp | 19 ++ src/rfl/cereal/Archive.cpp | 195 ++++++++++++++++++ src/rfl/ubjson/Buffers.cpp | 38 ++++ src/rfl/ubjson/Reader.cpp | 92 +++++++++ src/rfl/ubjson/Writer.cpp | 17 ++ tests/cbor/test_stream_bridge.cpp | 32 +++ tests/cereal/archive_reference.cpp | 41 ++++ tests/cereal/archive_reference.hpp | 32 +++ .../cereal/test_archive_interoperability.cpp | 39 ++++ tests/ubjson/test_stream_bridge.cpp | 32 +++ 40 files changed, 1188 insertions(+), 257 deletions(-) create mode 100644 include/rfl/cbor/Buffers.hpp create mode 100644 include/rfl/cereal/Archive.hpp create mode 100644 include/rfl/internal/jsoncons_module_fwd.hpp create mode 100644 include/rfl/parsing/tabular/arrow_builder_operations.hpp create mode 100644 include/rfl/ubjson/Buffers.hpp create mode 100644 src/reflectcpp_arrow.cpp create mode 100644 src/rfl/cbor/Buffers.cpp create mode 100644 src/rfl/cbor/Reader.cpp create mode 100644 src/rfl/cereal/Archive.cpp create mode 100644 src/rfl/ubjson/Buffers.cpp create mode 100644 src/rfl/ubjson/Reader.cpp create mode 100644 tests/cbor/test_stream_bridge.cpp create mode 100644 tests/cereal/archive_reference.cpp create mode 100644 tests/cereal/archive_reference.hpp create mode 100644 tests/cereal/test_archive_interoperability.cpp create mode 100644 tests/ubjson/test_stream_bridge.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index d3a85624a..96e3cc990 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -381,10 +381,10 @@ if (REFLECTCPP_CBOR OR REFLECTCPP_CHECK_HEADERS) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_cbor.cpp ) - if (NOT TARGET jsoncons) + if (NOT TARGET jsoncons::jsoncons AND NOT TARGET jsoncons) find_package(jsoncons CONFIG REQUIRED) endif() - include_directories(PUBLIC ${jsoncons_INCLUDE_DIRS}) + target_link_libraries(reflectcpp PUBLIC $,jsoncons::jsoncons,jsoncons>) endif () if (REFLECTCPP_CEREAL OR REFLECTCPP_CHECK_HEADERS) @@ -398,6 +398,10 @@ if (REFLECTCPP_CEREAL OR REFLECTCPP_CHECK_HEADERS) target_link_libraries(reflectcpp PUBLIC cereal::cereal) endif() +if (REFLECTCPP_CSV OR REFLECTCPP_PARQUET OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_arrow.cpp) +endif () + if (REFLECTCPP_CSV OR REFLECTCPP_CHECK_HEADERS) list(APPEND REFLECT_CPP_MODULES modules/rfl.csv.cppm) if (NOT TARGET Arrow) @@ -464,10 +468,10 @@ if (REFLECTCPP_UBJSON OR REFLECTCPP_CHECK_HEADERS) list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_ubjson.cpp ) - if (NOT TARGET jsoncons) + if (NOT TARGET jsoncons::jsoncons AND NOT TARGET jsoncons) find_package(jsoncons CONFIG REQUIRED) endif() - include_directories(PUBLIC ${jsoncons_INCLUDE_DIRS}) + target_link_libraries(reflectcpp PUBLIC $,jsoncons::jsoncons,jsoncons>) endif () if (REFLECTCPP_XML OR REFLECTCPP_CHECK_HEADERS) diff --git a/docs/install.md b/docs/install.md index cb1af5a09..336928955 100644 --- a/docs/install.md +++ b/docs/install.md @@ -51,7 +51,7 @@ cmake --build build --config Release -j 4 # MSVC Simply copy the contents of the folders `include` and `src` into your source repository or add it to your include path and also add `src/reflectcpp.cpp` and `src/reflectcpp_json.cpp` and `src/yyjson.c` to your source files for compilation. If you want to link to your own version of YYJSON, then only add `src/reflectcpp.cpp` and `src/reflectcpp_json.cpp`. If you don't need JSON support, then only add `src/reflectcpp.cpp`. -If you need support for other serialization formats like flexbuffers or XML, you should also add `src/reflectcpp_.cpp` and include and link the respective libraries, as listed in the section on serialization formats. +If you need support for other serialization formats like flexbuffers or XML, you should also add `src/reflectcpp_.cpp` and include and link the respective libraries, as listed in the section on serialization formats. For CSV or Parquet, add `src/reflectcpp_arrow.cpp` once; both formats share these Arrow builder operations. ## Option 5: Compilation using cmake and vcpkg diff --git a/include/rfl/cbor/Buffers.hpp b/include/rfl/cbor/Buffers.hpp new file mode 100644 index 000000000..938b020af --- /dev/null +++ b/include/rfl/cbor/Buffers.hpp @@ -0,0 +1,33 @@ +#ifndef RFL_CBOR_BUFFERS_HPP_ +#define RFL_CBOR_BUFFERS_HPP_ + +#include +#include +#include + +#include "../Result.hpp" +#include "../common.hpp" +#include "Reader.hpp" +#include "Writer.hpp" + +namespace rfl::cbor::detail { +RFL_API Result> decode(const char* _bytes, + size_t _size); +RFL_API Result> decode(std::istream& _stream); + +class RFL_API EncodedBuffer { + public: + EncodedBuffer(); + ~EncodedBuffer(); + EncodedBuffer(const EncodedBuffer&) = delete; + EncodedBuffer& operator=(const EncodedBuffer&) = delete; + jsoncons::cbor::cbor_bytes_encoder* encoder() const; + std::vector bytes() const; + + private: + struct Impl; + Impl* impl_; +}; +} // namespace rfl::cbor::detail + +#endif diff --git a/include/rfl/cbor/Reader.hpp b/include/rfl/cbor/Reader.hpp index f7f705af0..803383a0f 100644 --- a/include/rfl/cbor/Reader.hpp +++ b/include/rfl/cbor/Reader.hpp @@ -2,8 +2,14 @@ #define RFL_CBOR_READER_HPP_ #include +#include #include +#include +#ifdef RFL_JSONCONS_MODULE_INTERFACE +#include "../internal/jsoncons_module_fwd.hpp" +#else #include +#endif #include #include #include @@ -12,6 +18,7 @@ #include "../Result.hpp" #include "../Vectorstring.hpp" #include "../always_false.hpp" +#include "../common.hpp" #include "../internal/ptr_cast.hpp" namespace rfl::cbor { @@ -20,7 +27,7 @@ namespace rfl::cbor { /// This class provides the interface for parsing CBOR format into C++ objects. /// CBOR is a binary data serialization format that is more compact than JSON while /// maintaining similar data model capabilities. -class Reader { +class RFL_API Reader { public: /// Represents a CBOR array during deserialization. /// Wraps a pointer to the underlying jsoncons JSON value representing the array. @@ -61,33 +68,19 @@ class Reader { /// @param _arr The CBOR array to read from /// @return Result containing the field value, or an error if index is out of bounds rfl::Result get_field_from_array( - const size_t _idx, const InputArrayType& _arr) const noexcept { - if (_idx >= _arr.val_->size()) { - return error("Index out of range."); - } - return InputVarType{&_arr.val_->at(_idx)}; - } + const size_t _idx, const InputArrayType& _arr) const noexcept; /// Retrieves a field from a CBOR object by name. /// @param _name The name of the field to retrieve /// @param _obj The CBOR object to read from /// @return Result containing the field value, or an error if field is not found rfl::Result get_field_from_object( - const std::string& _name, const InputObjectType& _obj) const noexcept { - for (auto& kv : _obj.val_->object_range()) { - if (kv.key() == _name) { - return InputVarType{&kv.value()}; - }; - } - return error("Field name '" + _name + "' not found."); - } + const std::string& _name, const InputObjectType& _obj) const noexcept; /// Checks if a CBOR value is empty or null. /// @param _var The CBOR value to check /// @return true if the value is null, false otherwise - bool is_empty(const InputVarType& _var) const noexcept { - return _var.val_->is_null(); - } + bool is_empty(const InputVarType& _var) const noexcept; /// Converts a CBOR value to a basic C++ type. /// Supports strings, bytesstrings, booleans, floating-point numbers, and integers. @@ -96,51 +89,26 @@ class Reader { /// @return Result containing the converted value, or an error if conversion fails template rfl::Result to_basic_type(const InputVarType& _var) const noexcept { - if constexpr (std::is_same, std::string>()) { - if (!_var.val_->is_string()) { - return error("Could not cast to string."); - } - return _var.val_->as(); - - } else if constexpr (std::is_same, - rfl::Bytestring>() || - std::is_same, - rfl::Vectorstring>()) { - using VectorType = std::remove_cvref_t; - using ValueType = typename VectorType::value_type; - if (!_var.val_->is_byte_string()) { - if constexpr (std::is_same, - rfl::Bytestring>()) { - return error("Could not cast to bytestring."); - } else { - return error("Could not cast to vectorstring."); - } - } - const auto vec = _var.val_->as>(); - const auto data = internal::ptr_cast(vec.data()); - return VectorType(data, data + vec.size()); - - } else if constexpr (std::is_same, bool>()) { - if (!_var.val_->is_bool()) { - return error("Could not cast to boolean."); - } - return _var.val_->as(); - - } else if constexpr (std::is_floating_point>()) { - if (_var.val_->is_double()) { - return static_cast(_var.val_->as()); - } - return error("Could not cast to double."); - - } else if constexpr (std::is_integral>()) { - if (_var.val_->is_int64()) { - return static_cast(_var.val_->as()); - } - if (_var.val_->is_uint64()) { - return static_cast(_var.val_->as()); - } + using Type = std::remove_cvref_t; + if constexpr (std::is_same_v) { + return read_string(_var); + } else if constexpr (std::is_same_v || + std::is_same_v) { + return read_bytes(_var, std::is_same_v) + .transform([](const auto& bytes) { + using Value = typename Type::value_type; + const auto begin = internal::ptr_cast(bytes.data()); + return Type(begin, begin + bytes.size()); + }); + } else if constexpr (std::is_same_v) { + return read_bool(_var); + } else if constexpr (std::is_floating_point_v) { + return read_double(_var).transform( + [](double value) { return static_cast(value); }); + } else if constexpr (std::is_integral_v) { + if (is_int64(_var)) return static_cast(read_int64(_var)); + if (is_uint64(_var)) return static_cast(read_uint64(_var)); return error("Could not cast to integer."); - } else { static_assert(rfl::always_false_v, "Unsupported type."); } @@ -149,24 +117,13 @@ class Reader { /// Converts a CBOR value to an array. /// @param _var The CBOR value to convert /// @return Result containing the array, or an error if value is not an array - rfl::Result to_array( - const InputVarType& _var) const noexcept { - if (!_var.val_->is_array()) { - return error("Could not cast to an array."); - } - return InputArrayType{_var.val_}; - } + rfl::Result to_array(const InputVarType& _var) const noexcept; /// Converts a CBOR value to an object. /// @param _var The CBOR value to convert /// @return Result containing the object, or an error if value is not an object rfl::Result to_object( - const InputVarType& _var) const noexcept { - if (!_var.val_->is_object()) { - return error("Could not cast to an object."); - } - return InputObjectType{_var.val_}; - } + const InputVarType& _var) const noexcept; /// Reads all elements from a CBOR array using a provided array reader. /// The array reader's read() method is called for each element in the array. @@ -177,8 +134,8 @@ class Reader { template std::optional read_array(const ArrayReader& _array_reader, const InputArrayType& _arr) const noexcept { - for (auto& val : _arr.val_->array_range()) { - const auto err = _array_reader.read(InputVarType{&val}); + for (size_t i = 0; i < size(_arr.val_); ++i) { + const auto err = _array_reader.read(InputVarType{array_at(_arr.val_, i)}); if (err) { return err; } @@ -195,8 +152,9 @@ class Reader { template std::optional read_object(const ObjectReader& _object_reader, const InputObjectType& _obj) const noexcept { - for (auto& kv : _obj.val_->object_range()) { - _object_reader.read(kv.key(), InputVarType{&kv.value()}); + for (size_t i = 0; i < size(_obj.val_); ++i) { + _object_reader.read(object_key(_obj.val_, i), + InputVarType{object_value(_obj.val_, i)}); } return std::nullopt; } @@ -215,6 +173,21 @@ class Reader { return error(e.what()); } } + + private: + Result read_string(const InputVarType& _var) const; + Result> read_bytes(const InputVarType& _var, + bool _vectorstring) const; + Result read_bool(const InputVarType& _var) const; + Result read_double(const InputVarType& _var) const; + bool is_int64(const InputVarType& _var) const; + bool is_uint64(const InputVarType& _var) const; + int64_t read_int64(const InputVarType& _var) const; + uint64_t read_uint64(const InputVarType& _var) const; + size_t size(jsoncons::json* _value) const; + jsoncons::json* array_at(jsoncons::json* _value, size_t _index) const; + std::string_view object_key(jsoncons::json* _value, size_t _index) const; + jsoncons::json* object_value(jsoncons::json* _value, size_t _index) const; }; } // namespace rfl::cbor diff --git a/include/rfl/cbor/Writer.hpp b/include/rfl/cbor/Writer.hpp index a934497e8..38a56f632 100644 --- a/include/rfl/cbor/Writer.hpp +++ b/include/rfl/cbor/Writer.hpp @@ -1,7 +1,11 @@ #ifndef RFL_CBOR_WRITER_HPP_ #define RFL_CBOR_WRITER_HPP_ +#ifdef RFL_JSONCONS_MODULE_INTERFACE +#include "../internal/jsoncons_module_fwd.hpp" +#else #include +#endif #include #include #include @@ -122,7 +126,7 @@ class RFL_API Writer { OutputVarType add_value_to_object(const std::string_view& _name, const T& _var, OutputObjectType* /*_parent*/) const { - encoder_->key(_name); + write_key(_name); return new_value(_var); } @@ -151,23 +155,31 @@ class RFL_API Writer { OutputObjectType new_object() const; + void write_key(std::string_view _key) const; + void write_string(const std::string& _value) const; + void write_bytes(const void* _data, size_t _size) const; + void write_bool(bool _value) const; + void write_double(double _value) const; + void write_uint64(uint64_t _value) const; + void write_int64(int64_t _value) const; + template OutputVarType new_value(const T& _var) const { if constexpr (std::is_same, std::string>()) { - encoder_->string_value(_var); + write_string(_var); } else if constexpr (std::is_same, rfl::Bytestring>() || std::is_same, rfl::Vectorstring>()) { - encoder_->byte_string_value(_var); + write_bytes(_var.data(), _var.size()); } else if constexpr (std::is_same, bool>()) { - encoder_->bool_value(_var); + write_bool(_var); } else if constexpr (std::is_floating_point>()) { - encoder_->double_value(static_cast(_var)); + write_double(static_cast(_var)); } else if constexpr (std::is_unsigned>()) { - encoder_->uint64_value(static_cast(_var)); + write_uint64(static_cast(_var)); } else if constexpr (std::is_integral>()) { - encoder_->int64_value(static_cast(_var)); + write_int64(static_cast(_var)); } else { static_assert(rfl::always_false_v, "Unsupported type."); } diff --git a/include/rfl/cbor/read.hpp b/include/rfl/cbor/read.hpp index c60fdbeb9..b04cdd269 100644 --- a/include/rfl/cbor/read.hpp +++ b/include/rfl/cbor/read.hpp @@ -2,13 +2,12 @@ #define RFL_CBOR_READ_HPP_ #include -#include -#include #include #include "../Processors.hpp" #include "../concepts.hpp" #include "../internal/wrap_in_rfl_array_t.hpp" +#include "Buffers.hpp" #include "Parser.hpp" #include "Reader.hpp" @@ -27,12 +26,14 @@ using InputVarType = typename Reader::InputVarType; template Result> read( const concepts::ContiguousByteContainer auto& _bytes) { - auto result = jsoncons::cbor::try_decode_cbor(_bytes); + auto result = detail::decode(reinterpret_cast(_bytes.data()), + _bytes.size()); if (result.has_value()) { auto r = Reader(); - return Parser>::read(r, InputVarType{&result.value()}); + return Parser>::read( + r, InputVarType{result.value().get()}); } else { - return rfl::error("Could not parse CBOR: " + result.error().message()); + return rfl::error(result.error().what()); } } @@ -44,12 +45,13 @@ Result> read( /// @return Result containing either the parsed object (or array of objects) or an error message template Result> read(std::istream& _stream) { - auto result = jsoncons::cbor::try_decode_cbor(_stream); + auto result = detail::decode(_stream); if (result.has_value()) { auto r = Reader(); - return Parser>::read(r, InputVarType{&result.value()}); + return Parser>::read( + r, InputVarType{result.value().get()}); } else { - return rfl::error("Could not parse CBOR: " + result.error().message()); + return rfl::error(result.error().what()); } } diff --git a/include/rfl/cbor/write.hpp b/include/rfl/cbor/write.hpp index 97cecb29e..fa61c603d 100644 --- a/include/rfl/cbor/write.hpp +++ b/include/rfl/cbor/write.hpp @@ -2,11 +2,11 @@ #define RFL_CBOR_WRITE_HPP_ #include -#include #include #include "../internal/ptr_cast.hpp" #include "../parsing/Parent.hpp" +#include "Buffers.hpp" #include "Parser.hpp" namespace rfl::cbor { @@ -21,14 +21,11 @@ template std::vector write(const auto& _obj) { using T = std::remove_cvref_t; using ParentType = parsing::Parent; - std::vector buffer; - jsoncons::cbor::cbor_bytes_encoder encoder(buffer); - const auto writer = Writer(&encoder); + detail::EncodedBuffer buffer; + const auto writer = Writer(buffer.encoder()); Parser>::write(writer, _obj, typename ParentType::Root{}); - return std::vector( - internal::ptr_cast(buffer.data()), - internal::ptr_cast(buffer.data() + buffer.size())); + return buffer.bytes(); } /// Writes a CBOR representation into an ostream. diff --git a/include/rfl/cereal/Archive.hpp b/include/rfl/cereal/Archive.hpp new file mode 100644 index 000000000..07617570a --- /dev/null +++ b/include/rfl/cereal/Archive.hpp @@ -0,0 +1,141 @@ +#ifndef RFL_CEREAL_ARCHIVE_HPP_ +#define RFL_CEREAL_ARCHIVE_HPP_ + +#ifndef RFL_CEREAL_MODULE_INTERFACE +#include +#include +#endif + +#include +#include +#include + +#include "../common.hpp" + +namespace cereal { +class PortableBinaryInputArchive; +class PortableBinaryOutputArchive; +} // namespace cereal + +namespace rfl::cereal::detail { + +// Archive implementation stays in an ordinary translation unit. Imported +// templates only need the archive pointers and these non-template operations. +class RFL_API InputArchive { + public: + explicit InputArchive(std::istream& _stream); + ~InputArchive(); + InputArchive(const InputArchive&) = delete; + InputArchive& operator=(const InputArchive&) = delete; + + ::cereal::PortableBinaryInputArchive& get() const; + + private: + ::cereal::PortableBinaryInputArchive* archive_; +}; + +class RFL_API OutputArchive { + public: + explicit OutputArchive(std::ostream& _stream); + ~OutputArchive(); + OutputArchive(const OutputArchive&) = delete; + OutputArchive& operator=(const OutputArchive&) = delete; + + ::cereal::PortableBinaryOutputArchive& get() const; + + private: + ::cereal::PortableBinaryOutputArchive* archive_; +}; + +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + bool& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const bool& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + char& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const char& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + signed char& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const signed char& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + unsigned char& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const unsigned char& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + short& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const short& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + unsigned short& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const unsigned short& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + int& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const int& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + unsigned int& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const unsigned int& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + long& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const long& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + unsigned long& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const unsigned long& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + long long& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const long long& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + unsigned long long& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const unsigned long long& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + float& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const float& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + double& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const double& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + long double& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const long double& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + wchar_t& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const wchar_t& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + char8_t& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const char8_t& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + char16_t& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const char16_t& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + char32_t& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const char32_t& _value); +RFL_API void read_value(::cereal::PortableBinaryInputArchive* _archive, + std::string& _value); +RFL_API void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const std::string& _value); + +RFL_API std::size_t read_size(::cereal::PortableBinaryInputArchive* _archive); +RFL_API void write_size(::cereal::PortableBinaryOutputArchive* _archive, + std::size_t _size); +RFL_API void read_bytes(::cereal::PortableBinaryInputArchive* _archive, + void* _data, std::size_t _size); +RFL_API void write_bytes(::cereal::PortableBinaryOutputArchive* _archive, + const void* _data, std::size_t _size); + +} // namespace rfl::cereal::detail + +#endif diff --git a/include/rfl/cereal/Reader.hpp b/include/rfl/cereal/Reader.hpp index 85d1ab09d..9305c21a2 100644 --- a/include/rfl/cereal/Reader.hpp +++ b/include/rfl/cereal/Reader.hpp @@ -1,9 +1,6 @@ #ifndef RFL_CEREAL_READER_HPP_ #define RFL_CEREAL_READER_HPP_ -#include -#include -#include #include #include #include @@ -15,13 +12,14 @@ #include "../always_false.hpp" #include "../internal/is_literal.hpp" #include "../parsing/schemaful/IsSchemafulReader.hpp" +#include "Archive.hpp" namespace rfl::cereal { /// Reader for Cereal serialization library integration. /// Cereal is a C++11 serialization library that supports multiple archive formats. /// This reader uses Cereal's portable binary archive format for cross-platform compatibility. -struct Reader { +struct RFL_API Reader { using CerealArchive = ::cereal::PortableBinaryInputArchive; struct CerealInputVar { @@ -67,22 +65,21 @@ struct Reader { try { if constexpr (internal::is_literal_v) { std::string str; - (*_var.archive_)(str); + detail::read_value(_var.archive_, str); return std::remove_cvref_t::from_string(str); } else if constexpr (std::is_same, rfl::Bytestring>() || std::is_same, rfl::Vectorstring>()) { - size_t size; - (*_var.archive_)(::cereal::make_size_tag(size)); + const auto size = detail::read_size(_var.archive_); std::remove_cvref_t result(size); - (*_var.archive_)(::cereal::binary_data(result.data(), size)); + detail::read_bytes(_var.archive_, result.data(), size); return result; } else { T value; - (*_var.archive_)(value); + detail::read_value(_var.archive_, value); return value; } } catch (std::exception& e) { @@ -124,8 +121,7 @@ struct Reader { std::optional read_array(const ArrayReader& _array_reader, const InputArrayType& _arr) const noexcept { try { - size_t size; - (*_arr.archive_)(::cereal::make_size_tag(size)); + const auto size = detail::read_size(_arr.archive_); for (size_t i = 0; i < size; ++i) { const auto err = _array_reader.read(InputVarType{_arr.archive_}); if (err) { @@ -148,11 +144,10 @@ struct Reader { std::optional read_map(const MapReader& _map_reader, const InputMapType& _map) const noexcept { try { - size_t size; - (*_map.archive_)(::cereal::make_size_tag(size)); + const auto size = detail::read_size(_map.archive_); for (size_t i = 0; i < size; ++i) { std::string key; - (*_map.archive_)(key); + detail::read_value(_map.archive_, key); _map_reader.read(std::string_view(key), InputVarType{_map.archive_}); } return std::nullopt; @@ -190,7 +185,7 @@ struct Reader { rfl::Result read_union(const InputUnionType& _union) const noexcept { try { size_t index; - (*_union.archive_)(index); + detail::read_value(_union.archive_, index); return UnionReader::read(*this, index, InputVarType{_union.archive_}); } catch (std::exception& e) { return error(std::string("Cereal union read error: ") + e.what()); diff --git a/include/rfl/cereal/Writer.hpp b/include/rfl/cereal/Writer.hpp index ee6e6ebb6..55d431cae 100644 --- a/include/rfl/cereal/Writer.hpp +++ b/include/rfl/cereal/Writer.hpp @@ -1,9 +1,6 @@ #ifndef RFL_CEREAL_WRITER_HPP_ #define RFL_CEREAL_WRITER_HPP_ -#include -#include -#include #include #include #include @@ -15,12 +12,13 @@ #include "../common.hpp" #include "../internal/is_literal.hpp" #include "../parsing/schemaful/IsSchemafulWriter.hpp" +#include "Archive.hpp" namespace rfl::cereal { /// Writer for Cereal serialization library integration. /// Writes data to Cereal's portable binary archive format for cross-platform serialization. -class Writer { +class RFL_API Writer { public: using CerealArchive = ::cereal::PortableBinaryOutputArchive; @@ -73,7 +71,7 @@ class Writer { template OutputVarType value_as_root(const T& _var) const { - (*archive_)(_var); + add_value(_var); return OutputVarType{}; } @@ -154,7 +152,7 @@ class Writer { template OutputVarType add_value_to_union(const size_t _index, const T& _var, OutputUnionType* _parent) const { - (*archive_)(_index); + detail::write_value(archive_, _index); add_value(_var); return OutputVarType{}; } @@ -187,11 +185,11 @@ class Writer { } else if constexpr (std::is_same() || std::is_same()) { - (*archive_)(::cereal::make_size_tag(_var.size())); - (*archive_)(::cereal::binary_data(_var.data(), _var.size())); + detail::write_size(archive_, _var.size()); + detail::write_bytes(archive_, _var.data(), _var.size()); } else { - (*archive_)(_var); + detail::write_value(archive_, _var); } } diff --git a/include/rfl/cereal/read.hpp b/include/rfl/cereal/read.hpp index 42ed07121..255b8e98b 100644 --- a/include/rfl/cereal/read.hpp +++ b/include/rfl/cereal/read.hpp @@ -1,14 +1,13 @@ #ifndef RFL_CEREAL_READ_HPP_ #define RFL_CEREAL_READ_HPP_ -#include -#include #include #include #include "../Processors.hpp" #include "../concepts.hpp" #include "../internal/wrap_in_rfl_array_t.hpp" +#include "Archive.hpp" #include "Parser.hpp" #include "Reader.hpp" @@ -42,8 +41,8 @@ Result> read( try { std::stringstream ss( std::string(reinterpret_cast(_bytes), _size)); - ::cereal::PortableBinaryInputArchive archive(ss); - return read(archive); + detail::InputArchive archive(ss); + return read(archive.get()); } catch (std::exception& e) { return error(std::string("Cereal read error: ") + e.what()); } @@ -67,8 +66,8 @@ auto read(const concepts::ContiguousByteContainer auto& _bytes) { template auto read(std::istream& _stream) { try { - ::cereal::PortableBinaryInputArchive archive(_stream); - return read(archive); + detail::InputArchive archive(_stream); + return read(archive.get()); } catch (std::exception& e) { return Result>( error(std::string("Cereal read error: ") + e.what())); diff --git a/include/rfl/cereal/write.hpp b/include/rfl/cereal/write.hpp index b704f2702..8e1195a27 100644 --- a/include/rfl/cereal/write.hpp +++ b/include/rfl/cereal/write.hpp @@ -33,8 +33,8 @@ template std::vector write(const auto& _obj) { std::stringstream ss; { - ::cereal::PortableBinaryOutputArchive archive(ss); - write, Ps...>(_obj, archive); + detail::OutputArchive archive(ss); + write, Ps...>(_obj, archive.get()); } auto str = ss.str(); return std::vector(str.begin(), str.end()); @@ -47,8 +47,8 @@ std::vector write(const auto& _obj) { /// @return The output stream (for chaining) template std::ostream& write(const auto& _obj, std::ostream& _stream) { - ::cereal::PortableBinaryOutputArchive archive(_stream); - write, Ps...>(_obj, archive); + detail::OutputArchive archive(_stream); + write, Ps...>(_obj, archive.get()); return _stream; } diff --git a/include/rfl/internal/jsoncons_module_fwd.hpp b/include/rfl/internal/jsoncons_module_fwd.hpp new file mode 100644 index 000000000..97b087368 --- /dev/null +++ b/include/rfl/internal/jsoncons_module_fwd.hpp @@ -0,0 +1,30 @@ +#ifndef RFL_INTERNAL_JSONCONS_MODULE_FWD_HPP_ +#define RFL_INTERNAL_JSONCONS_MODULE_FWD_HPP_ + +#include +#include +#include +#include + +// Only the canonical pointer types are needed by imported rfl templates. +namespace jsoncons { +using json = basic_json; +template +class bytes_sink; +namespace cbor { +template +class basic_cbor_encoder; +using cbor_bytes_encoder = + basic_cbor_encoder, void>, + std::allocator>; +} // namespace cbor +namespace ubjson { +template +class basic_ubjson_encoder; +using ubjson_bytes_encoder = + basic_ubjson_encoder, void>, + std::allocator>; +} // namespace ubjson +} // namespace jsoncons + +#endif diff --git a/include/rfl/parsing/tabular/ArrowTypes.hpp b/include/rfl/parsing/tabular/ArrowTypes.hpp index c0ed325f3..8544a07c1 100644 --- a/include/rfl/parsing/tabular/ArrowTypes.hpp +++ b/include/rfl/parsing/tabular/ArrowTypes.hpp @@ -20,6 +20,7 @@ #include "../../internal/has_reflection_type_v.hpp" #include "../../internal/ptr_cast.hpp" #include "../../named_tuple_t.hpp" +#include "arrow_builder_operations.hpp" namespace rfl::parsing::tabular { @@ -632,7 +633,7 @@ struct ArrowTypes { * @param _builder The builder to add to. */ static void add_to_builder(const auto& _val, BuilderType* _builder) { - const auto status = _builder->Append(_val); + const auto status = append_string(_builder, _val); if (!status.ok()) { throw std::runtime_error(status.message()); } @@ -689,7 +690,7 @@ struct ArrowTypes { * @param _builder The builder to add to. */ static void add_to_builder(const T _val, BuilderType* _builder) { - const auto status = _builder->Append(enum_to_string(_val)); + const auto status = append_string(_builder, enum_to_string(_val)); if (!status.ok()) { throw std::runtime_error(status.message()); } @@ -1005,7 +1006,7 @@ struct ArrowTypes, SerializationType::csv> { */ static void add_to_builder(const Timestamp<_format>& _val, BuilderType* _builder) { - const auto status = _builder->Append(_val.str()); + const auto status = append_string(_builder, _val.str()); if (!status.ok()) { throw std::runtime_error(status.message()); } @@ -1125,7 +1126,7 @@ struct ArrowTypes, _s> { if (_val) { ArrowTypes::add_to_builder(*_val, _builder); } else { - const auto status = _builder->AppendNull(); + const auto status = append_null(_builder); if (!status.ok()) { throw std::runtime_error(status.message()); } @@ -1181,7 +1182,7 @@ struct ArrowTypes, _s> { if (_val) { ArrowTypes::add_to_builder(*_val, _builder); } else { - const auto status = _builder->AppendNull(); + const auto status = append_null(_builder); if (!status.ok()) { throw std::runtime_error(status.message()); } @@ -1237,7 +1238,7 @@ struct ArrowTypes, _s> { if (_val) { ArrowTypes::add_to_builder(*_val, _builder); } else { - const auto status = _builder->AppendNull(); + const auto status = append_null(_builder); if (!status.ok()) { throw std::runtime_error(status.message()); } diff --git a/include/rfl/parsing/tabular/arrow_builder_operations.hpp b/include/rfl/parsing/tabular/arrow_builder_operations.hpp new file mode 100644 index 000000000..5838b5968 --- /dev/null +++ b/include/rfl/parsing/tabular/arrow_builder_operations.hpp @@ -0,0 +1,17 @@ +#ifndef RFL_PARSING_TABULAR_ARROW_BUILDER_OPERATIONS_HPP_ +#define RFL_PARSING_TABULAR_ARROW_BUILDER_OPERATIONS_HPP_ + +#include + +#include + +#include "../../common.hpp" + +namespace rfl::parsing::tabular { +// Keep Arrow's virtual Reserve()/length() calls out of the record templates. +RFL_API arrow::Status append_string(arrow::StringBuilder* _builder, + std::string_view _value); +RFL_API arrow::Status append_null(arrow::ArrayBuilder* _builder); +} // namespace rfl::parsing::tabular + +#endif diff --git a/include/rfl/ubjson/Buffers.hpp b/include/rfl/ubjson/Buffers.hpp new file mode 100644 index 000000000..d74b9b751 --- /dev/null +++ b/include/rfl/ubjson/Buffers.hpp @@ -0,0 +1,33 @@ +#ifndef RFL_UBJSON_BUFFERS_HPP_ +#define RFL_UBJSON_BUFFERS_HPP_ + +#include +#include +#include + +#include "../Result.hpp" +#include "../common.hpp" +#include "Reader.hpp" +#include "Writer.hpp" + +namespace rfl::ubjson::detail { +RFL_API Result> decode(const char* _bytes, + size_t _size); +RFL_API Result> decode(std::istream& _stream); + +class RFL_API EncodedBuffer { + public: + EncodedBuffer(); + ~EncodedBuffer(); + EncodedBuffer(const EncodedBuffer&) = delete; + EncodedBuffer& operator=(const EncodedBuffer&) = delete; + jsoncons::ubjson::ubjson_bytes_encoder* encoder() const; + std::vector bytes() const; + + private: + struct Impl; + Impl* impl_; +}; +} // namespace rfl::ubjson::detail + +#endif diff --git a/include/rfl/ubjson/Reader.hpp b/include/rfl/ubjson/Reader.hpp index cb359f213..511741a21 100644 --- a/include/rfl/ubjson/Reader.hpp +++ b/include/rfl/ubjson/Reader.hpp @@ -2,8 +2,14 @@ #define RFL_UBJSON_READER_HPP_ #include +#include #include +#include +#ifdef RFL_JSONCONS_MODULE_INTERFACE +#include "../internal/jsoncons_module_fwd.hpp" +#else #include +#endif #include #include #include @@ -13,11 +19,12 @@ #include "../Result.hpp" #include "../Vectorstring.hpp" #include "../always_false.hpp" +#include "../common.hpp" #include "../internal/ptr_cast.hpp" namespace rfl::ubjson { -class Reader { +class RFL_API Reader { public: struct UBJSONInputArray { jsoncons::json* val_; @@ -44,99 +51,50 @@ class Reader { (requires(InputVarType var) { T::from_ubjson_obj(var); }); rfl::Result get_field_from_array( - const size_t _idx, const InputArrayType& _arr) const noexcept { - if (_idx >= _arr.val_->size()) { - return error("Index out of range."); - } - return InputVarType{&_arr.val_->at(_idx)}; - } + const size_t _idx, const InputArrayType& _arr) const noexcept; rfl::Result get_field_from_object( - const std::string& _name, const InputObjectType& _obj) const noexcept { - for (auto& kv : _obj.val_->object_range()) { - if (kv.key() == _name) { - return InputVarType{&kv.value()}; - }; - } - return error("Field name '" + _name + "' not found."); - } + const std::string& _name, const InputObjectType& _obj) const noexcept; - bool is_empty(const InputVarType& _var) const noexcept { - return _var.val_->is_null(); - } + bool is_empty(const InputVarType& _var) const noexcept; template rfl::Result to_basic_type(const InputVarType& _var) const noexcept { - if constexpr (std::is_same, std::string>()) { - if (!_var.val_->is_string()) { - return error("Could not cast to string."); - } - return _var.val_->as(); - - } else if constexpr (std::is_same, - rfl::Bytestring>() || - std::is_same, - rfl::Vectorstring>()) { - using VectorType = std::remove_cvref_t; - using ValueType = typename VectorType::value_type; - if (!_var.val_->is>()) { - if constexpr (std::is_same, rfl::Bytestring>()) { - return error("Could not cast to bytestring."); - } else { - return error("Could not cast to vectorstring."); - } - } - const auto vec = _var.val_->as>(); - const auto data = internal::ptr_cast(vec.data()); - return VectorType(data, data + vec.size()); - - } else if constexpr (std::is_same, bool>()) { - if (!_var.val_->is_bool()) { - return error("Could not cast to boolean."); - } - return _var.val_->as(); - - } else if constexpr (std::is_floating_point>()) { - if (_var.val_->is_double()) { - return static_cast(_var.val_->as()); - } - return error("Could not cast to floating point value."); - - } else if constexpr (std::is_integral>()) { - if (_var.val_->is_int64()) { - return static_cast(_var.val_->as()); - } - if (_var.val_->is_uint64()) { - return static_cast(_var.val_->as()); - } + using Type = std::remove_cvref_t; + if constexpr (std::is_same_v) { + return read_string(_var); + } else if constexpr (std::is_same_v || + std::is_same_v) { + return read_bytes(_var, std::is_same_v) + .transform([](const auto& bytes) { + using Value = typename Type::value_type; + const auto begin = internal::ptr_cast(bytes.data()); + return Type(begin, begin + bytes.size()); + }); + } else if constexpr (std::is_same_v) { + return read_bool(_var); + } else if constexpr (std::is_floating_point_v) { + return read_double(_var).transform( + [](double value) { return static_cast(value); }); + } else if constexpr (std::is_integral_v) { + if (is_int64(_var)) return static_cast(read_int64(_var)); + if (is_uint64(_var)) return static_cast(read_uint64(_var)); return error("Could not cast to integer."); - } else { static_assert(rfl::always_false_v, "Unsupported type."); } } - rfl::Result to_array( - const InputVarType& _var) const noexcept { - if (!_var.val_->is_array()) { - return error("Could not cast to an array."); - } - return InputArrayType{_var.val_}; - } + rfl::Result to_array(const InputVarType& _var) const noexcept; rfl::Result to_object( - const InputVarType& _var) const noexcept { - if (!_var.val_->is_object()) { - return error("Could not cast to an object."); - } - return InputObjectType{_var.val_}; - } + const InputVarType& _var) const noexcept; template std::optional read_array(const ArrayReader& _array_reader, const InputArrayType& _arr) const noexcept { - for (auto& val : _arr.val_->array_range()) { - const auto err = _array_reader.read(InputVarType{&val}); + for (size_t i = 0; i < size(_arr.val_); ++i) { + const auto err = _array_reader.read(InputVarType{array_at(_arr.val_, i)}); if (err) { return err; } @@ -147,8 +105,9 @@ class Reader { template std::optional read_object(const ObjectReader& _object_reader, const InputObjectType& _obj) const noexcept { - for (auto& kv : _obj.val_->object_range()) { - _object_reader.read(kv.key(), InputVarType{&kv.value()}); + for (size_t i = 0; i < size(_obj.val_); ++i) { + _object_reader.read(object_key(_obj.val_, i), + InputVarType{object_value(_obj.val_, i)}); } return std::nullopt; } @@ -162,6 +121,21 @@ class Reader { return error(e.what()); } } + + private: + Result read_string(const InputVarType& _var) const; + Result> read_bytes(const InputVarType& _var, + bool _vectorstring) const; + Result read_bool(const InputVarType& _var) const; + Result read_double(const InputVarType& _var) const; + bool is_int64(const InputVarType& _var) const; + bool is_uint64(const InputVarType& _var) const; + int64_t read_int64(const InputVarType& _var) const; + uint64_t read_uint64(const InputVarType& _var) const; + size_t size(jsoncons::json* _value) const; + jsoncons::json* array_at(jsoncons::json* _value, size_t _index) const; + std::string_view object_key(jsoncons::json* _value, size_t _index) const; + jsoncons::json* object_value(jsoncons::json* _value, size_t _index) const; }; } // namespace rfl::ubjson diff --git a/include/rfl/ubjson/Writer.hpp b/include/rfl/ubjson/Writer.hpp index 0ef7eba3f..0a5418c80 100644 --- a/include/rfl/ubjson/Writer.hpp +++ b/include/rfl/ubjson/Writer.hpp @@ -2,7 +2,11 @@ #define RFL_UBJSON_WRITER_HPP_ #include +#ifdef RFL_JSONCONS_MODULE_INTERFACE +#include "../internal/jsoncons_module_fwd.hpp" +#else #include +#endif #include #include #include @@ -73,7 +77,7 @@ class RFL_API Writer { OutputVarType add_value_to_object(const std::string_view& _name, const T& _var, OutputObjectType* _parent) const { - encoder_->key(_name); + write_key(_name); return new_value(_var); } @@ -91,21 +95,28 @@ class RFL_API Writer { OutputObjectType new_object(const size_t _size) const; + void write_key(std::string_view _key) const; + void write_string(const std::string& _value) const; + void write_bytes(const void* _data, size_t _size) const; + void write_bool(bool _value) const; + void write_double(double _value) const; + void write_int64(int64_t _value) const; + template OutputVarType new_value(const T& _var) const { if constexpr (std::is_same, std::string>()) { - encoder_->string_value(_var); + write_string(_var); } else if constexpr (std::is_same, rfl::Bytestring>() || std::is_same, rfl::Vectorstring>()) { - encoder_->byte_string_value(_var); + write_bytes(_var.data(), _var.size()); } else if constexpr (std::is_same, bool>()) { - encoder_->bool_value(_var); + write_bool(_var); } else if constexpr (std::is_floating_point>()) { - encoder_->double_value(static_cast(_var)); + write_double(static_cast(_var)); } else if constexpr (std::is_integral>()) { - encoder_->int64_value(static_cast(_var)); + write_int64(static_cast(_var)); } else { static_assert(rfl::always_false_v, "Unsupported type."); } diff --git a/include/rfl/ubjson/read.hpp b/include/rfl/ubjson/read.hpp index cfdc9d0ff..3d5bbb86d 100644 --- a/include/rfl/ubjson/read.hpp +++ b/include/rfl/ubjson/read.hpp @@ -3,13 +3,12 @@ #include #include -#include -#include #include #include "../Processors.hpp" #include "../concepts.hpp" #include "../internal/wrap_in_rfl_array_t.hpp" +#include "Buffers.hpp" #include "Parser.hpp" #include "Reader.hpp" @@ -28,12 +27,14 @@ using InputVarType = typename Reader::InputVarType; template Result> read( const concepts::ContiguousByteContainer auto& _bytes) { - auto result = jsoncons::ubjson::try_decode_ubjson(_bytes); + auto result = detail::decode(reinterpret_cast(_bytes.data()), + _bytes.size()); if (result.has_value()) { auto r = Reader(); - return Parser>::read(r, InputVarType{&result.value()}); + return Parser>::read( + r, InputVarType{result.value().get()}); } else { - return rfl::error("Could not parse UBJSON: " + result.error().message()); + return rfl::error(result.error().what()); } } @@ -45,12 +46,13 @@ Result> read( /// @return Result containing either the parsed object (or array of objects) or an error message template Result> read(std::istream& _stream) { - auto result = jsoncons::ubjson::try_decode_ubjson(_stream); + auto result = detail::decode(_stream); if (result.has_value()) { auto r = Reader(); - return Parser>::read(r, InputVarType{&result.value()}); + return Parser>::read( + r, InputVarType{result.value().get()}); } else { - return rfl::error("Could not parse UBJSON: " + result.error().message()); + return rfl::error(result.error().what()); } } diff --git a/include/rfl/ubjson/write.hpp b/include/rfl/ubjson/write.hpp index 523405dbb..55913eec0 100644 --- a/include/rfl/ubjson/write.hpp +++ b/include/rfl/ubjson/write.hpp @@ -2,7 +2,6 @@ #define RFL_UBJSON_WRITE_HPP_ #include -#include #include #include #include @@ -10,6 +9,7 @@ #include "../internal/ptr_cast.hpp" #include "../parsing/Parent.hpp" +#include "Buffers.hpp" #include "Parser.hpp" namespace rfl::ubjson { @@ -24,14 +24,11 @@ template std::vector write(const auto& _obj) { using T = std::remove_cvref_t; using ParentType = parsing::Parent; - std::vector buffer; - jsoncons::ubjson::ubjson_bytes_encoder encoder(buffer); - const auto writer = Writer(&encoder); + detail::EncodedBuffer buffer; + const auto writer = Writer(buffer.encoder()); Parser>::write(writer, _obj, typename ParentType::Root{}); - return std::vector( - internal::ptr_cast(buffer.data()), - internal::ptr_cast(buffer.data() + buffer.size())); + return buffer.bytes(); } /// Writes a UBJSON representation into an ostream. diff --git a/modules/rfl.cbor.cppm b/modules/rfl.cbor.cppm index 28df82b06..629d0e103 100644 --- a/modules/rfl.cbor.cppm +++ b/modules/rfl.cbor.cppm @@ -1,6 +1,8 @@ module; +#define RFL_JSONCONS_MODULE_INTERFACE #include "rfl/cbor.hpp" +#undef RFL_JSONCONS_MODULE_INTERFACE export module rfl.cbor; diff --git a/modules/rfl.cereal.cppm b/modules/rfl.cereal.cppm index ebb9125e7..47b7a6529 100644 --- a/modules/rfl.cereal.cppm +++ b/modules/rfl.cereal.cppm @@ -1,6 +1,8 @@ module; +#define RFL_CEREAL_MODULE_INTERFACE #include "rfl/cereal.hpp" +#undef RFL_CEREAL_MODULE_INTERFACE export module rfl.cereal; diff --git a/modules/rfl.ubjson.cppm b/modules/rfl.ubjson.cppm index 448b313a5..c567e7257 100644 --- a/modules/rfl.ubjson.cppm +++ b/modules/rfl.ubjson.cppm @@ -1,6 +1,8 @@ module; +#define RFL_JSONCONS_MODULE_INTERFACE #include "rfl/ubjson.hpp" +#undef RFL_JSONCONS_MODULE_INTERFACE export module rfl.ubjson; diff --git a/scripts/ci/README.md b/scripts/ci/README.md index 0bb83a05d..a31c50d0a 100644 --- a/scripts/ci/README.md +++ b/scripts/ci/README.md @@ -101,18 +101,37 @@ the PCH only in header mode, because CMake does not scan the PCH itself for module imports. JSON benchmarks compiled and the reflect-cpp person benchmark ran with PCH enabled on both GCC 15 and Clang 19. -The compiler minimum does not imply that every optional dependency works as a -module. With the pinned dependency versions, GCC 16.2.1 still fails the -Cap'n Proto 1.2.0 and Cereal 1.3.2 module interfaces because of TU-local types. -CBOR/UBJSON with jsoncons 1.4.0 fail when imported templates cannot find -`make_error_code` through ADL. Parquet with Arrow 21.0.0 reaches the importer -tests, but GCC diagnoses an out-of-bounds access while inlining Arrow builder -virtual functions; the tests use `-Werror`. These failures were reproduced in -both C++20 and C++23 with PCH enabled, so upgrading from GCC 15 to GCC 16 alone -does not make the complete module matrix pass. -For diagnosis, a separate GCC 16.2.1 C++20 Parquet run added only -`-fno-devirtualize-speculatively`, retained `-Werror`, and passed 61 tests -(one locale test skipped). This optimization flag is not enabled by the project. +The CBOR and UBJSON adapters now keep jsoncons 1.4.0 decoding, primitive +access, and encoder ownership in ordinary implementation files. Module +interfaces retain only forward declarations of the pointer types. Cereal 1.3.2 +uses the same boundary for archive ownership and primitive operations, retaining +its native portable binary format and existing archive-reference overloads. +Regression tests cover those overloads against a separate native Cereal TU, +byte compatibility, stream reads/writes, and malformed input. + +GCC 15.2 and GCC 16.2.1 passed the CBOR, UBJSON, and Cereal module suites in +C++20 and C++23 with PCH enabled. Clang 19 also passed a combined C++20 build +of CBOR, UBJSON, Cereal, CSV, and Parquet: 224 tests passed and one locale test +was skipped. The same combined suite also passed with GCC 11 in C++20 +header mode using a shared reflectcpp library (224 tests and one locale skip). +An installed GCC 11 shared-library consumer also passed CBOR, UBJSON, and Cereal +round trips through `find_package(reflectcpp)`; the local PyArrow fixture needs +its library directory in `LD_LIBRARY_PATH`. + +Arrow string and null appends now run in an ordinary implementation file. +GCC 16.2.1 passed the Parquet/Arrow 21.0.0 module suite in C++20 and C++23 +(61 tests and one locale skip per run) with the usual optimization flags and `-Werror`. No compiler +warning or optimization is disabled by this workaround. + +Two dependency boundaries remain unresolved. GCC 15 rejects Arrow/Parquet's +TU-local constants and static helper functions in the module interface. +GCC 16 still rejects Cap'n Proto 1.2.0/KJ types: even exporting a struct with +only a `capnp::DynamicValue::Reader` member reproduces the KJ `Bounded` error. +Moving packed-message and schema-parser operations out of templates did not +remove that type dependency. A complete rfl-side fix needs opaque reader and +writer handles rather than merely wrapping calls; that public representation +change is not part of this patch. Upgrading to GCC 16 alone therefore still +does not make the entire optional-format matrix pass. Sources: [CMake 3.31](https://cmake.org/cmake/help/v3.31/manual/cmake-cxxmodules.7.html), [GCC 14](https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/C_002b_002b-Modules.html), diff --git a/src/reflectcpp_arrow.cpp b/src/reflectcpp_arrow.cpp new file mode 100644 index 000000000..20edc0f7f --- /dev/null +++ b/src/reflectcpp_arrow.cpp @@ -0,0 +1,11 @@ +#include "rfl/parsing/tabular/arrow_builder_operations.hpp" + +namespace rfl::parsing::tabular { +arrow::Status append_string(arrow::StringBuilder* _builder, + std::string_view _value) { + return _builder->Append(_value); +} +arrow::Status append_null(arrow::ArrayBuilder* _builder) { + return _builder->AppendNull(); +} +} // namespace rfl::parsing::tabular diff --git a/src/reflectcpp_cbor.cpp b/src/reflectcpp_cbor.cpp index 1a813fba5..99bdaac49 100644 --- a/src/reflectcpp_cbor.cpp +++ b/src/reflectcpp_cbor.cpp @@ -29,4 +29,6 @@ SOFTWARE. // Also, this speeds up compile time, compared to multiple separate .cpp files // compilation. +#include "rfl/cbor/Buffers.cpp" +#include "rfl/cbor/Reader.cpp" #include "rfl/cbor/Writer.cpp" diff --git a/src/reflectcpp_cereal.cpp b/src/reflectcpp_cereal.cpp index 2d49d72e8..7eeab9003 100644 --- a/src/reflectcpp_cereal.cpp +++ b/src/reflectcpp_cereal.cpp @@ -29,5 +29,6 @@ SOFTWARE. // Also, this speeds up compile time, compared to multiple separate .cpp files // compilation. +#include "rfl/cereal/Archive.cpp" #include "rfl/cereal/Reader.cpp" #include "rfl/cereal/Writer.cpp" diff --git a/src/reflectcpp_ubjson.cpp b/src/reflectcpp_ubjson.cpp index a9f7c2fae..09b8e4aa2 100644 --- a/src/reflectcpp_ubjson.cpp +++ b/src/reflectcpp_ubjson.cpp @@ -29,4 +29,6 @@ SOFTWARE. // Also, this speeds up compile time, compared to multiple separate .cpp files // compilation. +#include "rfl/ubjson/Buffers.cpp" +#include "rfl/ubjson/Reader.cpp" #include "rfl/ubjson/Writer.cpp" diff --git a/src/rfl/cbor/Buffers.cpp b/src/rfl/cbor/Buffers.cpp new file mode 100644 index 000000000..d61065f9d --- /dev/null +++ b/src/rfl/cbor/Buffers.cpp @@ -0,0 +1,38 @@ +#include "rfl/cbor/Buffers.hpp" + +#include + +namespace rfl::cbor::detail { +namespace { +template +Result> decode_source(const Source& _source) { + auto result = jsoncons::cbor::try_decode_cbor(_source); + if (!result.has_value()) + return error("Could not parse CBOR: " + result.error().message()); + return std::make_shared(std::move(result.value())); +} +} // namespace +Result> decode(const char* _bytes, + size_t _size) { + return decode_source(jsoncons::byte_string_view( + reinterpret_cast(_bytes), _size)); +} +Result> decode(std::istream& _stream) { + auto result = jsoncons::cbor::try_decode_cbor(_stream); + if (!result.has_value()) + return error("Could not parse CBOR: " + result.error().message()); + return std::make_shared(std::move(result.value())); +} +struct EncodedBuffer::Impl { + std::vector buffer; + jsoncons::cbor::cbor_bytes_encoder encoder{buffer}; +}; +EncodedBuffer::EncodedBuffer() : impl_(new Impl) {} +EncodedBuffer::~EncodedBuffer() { delete impl_; } +jsoncons::cbor::cbor_bytes_encoder* EncodedBuffer::encoder() const { + return &impl_->encoder; +} +std::vector EncodedBuffer::bytes() const { + return {impl_->buffer.begin(), impl_->buffer.end()}; +} +} // namespace rfl::cbor::detail diff --git a/src/rfl/cbor/Reader.cpp b/src/rfl/cbor/Reader.cpp new file mode 100644 index 000000000..bbfc101cc --- /dev/null +++ b/src/rfl/cbor/Reader.cpp @@ -0,0 +1,96 @@ +#include "rfl/cbor/Reader.hpp" + +namespace rfl::cbor { + +/// @return Result containing the field value, or an error if index is out of +/// bounds +rfl::Result Reader::get_field_from_array( + const size_t _idx, const InputArrayType& _arr) const noexcept { + if (_idx >= _arr.val_->size()) { + return error("Index out of range."); + } + return InputVarType{&_arr.val_->at(_idx)}; +} + +/// @return Result containing the field value, or an error if field is not found +rfl::Result Reader::get_field_from_object( + const std::string& _name, const InputObjectType& _obj) const noexcept { + for (auto& kv : _obj.val_->object_range()) { + if (kv.key() == _name) { + return InputVarType{&kv.value()}; + }; + } + return error("Field name '" + _name + "' not found."); +} + +bool Reader::is_empty(const InputVarType& _var) const noexcept { + return _var.val_->is_null(); +} + +/// @return Result containing the array, or an error if value is not an array +rfl::Result Reader::to_array( + const InputVarType& _var) const noexcept { + if (!_var.val_->is_array()) { + return error("Could not cast to an array."); + } + return InputArrayType{_var.val_}; +} + +/// @return Result containing the object, or an error if value is not an object +rfl::Result Reader::to_object( + const InputVarType& _var) const noexcept { + if (!_var.val_->is_object()) { + return error("Could not cast to an object."); + } + return InputObjectType{_var.val_}; +} + +Result Reader::read_string(const InputVarType& _var) const { + if (!_var.val_->is_string()) return error("Could not cast to string."); + return _var.val_->as(); +} + +Result> Reader::read_bytes(const InputVarType& _var, + bool _vectorstring) const { + if (!_var.val_->is_byte_string()) + return error(_vectorstring ? "Could not cast to vectorstring." + : "Could not cast to bytestring."); + return _var.val_->as>(); +} + +Result Reader::read_bool(const InputVarType& _var) const { + if (!_var.val_->is_bool()) return error("Could not cast to boolean."); + return _var.val_->as(); +} + +Result Reader::read_double(const InputVarType& _var) const { + if (!_var.val_->is_double()) return error("Could not cast to double."); + return _var.val_->as(); +} + +bool Reader::is_int64(const InputVarType& _var) const { + return _var.val_->is_int64(); +} +int64_t Reader::read_int64(const InputVarType& _var) const { + return _var.val_->as(); +} +bool Reader::is_uint64(const InputVarType& _var) const { + return _var.val_->is_uint64(); +} +uint64_t Reader::read_uint64(const InputVarType& _var) const { + return _var.val_->as(); +} +size_t Reader::size(jsoncons::json* _value) const { return _value->size(); } +jsoncons::json* Reader::array_at(jsoncons::json* _value, size_t _index) const { + return &_value->at(_index); +} +std::string_view Reader::object_key(jsoncons::json* _value, + size_t _index) const { + return (_value->object_range().begin() + _index)->key(); +} +jsoncons::json* Reader::object_value(jsoncons::json* _value, + size_t _index) const { + return &(_value->object_range().begin() + _index)->value(); +} + +} // namespace rfl::cbor diff --git a/src/rfl/cbor/Writer.cpp b/src/rfl/cbor/Writer.cpp index 754545181..9c86e6a5e 100644 --- a/src/rfl/cbor/Writer.cpp +++ b/src/rfl/cbor/Writer.cpp @@ -74,4 +74,23 @@ Writer::OutputObjectType Writer::new_object() const { return OutputObjectType{}; } +void Writer::write_key(std::string_view _value) const { encoder_->key(_value); } +void Writer::write_string(const std::string& _value) const { + encoder_->string_value(_value); +} +void Writer::write_bool(bool _value) const { encoder_->bool_value(_value); } +void Writer::write_double(double _value) const { + encoder_->double_value(_value); +} +void Writer::write_uint64(uint64_t _value) const { + encoder_->uint64_value(_value); +} +void Writer::write_int64(int64_t _value) const { + encoder_->int64_value(_value); +} +void Writer::write_bytes(const void* _data, size_t _size) const { + encoder_->byte_string_value( + jsoncons::byte_string_view(static_cast(_data), _size)); +} + } // namespace rfl::cbor diff --git a/src/rfl/cereal/Archive.cpp b/src/rfl/cereal/Archive.cpp new file mode 100644 index 000000000..12db888b4 --- /dev/null +++ b/src/rfl/cereal/Archive.cpp @@ -0,0 +1,195 @@ +#include "rfl/cereal/Archive.hpp" + +namespace rfl::cereal::detail { + +InputArchive::InputArchive(std::istream& _stream) + : archive_(new ::cereal::PortableBinaryInputArchive(_stream)) {} +InputArchive::~InputArchive() { delete archive_; } +::cereal::PortableBinaryInputArchive& InputArchive::get() const { + return *archive_; +} + +OutputArchive::OutputArchive(std::ostream& _stream) + : archive_(new ::cereal::PortableBinaryOutputArchive(_stream)) {} +OutputArchive::~OutputArchive() { delete archive_; } +::cereal::PortableBinaryOutputArchive& OutputArchive::get() const { + return *archive_; +} + +void read_value(::cereal::PortableBinaryInputArchive* _archive, bool& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const bool& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, char& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const char& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + signed char& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const signed char& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + unsigned char& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const unsigned char& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, short& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const short& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + unsigned short& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const unsigned short& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, int& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const int& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + unsigned int& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const unsigned int& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, long& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const long& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + unsigned long& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const unsigned long& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + long long& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const long long& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + unsigned long long& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const unsigned long long& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, float& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const float& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + double& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const double& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + long double& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const long double& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + wchar_t& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const wchar_t& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + char8_t& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const char8_t& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + char16_t& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const char16_t& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + char32_t& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const char32_t& _value) { + (*_archive)(_value); +} +void read_value(::cereal::PortableBinaryInputArchive* _archive, + std::string& _value) { + (*_archive)(_value); +} +void write_value(::cereal::PortableBinaryOutputArchive* _archive, + const std::string& _value) { + (*_archive)(_value); +} + +std::size_t read_size(::cereal::PortableBinaryInputArchive* _archive) { + std::size_t size; + (*_archive)(::cereal::make_size_tag(size)); + return size; +} + +void write_size(::cereal::PortableBinaryOutputArchive* _archive, + std::size_t _size) { + (*_archive)(::cereal::make_size_tag(_size)); +} + +void read_bytes(::cereal::PortableBinaryInputArchive* _archive, void* _data, + std::size_t _size) { + (*_archive)(::cereal::binary_data(_data, _size)); +} + +void write_bytes(::cereal::PortableBinaryOutputArchive* _archive, + const void* _data, std::size_t _size) { + (*_archive)(::cereal::binary_data(_data, _size)); +} + +} // namespace rfl::cereal::detail diff --git a/src/rfl/ubjson/Buffers.cpp b/src/rfl/ubjson/Buffers.cpp new file mode 100644 index 000000000..55f2bf9ff --- /dev/null +++ b/src/rfl/ubjson/Buffers.cpp @@ -0,0 +1,38 @@ +#include "rfl/ubjson/Buffers.hpp" + +#include + +namespace rfl::ubjson::detail { +namespace { +template +Result> decode_source(const Source& _source) { + auto result = jsoncons::ubjson::try_decode_ubjson(_source); + if (!result.has_value()) + return error("Could not parse UBJSON: " + result.error().message()); + return std::make_shared(std::move(result.value())); +} +} // namespace +Result> decode(const char* _bytes, + size_t _size) { + return decode_source(jsoncons::byte_string_view( + reinterpret_cast(_bytes), _size)); +} +Result> decode(std::istream& _stream) { + auto result = jsoncons::ubjson::try_decode_ubjson(_stream); + if (!result.has_value()) + return error("Could not parse UBJSON: " + result.error().message()); + return std::make_shared(std::move(result.value())); +} +struct EncodedBuffer::Impl { + std::vector buffer; + jsoncons::ubjson::ubjson_bytes_encoder encoder{buffer}; +}; +EncodedBuffer::EncodedBuffer() : impl_(new Impl) {} +EncodedBuffer::~EncodedBuffer() { delete impl_; } +jsoncons::ubjson::ubjson_bytes_encoder* EncodedBuffer::encoder() const { + return &impl_->encoder; +} +std::vector EncodedBuffer::bytes() const { + return {impl_->buffer.begin(), impl_->buffer.end()}; +} +} // namespace rfl::ubjson::detail diff --git a/src/rfl/ubjson/Reader.cpp b/src/rfl/ubjson/Reader.cpp new file mode 100644 index 000000000..e77f558e8 --- /dev/null +++ b/src/rfl/ubjson/Reader.cpp @@ -0,0 +1,92 @@ +#include "rfl/ubjson/Reader.hpp" + +namespace rfl::ubjson { + +rfl::Result Reader::get_field_from_array( + const size_t _idx, const InputArrayType& _arr) const noexcept { + if (_idx >= _arr.val_->size()) { + return error("Index out of range."); + } + return InputVarType{&_arr.val_->at(_idx)}; +} + +rfl::Result Reader::get_field_from_object( + const std::string& _name, const InputObjectType& _obj) const noexcept { + for (auto& kv : _obj.val_->object_range()) { + if (kv.key() == _name) { + return InputVarType{&kv.value()}; + }; + } + return error("Field name '" + _name + "' not found."); +} + +bool Reader::is_empty(const InputVarType& _var) const noexcept { + return _var.val_->is_null(); +} + +rfl::Result Reader::to_array( + const InputVarType& _var) const noexcept { + if (!_var.val_->is_array()) { + return error("Could not cast to an array."); + } + return InputArrayType{_var.val_}; +} + +rfl::Result Reader::to_object( + const InputVarType& _var) const noexcept { + if (!_var.val_->is_object()) { + return error("Could not cast to an object."); + } + return InputObjectType{_var.val_}; +} + +Result Reader::read_string(const InputVarType& _var) const { + if (!_var.val_->is_string()) return error("Could not cast to string."); + return _var.val_->as(); +} + +Result> Reader::read_bytes(const InputVarType& _var, + bool _vectorstring) const { + if (!_var.val_->is>()) + return error(_vectorstring ? "Could not cast to vectorstring." + : "Could not cast to bytestring."); + return _var.val_->as>(); +} + +Result Reader::read_bool(const InputVarType& _var) const { + if (!_var.val_->is_bool()) return error("Could not cast to boolean."); + return _var.val_->as(); +} + +Result Reader::read_double(const InputVarType& _var) const { + if (!_var.val_->is_double()) + return error("Could not cast to floating point value."); + return _var.val_->as(); +} + +bool Reader::is_int64(const InputVarType& _var) const { + return _var.val_->is_int64(); +} +int64_t Reader::read_int64(const InputVarType& _var) const { + return _var.val_->as(); +} +bool Reader::is_uint64(const InputVarType& _var) const { + return _var.val_->is_uint64(); +} +uint64_t Reader::read_uint64(const InputVarType& _var) const { + return _var.val_->as(); +} +size_t Reader::size(jsoncons::json* _value) const { return _value->size(); } +jsoncons::json* Reader::array_at(jsoncons::json* _value, size_t _index) const { + return &_value->at(_index); +} +std::string_view Reader::object_key(jsoncons::json* _value, + size_t _index) const { + return (_value->object_range().begin() + _index)->key(); +} +jsoncons::json* Reader::object_value(jsoncons::json* _value, + size_t _index) const { + return &(_value->object_range().begin() + _index)->value(); +} + +} // namespace rfl::ubjson diff --git a/src/rfl/ubjson/Writer.cpp b/src/rfl/ubjson/Writer.cpp index 22d59ba4d..7bb437f50 100644 --- a/src/rfl/ubjson/Writer.cpp +++ b/src/rfl/ubjson/Writer.cpp @@ -74,4 +74,21 @@ Writer::OutputObjectType Writer::new_object(const size_t _size) const { return OutputObjectType{}; } +void Writer::write_key(std::string_view _value) const { encoder_->key(_value); } +void Writer::write_string(const std::string& _value) const { + encoder_->string_value(_value); +} +void Writer::write_bool(bool _value) const { encoder_->bool_value(_value); } +void Writer::write_double(double _value) const { + encoder_->double_value(_value); +} + +void Writer::write_int64(int64_t _value) const { + encoder_->int64_value(_value); +} +void Writer::write_bytes(const void* _data, size_t _size) const { + encoder_->byte_string_value( + jsoncons::byte_string_view(static_cast(_data), _size)); +} + } // namespace rfl::ubjson diff --git a/tests/cbor/test_stream_bridge.cpp b/tests/cbor/test_stream_bridge.cpp new file mode 100644 index 000000000..6f75e9398 --- /dev/null +++ b/tests/cbor/test_stream_bridge.cpp @@ -0,0 +1,32 @@ +#include + +#include +#include +#include + +#include + +namespace test_cbor_stream_bridge { +TEST(cbor, scalar_wire_and_stream) { + const std::vector expected{0x18, 0x2a}; + const auto bytes = rfl::cbor::write(42); + EXPECT_EQ(std::vector(bytes.begin(), bytes.end()), expected); + const auto result = rfl::cbor::read(expected); + ASSERT_TRUE(result); + EXPECT_EQ(result.value(), 42); + + std::stringstream stream; + rfl::cbor::write(42, stream); + EXPECT_EQ(stream.str(), std::string(bytes.begin(), bytes.end())); + const auto streamed = rfl::cbor::read(stream); + ASSERT_TRUE(streamed); + EXPECT_EQ(streamed.value(), 42); +} + +TEST(cbor, malformed_stream_reports_decoder_error) { + std::stringstream stream(std::string(1, static_cast(0xff))); + const auto result = rfl::cbor::read(stream); + ASSERT_FALSE(result); + EXPECT_TRUE(result.error().what().starts_with("Could not parse CBOR: ")); +} +} // namespace test_cbor_stream_bridge diff --git a/tests/cereal/archive_reference.cpp b/tests/cereal/archive_reference.cpp new file mode 100644 index 000000000..bd1a58fee --- /dev/null +++ b/tests/cereal/archive_reference.cpp @@ -0,0 +1,41 @@ +#include "archive_reference.hpp" + +#include +#include +#include + +namespace test_cereal_archive { +std::vector with_output_archive( + const std::function& _write) { + std::stringstream stream; + { + ::cereal::PortableBinaryOutputArchive archive(stream); + _write(archive); + } + const auto str = stream.str(); + return {str.begin(), str.end()}; +} + +void with_input_archive( + const std::vector& _bytes, + const std::function& _read) { + std::stringstream stream(std::string(_bytes.begin(), _bytes.end())); + ::cereal::PortableBinaryInputArchive archive(stream); + _read(archive); +} + +std::vector reference_bytes(const Record& _value) { + return with_output_archive([&](auto& archive) { + archive(_value.small, _value.large, _value.number, _value.flag, + _value.text); + }); +} + +Record reference_read(const std::vector& _bytes) { + Record value; + with_input_archive(_bytes, [&](auto& archive) { + archive(value.small, value.large, value.number, value.flag, value.text); + }); + return value; +} +} // namespace test_cereal_archive diff --git a/tests/cereal/archive_reference.hpp b/tests/cereal/archive_reference.hpp new file mode 100644 index 000000000..4db524dc5 --- /dev/null +++ b/tests/cereal/archive_reference.hpp @@ -0,0 +1,32 @@ +#ifndef RFL_TEST_CEREAL_ARCHIVE_REFERENCE_HPP_ +#define RFL_TEST_CEREAL_ARCHIVE_REFERENCE_HPP_ + +#include +#include +#include +#include + +namespace cereal { +class PortableBinaryInputArchive; +class PortableBinaryOutputArchive; +} // namespace cereal + +namespace test_cereal_archive { +struct Record { + std::int16_t small; + std::uint64_t large; + double number; + bool flag; + std::string text; +}; + +std::vector reference_bytes(const Record& _value); +Record reference_read(const std::vector& _bytes); +std::vector with_output_archive( + const std::function& _write); +void with_input_archive( + const std::vector& _bytes, + const std::function& _read); +} // namespace test_cereal_archive + +#endif diff --git a/tests/cereal/test_archive_interoperability.cpp b/tests/cereal/test_archive_interoperability.cpp new file mode 100644 index 000000000..8020f2527 --- /dev/null +++ b/tests/cereal/test_archive_interoperability.cpp @@ -0,0 +1,39 @@ +#include + +#include "archive_reference.hpp" + +#include + +namespace test_cereal_archive { +namespace { +const Record sample{-12345, 0xfedcba9876543210ULL, 1.25, true, "Cereal bridge"}; + +void expect_equal(const Record& _value) { + EXPECT_EQ(_value.small, sample.small); + EXPECT_EQ(_value.large, sample.large); + EXPECT_EQ(_value.number, sample.number); + EXPECT_EQ(_value.flag, sample.flag); + EXPECT_EQ(_value.text, sample.text); +} +} // namespace + +TEST(cereal, archive_wire_compatibility) { + const auto bytes = rfl::cereal::write(sample); + EXPECT_EQ(bytes, reference_bytes(sample)); + expect_equal(reference_read(bytes)); + const auto result = rfl::cereal::read(reference_bytes(sample)); + ASSERT_TRUE(result); + expect_equal(result.value()); +} + +TEST(cereal, existing_archive_overloads) { + const auto bytes = with_output_archive( + [](auto& archive) { rfl::cereal::write(sample, archive); }); + EXPECT_EQ(bytes, reference_bytes(sample)); + with_input_archive(bytes, [](auto& archive) { + const auto result = rfl::cereal::read(archive); + ASSERT_TRUE(result); + expect_equal(result.value()); + }); +} +} // namespace test_cereal_archive diff --git a/tests/ubjson/test_stream_bridge.cpp b/tests/ubjson/test_stream_bridge.cpp new file mode 100644 index 000000000..4ef04932f --- /dev/null +++ b/tests/ubjson/test_stream_bridge.cpp @@ -0,0 +1,32 @@ +#include + +#include +#include +#include + +#include + +namespace test_ubjson_stream_bridge { +TEST(ubjson, scalar_wire_and_stream) { + const std::vector expected{'U', 0x2a}; + const auto bytes = rfl::ubjson::write(42); + EXPECT_EQ(std::vector(bytes.begin(), bytes.end()), expected); + const auto result = rfl::ubjson::read(expected); + ASSERT_TRUE(result); + EXPECT_EQ(result.value(), 42); + + std::stringstream stream; + rfl::ubjson::write(42, stream); + EXPECT_EQ(stream.str(), std::string(bytes.begin(), bytes.end())); + const auto streamed = rfl::ubjson::read(stream); + ASSERT_TRUE(streamed); + EXPECT_EQ(streamed.value(), 42); +} + +TEST(ubjson, malformed_stream_reports_decoder_error) { + std::stringstream stream(std::string(1, static_cast(0xff))); + const auto result = rfl::ubjson::read(stream); + ASSERT_FALSE(result); + EXPECT_TRUE(result.error().what().starts_with("Could not parse UBJSON: ")); +} +} // namespace test_ubjson_stream_bridge From ceee1a747a349258b8caf5f03ff6e41a7941c25b Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Sun, 18 Oct 2026 11:26:14 +0800 Subject: [PATCH 12/18] Isolate Arrow and Cap'n Proto types from module interfaces --- CMakeLists.txt | 4 +- docs/install.md | 2 +- docs/supported_formats/capnproto.md | 16 +- include/rfl/capnproto/Buffers.hpp | 41 + include/rfl/capnproto/NativeHandle.hpp | 103 ++ include/rfl/capnproto/Reader.hpp | 184 +-- include/rfl/capnproto/Schema.hpp | 7 + include/rfl/capnproto/SchemaImpl.hpp | 11 +- include/rfl/capnproto/Writer.hpp | 155 +- include/rfl/capnproto/read.hpp | 18 +- include/rfl/capnproto/to_schema.hpp | 2 +- include/rfl/capnproto/write.hpp | 26 +- include/rfl/csv/Settings.hpp | 6 +- include/rfl/csv/Table.hpp | 13 + include/rfl/csv/read.hpp | 68 +- include/rfl/csv/write.hpp | 62 +- include/rfl/parquet/Settings.hpp | 5 +- include/rfl/parquet/Table.hpp | 13 + include/rfl/parquet/read.hpp | 30 +- include/rfl/parquet/write.hpp | 37 +- include/rfl/parsing/tabular/ArrowBridge.hpp | 69 + include/rfl/parsing/tabular/ArrowReader.hpp | 3 +- include/rfl/parsing/tabular/ArrowTypes.hpp | 1274 +++-------------- include/rfl/parsing/tabular/ArrowWriter.hpp | 17 +- .../parsing/tabular/ChunkedArrayIterator.hpp | 13 +- .../parsing/tabular/make_arrow_builders.hpp | 7 +- .../tabular/make_chunked_array_iterators.hpp | 12 +- modules/rfl.capnproto.cppm | 6 +- modules/rfl.csv.cppm | 6 +- modules/rfl.parquet.cppm | 6 +- scripts/ci/README.md | 57 +- src/reflectcpp_arrow_bridge.cpp | 3 + src/reflectcpp_capnproto.cpp | 2 + src/reflectcpp_csv.cpp | 83 ++ src/reflectcpp_parquet.cpp | 65 + src/rfl/capnproto/Buffers.cpp | 46 + src/rfl/capnproto/NativeHandle.cpp | 65 + src/rfl/capnproto/Reader.cpp | 127 +- src/rfl/capnproto/SchemaImpl.cpp | 2 + src/rfl/capnproto/Writer.cpp | 111 +- src/rfl/parsing/tabular/ArrowBridge.cpp | 483 +++++++ src/rfl/parsing/tabular/NativeArrowTypes.hpp | 1059 ++++++++++++++ tests/capnproto/native_reference.cpp | 41 + tests/capnproto/native_reference.hpp | 19 + tests/capnproto/test_native_constructor.cpp | 26 + .../test_native_interoperability.cpp | 36 + tests/parquet/native_reference.cpp | 85 ++ tests/parquet/native_reference.hpp | 8 + .../parquet/test_native_interoperability.cpp | 61 + 49 files changed, 2969 insertions(+), 1626 deletions(-) create mode 100644 include/rfl/capnproto/Buffers.hpp create mode 100644 include/rfl/capnproto/NativeHandle.hpp create mode 100644 include/rfl/csv/Table.hpp create mode 100644 include/rfl/parquet/Table.hpp create mode 100644 include/rfl/parsing/tabular/ArrowBridge.hpp create mode 100644 src/reflectcpp_arrow_bridge.cpp create mode 100644 src/reflectcpp_csv.cpp create mode 100644 src/reflectcpp_parquet.cpp create mode 100644 src/rfl/capnproto/Buffers.cpp create mode 100644 src/rfl/capnproto/NativeHandle.cpp create mode 100644 src/rfl/parsing/tabular/ArrowBridge.cpp create mode 100644 src/rfl/parsing/tabular/NativeArrowTypes.hpp create mode 100644 tests/capnproto/native_reference.cpp create mode 100644 tests/capnproto/native_reference.hpp create mode 100644 tests/capnproto/test_native_constructor.cpp create mode 100644 tests/capnproto/test_native_interoperability.cpp create mode 100644 tests/parquet/native_reference.cpp create mode 100644 tests/parquet/native_reference.hpp create mode 100644 tests/parquet/test_native_interoperability.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 96e3cc990..cd880e41a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -399,10 +399,11 @@ if (REFLECTCPP_CEREAL OR REFLECTCPP_CHECK_HEADERS) endif() if (REFLECTCPP_CSV OR REFLECTCPP_PARQUET OR REFLECTCPP_CHECK_HEADERS) - list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_arrow.cpp) + list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_arrow.cpp src/reflectcpp_arrow_bridge.cpp) endif () if (REFLECTCPP_CSV OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_csv.cpp) list(APPEND REFLECT_CPP_MODULES modules/rfl.csv.cppm) if (NOT TARGET Arrow) find_package(Arrow CONFIG REQUIRED) @@ -437,6 +438,7 @@ if (REFLECTCPP_MSGPACK OR REFLECTCPP_CHECK_HEADERS) endif () if (REFLECTCPP_PARQUET OR REFLECTCPP_CHECK_HEADERS) + list(APPEND REFLECT_CPP_SOURCES src/reflectcpp_parquet.cpp) list(APPEND REFLECT_CPP_MODULES modules/rfl.parquet.cppm) if (NOT TARGET Arrow) find_package(Arrow CONFIG REQUIRED) diff --git a/docs/install.md b/docs/install.md index 336928955..a331fbba9 100644 --- a/docs/install.md +++ b/docs/install.md @@ -51,7 +51,7 @@ cmake --build build --config Release -j 4 # MSVC Simply copy the contents of the folders `include` and `src` into your source repository or add it to your include path and also add `src/reflectcpp.cpp` and `src/reflectcpp_json.cpp` and `src/yyjson.c` to your source files for compilation. If you want to link to your own version of YYJSON, then only add `src/reflectcpp.cpp` and `src/reflectcpp_json.cpp`. If you don't need JSON support, then only add `src/reflectcpp.cpp`. -If you need support for other serialization formats like flexbuffers or XML, you should also add `src/reflectcpp_.cpp` and include and link the respective libraries, as listed in the section on serialization formats. For CSV or Parquet, add `src/reflectcpp_arrow.cpp` once; both formats share these Arrow builder operations. +If you need support for other serialization formats like flexbuffers or XML, you should also add `src/reflectcpp_.cpp` and include and link the respective libraries, as listed in the section on serialization formats. For CSV or Parquet, also add `src/reflectcpp_arrow.cpp` and `src/reflectcpp_arrow_bridge.cpp` once; both formats share these Arrow operations. ## Option 5: Compilation using cmake and vcpkg diff --git a/docs/supported_formats/capnproto.md b/docs/supported_formats/capnproto.md index 0bd55e664..9f8b142d6 100644 --- a/docs/supported_formats/capnproto.md +++ b/docs/supported_formats/capnproto.md @@ -110,7 +110,7 @@ For large and complex systems of structs, it is often a good idea to split up your code into smaller compilation units. You can do so using custom constructors. For the Cap'n Proto format, these must be a static function on your struct or class called -`from_capnproto` that take a `rfl::capnproto::Reader::InputVarType` as input and return +`from_capnproto_obj` that take a `rfl::capnproto::Reader::InputVarType` as input and return the class or the class wrapped in `rfl::Result`. In your header file you can write something like this: @@ -122,14 +122,14 @@ struct Person { rfl::Timestamp<"%Y-%m-%d"> birthday; using InputVarType = typename rfl::capnproto::Reader::InputVarType; - static rfl::Result from_capnproto(const InputVarType& _obj); + static rfl::Result from_capnproto_obj(const InputVarType& _obj); }; ``` -And in your source file, you implement `from_capnproto` as follows: +And in your source file, you implement `from_capnproto_obj` as follows: ```cpp -rfl::Result Person::from_capnproto(const InputVarType& _obj) { +rfl::Result Person::from_capnproto_obj(const InputVarType& _obj) { const auto from_nt = [](auto&& _nt) { return rfl::from_named_tuple(std::move(_nt)); }; @@ -139,3 +139,11 @@ rfl::Result Person::from_capnproto(const InputVarType& _obj) { ``` This will force the compiler to only compile the Cap'n Proto parsing when the source file is compiled. + + +`InputVarType::val_` now holds an rfl-owned native-view handle. Custom constructors +can still call `_obj.val_.as()` when their source file +includes ``. Use `_obj.val_.native()` when another Cap'n Proto +API needs the native reader itself. In module consumers, include native headers +before `import rfl.capnproto;`. The handle owns the native view, not the underlying +message or input bytes; their lifetime requirements are unchanged. diff --git a/include/rfl/capnproto/Buffers.hpp b/include/rfl/capnproto/Buffers.hpp new file mode 100644 index 000000000..909110967 --- /dev/null +++ b/include/rfl/capnproto/Buffers.hpp @@ -0,0 +1,41 @@ +#ifndef RFL_CAPNPROTO_BUFFERS_HPP_ +#define RFL_CAPNPROTO_BUFFERS_HPP_ + +#include +#include +#include + +#include "../common.hpp" +#include "Reader.hpp" +#include "SchemaImpl.hpp" +#include "Writer.hpp" + +namespace rfl::capnproto::detail { +class RFL_API PackedReader { + public: + PackedReader(const void*, size_t, const capnp::ParsedSchema&, + const std::string&); + ~PackedReader(); + PackedReader(const PackedReader&) = delete; + PackedReader& operator=(const PackedReader&) = delete; + Reader::InputVarType root() const; + + private: + struct Impl; + std::unique_ptr impl_; +}; +class RFL_API PackedWriter { + public: + PackedWriter(const capnp::ParsedSchema&, const std::string&); + ~PackedWriter(); + PackedWriter(const PackedWriter&) = delete; + PackedWriter& operator=(const PackedWriter&) = delete; + Writer writer() const; + std::vector bytes() const; + + private: + struct Impl; + std::unique_ptr impl_; +}; +} // namespace rfl::capnproto::detail +#endif diff --git a/include/rfl/capnproto/NativeHandle.hpp b/include/rfl/capnproto/NativeHandle.hpp new file mode 100644 index 000000000..4879efb93 --- /dev/null +++ b/include/rfl/capnproto/NativeHandle.hpp @@ -0,0 +1,103 @@ +#ifndef RFL_CAPNPROTO_NATIVEHANDLE_HPP_ +#define RFL_CAPNPROTO_NATIVEHANDLE_HPP_ + +#ifndef RFL_CAPNPROTO_MODULE_INTERFACE +#include +#else +namespace capnp { +struct DynamicValue; +struct DynamicStruct; +struct DynamicList; +} // namespace capnp +#endif +#include +#include +#include + +#include "../common.hpp" + +namespace rfl::capnproto::detail { +enum class NativeKind { value, object, list }; + +// The native view is allocated and destroyed in an ordinary translation unit. +// Native access is dependent, so importing read/write does not load KJ's types. +template +class RFL_API NativeHandle { + public: + NativeHandle() = default; + + template + requires(!IsBuilder && requires { typename T::Reads; }) + NativeHandle(const T& _value) + : impl_(make(&_value, kind())) {} + + template + requires(IsBuilder && requires { typename T::Builds; }) + NativeHandle(T _value) : impl_(make(&_value, kind())) {} + + template + decltype(auto) native() const { + if constexpr (IsBuilder) + return *static_cast(native_ptr()); + else + return *static_cast(native_ptr()); + } + + // Retain native access for custom constructors which include Cap'n Proto. + template + auto as() const { + return native().template as(); + } + template + auto getType() const { + return native().getType(); + } + template + auto getSchema() const { + return native().getSchema(); + } + template + auto get(Args&&... _args) const { + return native().get(std::forward(_args)...); + } + template + auto set(Args&&... _args) const { + return native().set(std::forward(_args)...); + } + template + auto init(Args&&... _args) const { + return native().init(std::forward(_args)...); + } + template + auto operator[](T&& _index) const { + return native()[std::forward(_index)]; + } + + private: + template + static constexpr NativeKind kind() { + static_assert(std::is_same_v || + std::is_same_v); + if constexpr (std::is_same_v) + return NativeKind::value; + else if constexpr (std::is_same_v) + return NativeKind::object; + else { + static_assert(std::is_same_v); + return NativeKind::list; + } + } + struct Impl; + static std::shared_ptr make(const void*, NativeKind); + void* native_ptr() const; + std::shared_ptr impl_; +}; + +using ValueReader = NativeHandle; +using StructReader = NativeHandle; +using ListReader = NativeHandle; +using ValueBuilder = NativeHandle; +using StructBuilder = NativeHandle; +using ListBuilder = NativeHandle; +} // namespace rfl::capnproto::detail +#endif diff --git a/include/rfl/capnproto/Reader.hpp b/include/rfl/capnproto/Reader.hpp index eda33add4..7cf345529 100644 --- a/include/rfl/capnproto/Reader.hpp +++ b/include/rfl/capnproto/Reader.hpp @@ -1,8 +1,6 @@ #ifndef RFL_CAPNPROTO_READER_HPP_ #define RFL_CAPNPROTO_READER_HPP_ -#include - #include #include #include @@ -15,29 +13,30 @@ #include "../common.hpp" #include "../internal/is_literal.hpp" #include "../internal/ptr_cast.hpp" +#include "NativeHandle.hpp" namespace rfl::capnproto { class RFL_API Reader { public: struct CapNProtoInputArray { - capnp::DynamicList::Reader val_; + detail::ListReader val_; }; struct CapNProtoInputMap { - capnp::DynamicStruct::Reader val_; + detail::StructReader val_; }; struct CapNProtoInputObject { - capnp::DynamicStruct::Reader val_; + detail::StructReader val_; }; struct CapNProtoInputUnion { - capnp::DynamicStruct::Reader val_; + detail::StructReader val_; }; struct CapNProtoInputVar { - capnp::DynamicValue::Reader val_; + detail::ValueReader val_; }; using InputArrayType = CapNProtoInputArray; @@ -50,107 +49,48 @@ class RFL_API Reader { static constexpr bool has_custom_constructor = (requires(InputVarType var) { T::from_capnproto_obj(var); }); - bool is_empty(const InputVarType& _var) const noexcept { - return _var.val_.getType() == capnp::DynamicValue::VOID; - } + bool is_empty(const InputVarType& _var) const noexcept; template - rfl::Result to_basic_type(const InputVarType& _var) const noexcept { - const auto type = _var.val_.getType(); - if constexpr (std::is_same, std::string>()) { - if (type != capnp::DynamicValue::TEXT) { - return error("Could not cast to string."); - } - return std::string(_var.val_.as().cStr()); - - } else if constexpr (std::is_same, - rfl::Bytestring>() || - std::is_same, - rfl::Vectorstring>()) { - using VectorType = std::remove_cvref_t; - using ValueType = typename VectorType::value_type; - if (type != capnp::DynamicValue::DATA) { - if constexpr (std::is_same, rfl::Bytestring>()) { - return error("Could not cast to bytestring."); - } else { - return error("Could not cast to vectorstring."); - } - } - const auto data = _var.val_.as(); - const auto begin = internal::ptr_cast(data.begin()); - return VectorType(begin, begin + data.size()); - - } else if constexpr (std::is_same, bool>()) { - if (type != capnp::DynamicValue::BOOL) { - return error("Could not cast to boolean."); - } - return _var.val_.as(); - - } else if constexpr (std::is_floating_point>()) { - if (type != capnp::DynamicValue::FLOAT) { - return error("Could not cast to float."); - } - return static_cast(_var.val_.as()); - - } else if constexpr (std::is_integral>()) { - switch (type) { - case capnp::DynamicValue::INT: - return static_cast(_var.val_.as()); - - case capnp::DynamicValue::UINT: - return static_cast(_var.val_.as()); - - default: - return error("Could not cast to an integer."); - } - - } else if constexpr (internal::is_literal_v) { - if (type != capnp::DynamicValue::ENUM) { - return error("Could not cast to an enum."); - } - return T::from_value(_var.val_.as().getRaw()); - - } else { - static_assert(rfl::always_false_v, "Unsupported type."); - } - } - - rfl::Result to_array( - const InputVarType& _var) const noexcept { - if (_var.val_.getType() != capnp::DynamicValue::LIST) { - return error("Could not cast to a list."); - } - return InputArrayType{_var.val_.as()}; - } - - rfl::Result to_object( - const InputVarType& _var) const noexcept { - if (_var.val_.getType() != capnp::DynamicValue::STRUCT) { - return error("Could not cast to a struct."); - } - return InputObjectType{_var.val_.as()}; - } - - rfl::Result to_map(const InputVarType& _var) const noexcept { - if (_var.val_.getType() != capnp::DynamicValue::STRUCT) { - return error("Could not cast to a map."); - } - return InputMapType{_var.val_.as()}; - } - - rfl::Result to_union( - const InputVarType& _var) const noexcept { - if (_var.val_.getType() != capnp::DynamicValue::STRUCT) { - return error("Could not cast to a struct."); - } - return InputUnionType{_var.val_.as()}; + Result to_basic_type(const InputVarType& _var) const noexcept { + using U = std::remove_cvref_t; + if constexpr (std::is_same_v) + return read_string(_var); + else if constexpr (std::is_same_v || + std::is_same_v) { + return read_bytes(_var, std::is_same_v) + .transform([](const auto& _bytes) { + using Value = typename U::value_type; + const auto begin = internal::ptr_cast(_bytes.data()); + return U(begin, begin + _bytes.size()); + }); + } else if constexpr (std::is_same_v) + return read_bool(_var); + else if constexpr (std::is_floating_point_v) + return read_double(_var).transform( + [](auto _v) { return static_cast(_v); }); + else if constexpr (std::is_integral_v) { + if (is_unsigned(_var)) + return read_uint64(_var).transform( + [](auto _v) { return static_cast(_v); }); + return read_int64(_var).transform( + [](auto _v) { return static_cast(_v); }); + } else if constexpr (internal::is_literal_v) + return read_enum(_var).and_then( + [](auto _v) { return T::from_value(_v); }); + else + static_assert(always_false_v, "Unsupported type."); } + Result to_array(const InputVarType&) const noexcept; + Result to_object(const InputVarType&) const noexcept; + Result to_map(const InputVarType&) const noexcept; + Result to_union(const InputVarType&) const noexcept; template std::optional read_array(const ArrayReader& _array_reader, const InputArrayType& _arr) const noexcept { - for (auto element : _arr.val_) { - const auto err = _array_reader.read(InputVarType{std::move(element)}); + for (size_t i = 0; i < array_size(_arr); ++i) { + const auto err = _array_reader.read(array_at(_arr, i)); if (err) { return err; } @@ -162,12 +102,11 @@ class RFL_API Reader { std::optional read_map(const MapReader& _map_reader, const InputMapType& _map) const noexcept { try { - const auto entries = _map.val_.get("entries").as(); - for (auto entry : entries) { - auto s = entry.template as(); - const auto key = s.get("key").as(); - _map_reader.read(std::string_view(key.cStr(), key.size()), - InputVarType{s.get("value")}); + const auto entries = map_entries(_map); + for (size_t i = 0; i < array_size(entries); ++i) { + const auto entry = array_at(entries, i); + const auto key = map_key(entry); + _map_reader.read(key, map_value(entry)); } return std::nullopt; } catch (std::exception& e) { @@ -178,9 +117,8 @@ class RFL_API Reader { template std::optional read_object(const ObjectReader& _object_reader, const InputObjectType& _obj) const noexcept { - int i = 0; - for (auto field : _obj.val_.getSchema().getFields()) { - _object_reader.read(i++, InputVarType{_obj.val_.get(field)}); + for (size_t i = 0; i < object_size(_obj); ++i) { + _object_reader.read(i, object_at(_obj, i)); } return std::nullopt; } @@ -192,9 +130,8 @@ class RFL_API Reader { if (!opt_pair) { return error("Could not get the discriminant."); } - const auto& [field, disc] = *opt_pair; - return UnionReaderType::read(*this, disc, - InputVarType{_union.val_.get(field)}); + const auto& [value, disc] = *opt_pair; + return UnionReaderType::read(*this, disc, value); } template @@ -208,10 +145,25 @@ class RFL_API Reader { } private: - std::optional> - identify_discriminant(const InputUnionType& _union) const noexcept; + Result read_string(const InputVarType&) const noexcept; + Result> read_bytes(const InputVarType&, + bool) const noexcept; + Result read_bool(const InputVarType&) const noexcept; + Result read_double(const InputVarType&) const noexcept; + Result read_int64(const InputVarType&) const noexcept; + Result read_uint64(const InputVarType&) const noexcept; + Result read_enum(const InputVarType&) const noexcept; + bool is_unsigned(const InputVarType&) const noexcept; + size_t array_size(const InputArrayType&) const; + InputVarType array_at(const InputArrayType&, size_t) const; + size_t object_size(const InputObjectType&) const; + InputVarType object_at(const InputObjectType&, size_t) const; + InputArrayType map_entries(const InputMapType&) const; + std::string_view map_key(const InputVarType&) const; + InputVarType map_value(const InputVarType&) const; + std::optional> identify_discriminant( + const InputUnionType& _union) const noexcept; }; } // namespace rfl::capnproto - #endif diff --git a/include/rfl/capnproto/Schema.hpp b/include/rfl/capnproto/Schema.hpp index a453b7fd6..8a87f1426 100644 --- a/include/rfl/capnproto/Schema.hpp +++ b/include/rfl/capnproto/Schema.hpp @@ -1,7 +1,14 @@ #ifndef RFL_CAPNPROTO_SCHEMA_HPP_ #define RFL_CAPNPROTO_SCHEMA_HPP_ +#ifndef RFL_CAPNPROTO_MODULE_INTERFACE #include +#else +namespace capnp { +class SchemaParser; +class ParsedSchema; +} // namespace capnp +#endif #include diff --git a/include/rfl/capnproto/SchemaImpl.hpp b/include/rfl/capnproto/SchemaImpl.hpp index b45fe4d8f..6303188f7 100644 --- a/include/rfl/capnproto/SchemaImpl.hpp +++ b/include/rfl/capnproto/SchemaImpl.hpp @@ -1,7 +1,14 @@ #ifndef RFL_CAPNPROTO_SCHEMAIMPL_HPP_ #define RFL_CAPNPROTO_SCHEMAIMPL_HPP_ +#ifndef RFL_CAPNPROTO_MODULE_INTERFACE #include +#else +namespace capnp { +class SchemaParser; +class ParsedSchema; +} // namespace capnp +#endif #include @@ -14,13 +21,13 @@ class RFL_API SchemaImpl { public: SchemaImpl(const std::string& _str); - ~SchemaImpl() = default; + ~SchemaImpl(); /// The JSON string used to create this schema. const std::string& str() const { return str_; } /// The interface used to create new values. - const capnp::ParsedSchema& value() const { return *schema_; }; + const capnp::ParsedSchema& value() const; private: static capnp::ParsedSchema make_schema(const std::string& _str, diff --git a/include/rfl/capnproto/Writer.hpp b/include/rfl/capnproto/Writer.hpp index 3767fb0cb..f0673bfc9 100644 --- a/include/rfl/capnproto/Writer.hpp +++ b/include/rfl/capnproto/Writer.hpp @@ -1,45 +1,46 @@ #ifndef RFL_CAPNPROTO_WRITER_HPP_ #define RFL_CAPNPROTO_WRITER_HPP_ -#include -#include - #include #include #include #include #include +#include +#include #include "../Bytestring.hpp" #include "../Vectorstring.hpp" #include "../always_false.hpp" #include "../common.hpp" #include "../internal/is_literal.hpp" +#include "../internal/ptr_cast.hpp" +#include "NativeHandle.hpp" namespace rfl::capnproto { class RFL_API Writer { public: struct CapnProtoOutputArray { - capnp::DynamicList::Builder val_; + detail::ListBuilder val_; size_t ix_ = 0; }; struct CapnProtoOutputMap { - capnp::DynamicStruct::Builder val_; + detail::StructBuilder val_; size_t ix_ = 0; }; struct CapnProtoOutputObject { - capnp::DynamicStruct::Builder val_; + detail::StructBuilder val_; }; struct CapnProtoOutputUnion { - capnp::DynamicStruct::Builder val_; + detail::StructBuilder val_; }; struct CapnProtoOutputVar { - capnp::DynamicValue::Builder val_; + detail::ValueBuilder val_; }; using OutputArrayType = CapnProtoOutputArray; @@ -48,7 +49,9 @@ class RFL_API Writer { using OutputUnionType = CapnProtoOutputUnion; using OutputVarType = CapnProtoOutputVar; - Writer(capnp::DynamicStruct::Builder* _root); + template + requires std::is_same_v + Writer(T* _root) : root_(_root) {} ~Writer(); @@ -156,113 +159,24 @@ class RFL_API Writer { template OutputVarType add_value_to_array(const T& _var, OutputArrayType* _parent) const { - if constexpr (std::is_same, std::string>()) { - _parent->val_.set(_parent->ix_++, _var.c_str()); - - } else if constexpr (std::is_same, - rfl::Bytestring>() || - std::is_same, - rfl::Vectorstring>()) { - const auto array_ptr = kj::ArrayPtr( - internal::ptr_cast(_var.data()), _var.size()); - _parent->val_.set(_parent->ix_++, capnp::Data::Reader(array_ptr)); - - } else if constexpr (std::is_floating_point>() || - std::is_same, bool>()) { - _parent->val_.set(_parent->ix_++, _var); - - } else if constexpr (std::is_unsigned>()) { - _parent->val_.set(_parent->ix_++, static_cast(_var)); - - } else if constexpr (std::is_integral>()) { - _parent->val_.set(_parent->ix_++, static_cast(_var)); - - } else if constexpr (internal::is_literal_v) { - return add_value_to_array(_var.value(), _parent); - - } else { - static_assert(rfl::always_false_v, "Unsupported type."); - } - return OutputVarType{}; + return set_array(to_value(_var), _parent); } - template OutputVarType add_value_to_map(const std::string_view& _name, const T& _var, OutputMapType* _parent) const { - auto entries = OutputArrayType{ - .val_ = _parent->val_.get("entries").as(), - .ix_ = _parent->ix_++}; - auto new_entry = add_object_to_array(2, &entries); - add_value_to_object("key", std::string(_name), &new_entry); - return add_value_to_object("value", _var, &new_entry); + auto entry = map_entry(_name, _parent); + return add_value_to_object("value", _var, &entry); } - template OutputVarType add_value_to_object(const std::string_view& _name, const T& _var, OutputObjectType* _parent) const { - if constexpr (std::is_same, std::string>()) { - _parent->val_.set(to_kj_string_ptr(_name), _var.c_str()); - - } else if constexpr (std::is_same, - rfl::Bytestring>()) { - const auto array_ptr = kj::ArrayPtr( - internal::ptr_cast(_var.data()), _var.size()); - _parent->val_.set(to_kj_string_ptr(_name), - capnp::Data::Reader(array_ptr)); - - } else if constexpr (std::is_floating_point>() || - std::is_same, bool>()) { - _parent->val_.set(to_kj_string_ptr(_name), _var); - - } else if constexpr (std::is_unsigned>()) { - _parent->val_.set(to_kj_string_ptr(_name), - static_cast(_var)); - - } else if constexpr (std::is_integral>()) { - _parent->val_.set(to_kj_string_ptr(_name), - static_cast(_var)); - - } else if constexpr (internal::is_literal_v) { - return add_value_to_object(_name, _var.value(), _parent); - - } else { - static_assert(rfl::always_false_v, "Unsupported type."); - } - return OutputVarType{}; + return set_object(_name, to_value(_var), _parent); } - template - OutputVarType add_value_to_union(const size_t _index, const T& _var, + OutputVarType add_value_to_union(size_t _index, const T& _var, OutputUnionType* _parent) const { - const auto field = _parent->val_.getSchema().getFields()[_index]; - - if constexpr (std::is_same, std::string>()) { - _parent->val_.set(field, _var.c_str()); - - } else if constexpr (std::is_same, - rfl::Bytestring>()) { - const auto array_ptr = kj::ArrayPtr( - internal::ptr_cast(_var.data()), _var.size()); - _parent->val_.set(field, capnp::Data::Reader(array_ptr)); - - } else if constexpr (std::is_floating_point>() || - std::is_same, bool>()) { - _parent->val_.set(field, _var); - - } else if constexpr (std::is_unsigned>()) { - _parent->val_.set(field, static_cast(_var)); - - } else if constexpr (std::is_integral>()) { - _parent->val_.set(field, static_cast(_var)); - - } else if constexpr (internal::is_literal_v) { - return add_value_to_union(_index, _var.value(), _parent); - - } else { - static_assert(rfl::always_false_v, "Unsupported type."); - } - return OutputVarType{}; + return set_union(_index, to_value(_var), _parent); } void end_array(OutputArrayType* /*_arr*/) const {} @@ -272,14 +186,35 @@ class RFL_API Writer { void end_object(OutputObjectType* /*_obj*/) const {} private: - kj::StringPtr to_kj_string_ptr(const std::string_view& _str) const { - return kj::StringPtr(_str.data(), _str.size()); + using BasicValue = std::variant, bool, double, + uint64_t, int64_t>; + template + static BasicValue to_value(const T& _var) { + using U = std::remove_cvref_t; + if constexpr (std::is_same_v || std::is_same_v) + return _var; + else if constexpr (std::is_same_v || + std::is_same_v) { + const auto begin = internal::ptr_cast(_var.data()); + return std::vector(begin, begin + _var.size()); + } else if constexpr (std::is_floating_point_v) + return static_cast(_var); + else if constexpr (std::is_unsigned_v) + return static_cast(_var); + else if constexpr (std::is_integral_v) + return static_cast(_var); + else if constexpr (internal::is_literal_v) + return to_value(_var.value()); + else + static_assert(always_false_v, "Unsupported type."); } - - private: - capnp::DynamicStruct::Builder* root_; + OutputObjectType map_entry(const std::string_view&, OutputMapType*) const; + OutputVarType set_array(const BasicValue&, OutputArrayType*) const; + OutputVarType set_object(const std::string_view&, const BasicValue&, + OutputObjectType*) const; + OutputVarType set_union(size_t, const BasicValue&, OutputUnionType*) const; + void* root_; }; } // namespace rfl::capnproto - #endif diff --git a/include/rfl/capnproto/read.hpp b/include/rfl/capnproto/read.hpp index 609797d4f..6ac3a6704 100644 --- a/include/rfl/capnproto/read.hpp +++ b/include/rfl/capnproto/read.hpp @@ -1,19 +1,14 @@ #ifndef RFL_CAPNPROTO_READ_HPP_ #define RFL_CAPNPROTO_READ_HPP_ -#include -#include -#include - #include #include #include "../Processors.hpp" #include "../SnakeCaseToCamelCase.hpp" #include "../concepts.hpp" -//#include "../internal/ptr_cast.hpp" -//#include "../internal/strings/strings.hpp" #include "../internal/wrap_in_rfl_array_t.hpp" +#include "Buffers.hpp" #include "Parser.hpp" #include "Reader.hpp" #include "Schema.hpp" @@ -37,15 +32,10 @@ template Result> read( const concepts::ByteLike auto* _bytes, const size_t _size, const Schema& _schema) { - const auto array_ptr = kj::ArrayPtr( - internal::ptr_cast(_bytes), _size); - auto input_stream = kj::ArrayInputStream(array_ptr); - auto message_reader = capnp::PackedMessageReader(input_stream); const auto root_name = get_root_name, Ps...>(); - const auto root_schema = _schema.value().getNested(root_name.c_str()); - const auto input_var = InputVarType{ - message_reader.getRoot(root_schema.asStruct())}; - return read(input_var); + const auto message = + detail::PackedReader(_bytes, _size, _schema.value(), root_name); + return read(message.root()); } /// Parses an object from CAPNPROTO using reflection. diff --git a/include/rfl/capnproto/to_schema.hpp b/include/rfl/capnproto/to_schema.hpp index 2a6e96a2f..525abd3ee 100644 --- a/include/rfl/capnproto/to_schema.hpp +++ b/include/rfl/capnproto/to_schema.hpp @@ -38,7 +38,7 @@ struct SchemaHolder { }; template -static const SchemaHolder schema_holder = +inline const SchemaHolder schema_holder = SchemaHolder::make(); /// Returns the Cap'n Proto schema for a class. diff --git a/include/rfl/capnproto/write.hpp b/include/rfl/capnproto/write.hpp index 78949ece3..15271537a 100644 --- a/include/rfl/capnproto/write.hpp +++ b/include/rfl/capnproto/write.hpp @@ -1,22 +1,14 @@ #ifndef RFL_CAPNPROTO_WRITE_HPP_ #define RFL_CAPNPROTO_WRITE_HPP_ -#include -#include -#include -#include -#include -#include - #include #include #include "../SnakeCaseToCamelCase.hpp" #include "../internal/ptr_cast.hpp" -//#include "../internal/strings/strings.hpp" #include "../parsing/Parent.hpp" +#include "Buffers.hpp" #include "Parser.hpp" -//#include "Schema.hpp" #include "Writer.hpp" #include "get_root_name.hpp" #include "to_schema.hpp" @@ -32,18 +24,11 @@ std::vector write(const auto& _obj, const auto& _schema) { static_assert(std::is_same(), "The schema must be compatible with the type to write."); const auto root_name = get_root_name(); - const auto root_schema = _schema.value().getNested(root_name.c_str()); - capnp::MallocMessageBuilder message_builder; - auto root = - message_builder.initRoot(root_schema.asStruct()); - const auto writer = Writer(&root); + const auto message = detail::PackedWriter(_schema.value(), root_name); + const auto writer = message.writer(); Parser>::write( writer, _obj, typename ParentType::Root{}); - kj::VectorOutputStream output_stream; - capnp::writePackedMessage(output_stream, message_builder); - auto arr_ptr = output_stream.getArray(); - return std::vector(internal::ptr_cast(arr_ptr.begin()), - internal::ptr_cast(arr_ptr.end())); + return message.bytes(); } /// Returns CAPNPROTO bytes. @@ -63,7 +48,8 @@ std::ostream& write(const auto& _obj, std::ostream& _stream) { } template -std::ostream& write(const auto& _obj, const auto& _schema, std::ostream& _stream) { +std::ostream& write(const auto& _obj, const auto& _schema, + std::ostream& _stream) { auto buffer = write(_obj, _schema); _stream.write(buffer.data(), buffer.size()); return _stream; diff --git a/include/rfl/csv/Settings.hpp b/include/rfl/csv/Settings.hpp index bf9573a4f..0e5505528 100644 --- a/include/rfl/csv/Settings.hpp +++ b/include/rfl/csv/Settings.hpp @@ -1,8 +1,8 @@ #ifndef RFL_CSV_SETTINGS_HPP_ #define RFL_CSV_SETTINGS_HPP_ -#include -#include +#include +#include #include "../Settings.hpp" #include "../internal/deprecated_with.hpp" @@ -36,7 +36,7 @@ struct Settings { const bool escaping = false; /// Escaping character (if escaping is true). Only relevant for reading. - const char escape_char = arrow::csv::kDefaultEscapeChar; + const char escape_char = '\\'; /// Whether values are allowed to contain CR (0x0d) and LF (0x0a) /// characters. Only relevant for reading. diff --git a/include/rfl/csv/Table.hpp b/include/rfl/csv/Table.hpp new file mode 100644 index 000000000..86302d039 --- /dev/null +++ b/include/rfl/csv/Table.hpp @@ -0,0 +1,13 @@ +#ifndef RFL_CSV_TABLE_HPP_ +#define RFL_CSV_TABLE_HPP_ + +#include "../parsing/tabular/ArrowBridge.hpp" +#include "Settings.hpp" + +namespace rfl::csv::detail { +RFL_API Result> read_table(const char*, size_t, + const Settings&); +RFL_API Ref write_table(const std::shared_ptr&, + const Settings&); +} // namespace rfl::csv::detail +#endif diff --git a/include/rfl/csv/read.hpp b/include/rfl/csv/read.hpp index 4e6fff4b0..c0e2daada 100644 --- a/include/rfl/csv/read.hpp +++ b/include/rfl/csv/read.hpp @@ -1,82 +1,42 @@ #ifndef RFL_CSV_READ_HPP_ #define RFL_CSV_READ_HPP_ -#include -#include - #include #include #include -//#include "../Processors.hpp" #include "../Result.hpp" -//#include "../concepts.hpp" #include "../internal/wrap_in_rfl_array_t.hpp" #include "../parsing/tabular/ArrowReader.hpp" #include "Settings.hpp" +#include "Table.hpp" namespace rfl::csv { -/// Parses an object from CSV bytes using reflection (with raw pointer and size). -/// CSV (Comma-Separated Values) is a text format for tabular data where each line represents a row. -/// Uses Apache Arrow for efficient CSV parsing. The input must be an array of structs, where each -/// struct becomes a row and each field becomes a column. +/// Parses an object from CSV bytes using reflection (with raw pointer and +/// size). CSV (Comma-Separated Values) is a text format for tabular data where +/// each line represents a row. Uses Apache Arrow for efficient CSV parsing. The +/// input must be an array of structs, where each struct becomes a row and each +/// field becomes a column. /// @tparam T The type to parse into (must be an array of structs) /// @tparam Ps Processors to apply during parsing (transforms the data) /// @param _str Pointer to CSV text data /// @param _size The size of the CSV data in bytes /// @param _settings Optional CSV parsing settings (delimiter, quoting, etc.) -/// @return Result containing either an array of parsed objects or an error message +/// @return Result containing either an array of parsed objects or an error +/// message template Result> read( const char* _str, const size_t _size, const Settings& _settings = Settings{}) { - arrow::io::IOContext io_context = arrow::io::default_io_context(); - - const auto buffer = std::make_shared( - internal::ptr_cast(_str), _size); - - std::shared_ptr input = - std::make_shared(buffer); - - auto read_options = arrow::csv::ReadOptions::Defaults(); - auto convert_options = arrow::csv::ConvertOptions::Defaults(); - convert_options.null_values = - std::vector({_settings.null_string}); - convert_options.strings_can_be_null = true; - - auto parse_options = arrow::csv::ParseOptions::Defaults(); - parse_options.delimiter = _settings.delimiter; - parse_options.quoting = _settings.quoting; - parse_options.quote_char = _settings.quote_char; - parse_options.double_quote = _settings.double_quote; - parse_options.escaping = _settings.escaping; - parse_options.escape_char = _settings.escape_char; - parse_options.newlines_in_values = _settings.newlines_in_values; - parse_options.ignore_empty_lines = _settings.ignore_empty_lines; - - auto maybe_reader = arrow::csv::TableReader::Make( - io_context, input, read_options, parse_options, convert_options); - - if (!maybe_reader.ok()) { - return error("Could not construct CSV reader: " + - maybe_reader.status().message()); - } - - std::shared_ptr reader = *maybe_reader; - - auto maybe_table = reader->Read(); - if (!maybe_table.ok()) { - return error("Could not read table: " + maybe_table.status().message()); - } - - const std::shared_ptr table = *maybe_table; + const auto table = detail::read_table(_str, _size, _settings); + if (!table) return error(table.error().what()); using ArrowReader = parsing::tabular::ArrowReader; - return ArrowReader::make(table).and_then( + return ArrowReader::make(*table).and_then( [](const auto& _r) { return _r.read(); }); } @@ -85,7 +45,8 @@ Result> read( /// @tparam Ps Processors to apply during parsing (transforms the data) /// @param _str The CSV string to parse /// @param _settings Optional CSV parsing settings (delimiter, quoting, etc.) -/// @return Result containing either an array of parsed objects or an error message +/// @return Result containing either an array of parsed objects or an error +/// message template auto read(const std::string_view _str, const Settings& _settings = Settings{}) { return read(_str.data(), _str.size(), _settings); @@ -97,7 +58,8 @@ auto read(const std::string_view _str, const Settings& _settings = Settings{}) { /// @tparam Ps Processors to apply during parsing (transforms the data) /// @param _stream The input stream containing CSV text /// @param _settings Optional CSV parsing settings (delimiter, quoting, etc.) -/// @return Result containing either an array of parsed objects or an error message +/// @return Result containing either an array of parsed objects or an error +/// message template auto read(std::istream& _stream, const Settings& _settings = Settings{}) { std::istreambuf_iterator begin(_stream), end; diff --git a/include/rfl/csv/write.hpp b/include/rfl/csv/write.hpp index 9060566b4..4447c71d7 100644 --- a/include/rfl/csv/write.hpp +++ b/include/rfl/csv/write.hpp @@ -1,29 +1,25 @@ #ifndef RFL_CSV_WRITE_HPP_ #define RFL_CSV_WRITE_HPP_ -#include -#include -#include - #include #include #include #include -//#include "../Processors.hpp" -//#include "../Ref.hpp" #include "../parsing/tabular/ArrowWriter.hpp" #include "Settings.hpp" +#include "Table.hpp" namespace rfl::csv { /// Converts an array of objects to CSV and returns an Arrow buffer. -/// CSV (Comma-Separated Values) is a text format for tabular data where each line represents a row. -/// Uses Apache Arrow for efficient CSV generation. Each struct in the array becomes a row, -/// and each field becomes a column. +/// CSV (Comma-Separated Values) is a text format for tabular data where each +/// line represents a row. Uses Apache Arrow for efficient CSV generation. Each +/// struct in the array becomes a row, and each field becomes a column. /// @tparam Ps Processors to apply during serialization (transforms the data) /// @param _arr The array of objects to serialize to CSV -/// @param _settings CSV writing settings (delimiter, quoting style, batch size, etc.) +/// @param _settings CSV writing settings (delimiter, quoting style, batch size, +/// etc.) /// @return A reference-counted Arrow buffer containing the CSV text template Ref to_buffer(const auto& _arr, const Settings& _settings) { @@ -34,61 +30,39 @@ Ref to_buffer(const auto& _arr, const Settings& _settings) { Ps...>(_settings.batch_size) .to_table(_arr); - const auto output_buffer = arrow::io::BufferOutputStream::Create(); - - if (!output_buffer.ok()) { - throw std::runtime_error(output_buffer.status().message()); - } - - auto options = arrow::csv::WriteOptions::Defaults(); - options.batch_size = _settings.batch_size; - options.delimiter = _settings.delimiter; - options.null_string = _settings.null_string; - options.quoting_style = _settings.quoting ? arrow::csv::QuotingStyle::Needed - : arrow::csv::QuotingStyle::None; - - const auto status = - arrow::csv::WriteCSV(*table, options, output_buffer.ValueOrDie().get()); - - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - - const auto buffer = output_buffer.ValueOrDie()->Finish(); - - if (!buffer.ok()) { - throw std::runtime_error(output_buffer.status().message()); - } - - return Ref::make(buffer.ValueOrDie()).value(); + return detail::write_table(table, _settings); } /// Writes an array of objects to CSV format. -/// Uses compile-time reflection to serialize an array of C++ objects to CSV format. -/// Each struct in the array becomes a row, and each field becomes a column with a header. +/// Uses compile-time reflection to serialize an array of C++ objects to CSV +/// format. Each struct in the array becomes a row, and each field becomes a +/// column with a header. /// @tparam Ps Processors to apply during serialization (transforms the data) /// @param _arr The array of objects to serialize to CSV -/// @param _settings Optional CSV writing settings (delimiter, quoting style, etc.) +/// @param _settings Optional CSV writing settings (delimiter, quoting style, +/// etc.) /// @return A string containing the CSV representation template std::string write(const auto& _arr, const Settings& _settings = Settings{}) { const auto buffer = to_buffer(_arr, _settings); - const auto view = std::string_view(*buffer); + const auto view = parsing::tabular::buffer_view(buffer); return std::string(view); } /// Writes a CSV representation into an ostream. -/// Uses compile-time reflection to serialize an array of C++ objects to CSV and write to a stream. +/// Uses compile-time reflection to serialize an array of C++ objects to CSV and +/// write to a stream. /// @tparam Ps Processors to apply during serialization (transforms the data) /// @param _arr The array of objects to serialize to CSV /// @param _stream The output stream to write CSV text to -/// @param _settings Optional CSV writing settings (delimiter, quoting style, etc.) +/// @param _settings Optional CSV writing settings (delimiter, quoting style, +/// etc.) /// @return The output stream (for chaining) template std::ostream& write(const auto& _arr, std::ostream& _stream, const Settings& _settings = Settings{}) { auto buffer = to_buffer(_arr, _settings); - _stream << std::string_view(*buffer); + _stream << parsing::tabular::buffer_view(buffer); return _stream; } diff --git a/include/rfl/parquet/Settings.hpp b/include/rfl/parquet/Settings.hpp index 026b7f7df..8b5a74a2a 100644 --- a/include/rfl/parquet/Settings.hpp +++ b/include/rfl/parquet/Settings.hpp @@ -1,8 +1,9 @@ #ifndef RFL_PARQUET_SETTINGS_HPP_ #define RFL_PARQUET_SETTINGS_HPP_ -#include -#include +#include + +#include #include "../Settings.hpp" #include "../internal/deprecated_with.hpp" diff --git a/include/rfl/parquet/Table.hpp b/include/rfl/parquet/Table.hpp new file mode 100644 index 000000000..4788156b2 --- /dev/null +++ b/include/rfl/parquet/Table.hpp @@ -0,0 +1,13 @@ +#ifndef RFL_PARQUET_TABLE_HPP_ +#define RFL_PARQUET_TABLE_HPP_ + +#include "../parsing/tabular/ArrowBridge.hpp" +#include "Settings.hpp" + +namespace rfl::parquet::detail { +RFL_API Result> read_table(const uint8_t*, + size_t); +RFL_API Ref write_table(const std::shared_ptr&, + const Settings&); +} // namespace rfl::parquet::detail +#endif diff --git a/include/rfl/parquet/read.hpp b/include/rfl/parquet/read.hpp index e5f8b1d4f..9cd3e1af0 100644 --- a/include/rfl/parquet/read.hpp +++ b/include/rfl/parquet/read.hpp @@ -1,9 +1,6 @@ #ifndef RFL_PARQUET_READ_HPP_ #define RFL_PARQUET_READ_HPP_ -#include -#include - #include #include @@ -11,6 +8,7 @@ #include "../concepts.hpp" #include "../internal/wrap_in_rfl_array_t.hpp" #include "../parsing/tabular/ArrowReader.hpp" +#include "Table.hpp" namespace rfl::parquet { @@ -23,32 +21,14 @@ namespace rfl::parquet { template Result> read( const concepts::ByteLike auto* _bytes, const size_t _size) { - arrow::MemoryPool* pool = arrow::default_memory_pool(); - - const auto buffer = std::make_shared( - internal::ptr_cast(_bytes), _size); - - const auto input = std::make_shared(buffer); - - auto arrow_reader = ::parquet::arrow::OpenFile(input, pool); - - if (!arrow_reader.ok()) { - return error(std::string("Could not generate the arrow reader: ") + - arrow_reader.status().message()); - } - - std::shared_ptr table; - - const auto status = arrow_reader.ValueOrDie()->ReadTable(&table); - - if (!status.ok()) { - return error("Could not read table: " + status.message()); - } + const auto table = + detail::read_table(internal::ptr_cast(_bytes), _size); + if (!table) return error(table.error().what()); using ArrowReader = parsing::tabular::ArrowReader< T, parsing::tabular::SerializationType::parquet, Ps...>; - return ArrowReader::make(table).and_then( + return ArrowReader::make(*table).and_then( [](const auto& _r) { return _r.read(); }); } diff --git a/include/rfl/parquet/write.hpp b/include/rfl/parquet/write.hpp index 8c0b9f03d..a85655a14 100644 --- a/include/rfl/parquet/write.hpp +++ b/include/rfl/parquet/write.hpp @@ -1,15 +1,13 @@ #ifndef RFL_PARQUET_WRITE_HPP_ #define RFL_PARQUET_WRITE_HPP_ -#include -#include - #include #include #include #include "../parsing/tabular/ArrowWriter.hpp" #include "Settings.hpp" +#include "Table.hpp" namespace rfl::parquet { @@ -29,34 +27,7 @@ Ref to_buffer(const auto& _arr, const Settings& _settings) { _settings.chunksize) .to_table(_arr); - const auto props = ::parquet::WriterProperties::Builder() - .compression(_settings.compression) - ->build(); - - const auto arrow_props = - ::parquet::ArrowWriterProperties::Builder().store_schema()->build(); - - const auto output_buffer = arrow::io::BufferOutputStream::Create(); - - if (!output_buffer.ok()) { - throw std::runtime_error(output_buffer.status().message()); - } - - const auto status = ::parquet::arrow::WriteTable( - *table.get(), arrow::default_memory_pool(), output_buffer.ValueOrDie(), - _settings.chunksize, props, arrow_props); - - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - - const auto buffer = output_buffer.ValueOrDie()->Finish(); - - if (!buffer.ok()) { - throw std::runtime_error(output_buffer.status().message()); - } - - return Ref::make(buffer.ValueOrDie()).value(); + return detail::write_table(table, _settings); } /// @brief Returns parquet bytes as a vector of chars. @@ -69,7 +40,7 @@ template std::vector write(const auto& _arr, const Settings& _settings = Settings{}) { const auto buffer = to_buffer(_arr, _settings); - const auto view = std::string_view(*buffer); + const auto view = parsing::tabular::buffer_view(buffer); return std::vector(view.begin(), view.end()); } @@ -84,7 +55,7 @@ template std::ostream& write(const auto& _arr, std::ostream& _stream, const Settings& _settings = Settings{}) { auto buffer = to_buffer(_arr, _settings); - _stream << std::string_view(*buffer); + _stream << parsing::tabular::buffer_view(buffer); return _stream; } diff --git a/include/rfl/parsing/tabular/ArrowBridge.hpp b/include/rfl/parsing/tabular/ArrowBridge.hpp new file mode 100644 index 000000000..f61fc943a --- /dev/null +++ b/include/rfl/parsing/tabular/ArrowBridge.hpp @@ -0,0 +1,69 @@ +#ifndef RFL_PARSING_TABULAR_ARROWBRIDGE_HPP_ +#define RFL_PARSING_TABULAR_ARROWBRIDGE_HPP_ + +#ifndef RFL_ARROW_MODULE_INTERFACE +#include +#else +#include +#endif +#include +#include +#include +#include +#include + +#include "../../Ref.hpp" +#include "../../Result.hpp" +#include "../../common.hpp" + +namespace rfl::parsing::tabular { + +enum class SerializationType { csv, parquet }; + +// Owns a native builder without instantiating Arrow's implementation in +// importers. +class RFL_API ArrowBuilder { + public: + explicit ArrowBuilder(std::shared_ptr _impl); + void append_null(); + std::shared_ptr finish(); + arrow::ArrayBuilder* get() const; + + private: + std::shared_ptr impl_; +}; + +RFL_API std::shared_ptr binary_data_type(); +RFL_API ArrowBuilder make_binary_builder(); +RFL_API void append_binary(ArrowBuilder*, const uint8_t*, size_t); +RFL_API Result> binary_array( + const std::shared_ptr&); +RFL_API std::string_view binary_value(const Ref&, int64_t); +RFL_API std::shared_ptr timestamp_data_type(); +RFL_API ArrowBuilder make_timestamp_builder(); +RFL_API void append_timestamp(ArrowBuilder*, int64_t); +RFL_API Result> timestamp_array( + const std::shared_ptr&, + Result (*)(std::string_view)); +RFL_API int64_t timestamp_value(const Ref&, int64_t); +RFL_API bool array_is_null(const Ref&, int64_t); +RFL_API int64_t array_length(const Ref&); +RFL_API int num_chunks(const Ref&); +RFL_API std::shared_ptr array_chunk( + const Ref&, int); +RFL_API Result> table_column(const Ref&, + const std::string&); +RFL_API std::shared_ptr make_arrow_field( + const std::string&, const std::shared_ptr&); +RFL_API std::shared_ptr make_schema( + const std::vector>&); +RFL_API std::shared_ptr make_table( + const std::shared_ptr&, + const std::vector>&); +RFL_API std::shared_ptr make_chunked_array( + const std::vector>&, + const std::shared_ptr&); +RFL_API std::string_view buffer_view(const Ref&); + +} // namespace rfl::parsing::tabular +#endif diff --git a/include/rfl/parsing/tabular/ArrowReader.hpp b/include/rfl/parsing/tabular/ArrowReader.hpp index 166b3135c..cbc2fe6b9 100644 --- a/include/rfl/parsing/tabular/ArrowReader.hpp +++ b/include/rfl/parsing/tabular/ArrowReader.hpp @@ -1,8 +1,6 @@ #ifndef RFL_PARSING_TABULAR_ARROWREADER_HPP_ #define RFL_PARSING_TABULAR_ARROWREADER_HPP_ -#include - #include #include #include @@ -23,6 +21,7 @@ #include "../../to_view.hpp" #include "../../view_t.hpp" #include "../call_destructors_where_necessary.hpp" +#include "ArrowBridge.hpp" #include "make_chunked_array_iterators.hpp" namespace rfl::parsing::tabular { diff --git a/include/rfl/parsing/tabular/ArrowTypes.hpp b/include/rfl/parsing/tabular/ArrowTypes.hpp index 8544a07c1..b482059f5 100644 --- a/include/rfl/parsing/tabular/ArrowTypes.hpp +++ b/include/rfl/parsing/tabular/ArrowTypes.hpp @@ -1,11 +1,8 @@ #ifndef RFL_PARSING_TABULAR_ARROWTYPES_HPP_ #define RFL_PARSING_TABULAR_ARROWTYPES_HPP_ -#include - #include #include -#include #include #include "../../Box.hpp" @@ -16,1030 +13,239 @@ #include "../../Tuple.hpp" #include "../../concepts.hpp" #include "../../enums.hpp" -#include "../../internal/StringLiteral.hpp" #include "../../internal/has_reflection_type_v.hpp" #include "../../internal/ptr_cast.hpp" -#include "../../named_tuple_t.hpp" -#include "arrow_builder_operations.hpp" +#include "ArrowBridge.hpp" namespace rfl::parsing::tabular { -enum class SerializationType { csv, parquet }; - template struct ArrowTypes; -/** - * @brief Transforms a numerical array to the desired type T. - * @tparam T The desired type. - * @tparam _s The serialization type. - * @param _arr The array to transform. - * @return The transformed array or an error. - */ -template -Result::ArrayType>> transform_numerical_array( - const std::shared_ptr& _arr) noexcept; - -template -struct ArrowTypes { - using ArrayType = arrow::BooleanArray; - using BuilderType = arrow::BooleanBuilder; - - /** - * @brief Returns the Arrow data type for boolean. - * @return The Arrow data type. - */ - static auto data_type() { return arrow::boolean(); } - - /** - * @brief Adds a boolean value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const bool _val, BuilderType* _builder) { - const auto status = _builder->Append(_val); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the boolean array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The boolean array or an error. - */ +template +struct ArrowScalar; +template <> +struct RFL_API ArrowScalar { + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static std::shared_ptr data_type(); + static void add_to_builder(const bool& _value, BuilderType* _builder); static Result> get_array( - const std::shared_ptr& _arr) { - if (_arr->type()->Equals(data_type())) { - return Ref::make(std::static_pointer_cast(_arr)); - } else { - return error("Expected boolean array, got " + _arr->type()->ToString() + - "."); - } - } - - /** - * @brief Returns the boolean value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The boolean value. - */ - static Result get_value(const Ref& _chunk, - const int64_t _ix) { - return _chunk->Value(_ix); - } - - /** - * @brief Creates a builder for boolean arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } + const std::shared_ptr& _arr); + static Result get_value(const Ref& _arr, int64_t _ix); + static BuilderType make_builder(); }; - template -struct ArrowTypes { - using ArrayType = arrow::UInt8Array; - using BuilderType = arrow::UInt8Builder; - using T = uint8_t; - - /** - * @brief Returns the Arrow data type for uint8. - * @return The Arrow data type. - */ - static auto data_type() { return arrow::uint8(); } - - /** - * @brief Adds a uint8 value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const auto _val, BuilderType* _builder) { - const auto status = _builder->Append(_val); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the uint8 array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The uint8 array or an error. - */ +struct ArrowTypes : ArrowScalar {}; +template <> +struct RFL_API ArrowScalar { + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static std::shared_ptr data_type(); + static void add_to_builder(const uint8_t& _value, BuilderType* _builder); static Result> get_array( - const std::shared_ptr& _arr) { - return transform_numerical_array(_arr); - } - - /** - * @brief Returns the uint8 value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The uint8 value. - */ - static Result get_value(const Ref& _chunk, - const int64_t _ix) { - return _chunk->Value(_ix); - } - - /** - * @brief Creates a builder for uint8 arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } + const std::shared_ptr& _arr); + static Result get_value(const Ref& _arr, int64_t _ix); + static BuilderType make_builder(); }; - template -struct ArrowTypes { - using ArrayType = arrow::UInt16Array; - using BuilderType = arrow::UInt16Builder; - using T = uint16_t; - - /** - * @brief Returns the Arrow data type for uint16. - * @return The Arrow data type. - */ - static auto data_type() { return arrow::uint16(); } - - /** - * @brief Adds a uint16 value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const auto _val, BuilderType* _builder) { - const auto status = _builder->Append(_val); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the uint16 array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The uint16 array or an error. - */ +struct ArrowTypes : ArrowScalar {}; +template <> +struct RFL_API ArrowScalar { + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static std::shared_ptr data_type(); + static void add_to_builder(const uint16_t& _value, BuilderType* _builder); static Result> get_array( - const std::shared_ptr& _arr) { - return transform_numerical_array(_arr); - } - - /** - * @brief Returns the uint16 value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The uint16 value. - */ - static Result get_value(const Ref& _chunk, - const int64_t _ix) { - return _chunk->Value(_ix); - } - - /** - * @brief Creates a builder for uint16 arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } + const std::shared_ptr& _arr); + static Result get_value(const Ref& _arr, int64_t _ix); + static BuilderType make_builder(); }; - template -struct ArrowTypes { - using ArrayType = arrow::UInt32Array; - using BuilderType = arrow::UInt32Builder; - using T = uint32_t; - - /** - * @brief Returns the Arrow data type for uint32. - * @return The Arrow data type. - */ - static auto data_type() { return arrow::uint32(); } - - /** - * @brief Adds a uint32 value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const auto _val, BuilderType* _builder) { - const auto status = _builder->Append(_val); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the uint32 array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The uint32 array or an error. - */ +struct ArrowTypes : ArrowScalar {}; +template <> +struct RFL_API ArrowScalar { + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static std::shared_ptr data_type(); + static void add_to_builder(const uint32_t& _value, BuilderType* _builder); static Result> get_array( - const std::shared_ptr& _arr) { - return transform_numerical_array(_arr); - } - - /** - * @brief Returns the uint32 value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The uint32 value. - */ - static Result get_value(const Ref& _chunk, - const int64_t _ix) { - return _chunk->Value(_ix); - } - - /** - * @brief Creates a builder for uint32 arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } + const std::shared_ptr& _arr); + static Result get_value(const Ref& _arr, int64_t _ix); + static BuilderType make_builder(); }; - template -struct ArrowTypes { - using ArrayType = arrow::UInt64Array; - using BuilderType = arrow::UInt64Builder; - using T = uint64_t; - - /** - * @brief Returns the Arrow data type for uint64. - * @return The Arrow data type. - */ - static auto data_type() { return arrow::uint64(); } - - /** - * @brief Adds a uint64 value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const auto _val, BuilderType* _builder) { - const auto status = _builder->Append(_val); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the uint64 array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The uint64 array or an error. - */ +struct ArrowTypes : ArrowScalar {}; +template <> +struct RFL_API ArrowScalar { + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static std::shared_ptr data_type(); + static void add_to_builder(const uint64_t& _value, BuilderType* _builder); static Result> get_array( - const std::shared_ptr& _arr) { - return transform_numerical_array(_arr); - } - - /** - * @brief Returns the uint64 value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The uint64 value. - */ - static Result get_value(const Ref& _chunk, - const int64_t _ix) { - return _chunk->Value(_ix); - } - - /** - * @brief Creates a builder for uint64 arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } + const std::shared_ptr& _arr); + static Result get_value(const Ref& _arr, int64_t _ix); + static BuilderType make_builder(); }; - template -struct ArrowTypes { - using ArrayType = arrow::Int8Array; - using BuilderType = arrow::Int8Builder; - using T = int8_t; - - /** - * @brief Returns the Arrow data type for int8. - * @return The Arrow data type. - */ - static auto data_type() { return arrow::int8(); } - - /** - * @brief Adds an int8 value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const auto _val, BuilderType* _builder) { - const auto status = _builder->Append(_val); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the int8 array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The int8 array or an error. - */ +struct ArrowTypes : ArrowScalar {}; +template <> +struct RFL_API ArrowScalar { + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static std::shared_ptr data_type(); + static void add_to_builder(const int8_t& _value, BuilderType* _builder); static Result> get_array( - const std::shared_ptr& _arr) { - return transform_numerical_array(_arr); - } - - /** - * @brief Returns the int8 value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The int8 value. - */ - static Result get_value(const Ref& _chunk, - const int64_t _ix) { - return _chunk->Value(_ix); - } - - /** - * @brief Creates a builder for int8 arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } + const std::shared_ptr& _arr); + static Result get_value(const Ref& _arr, int64_t _ix); + static BuilderType make_builder(); }; - -template -struct ArrowTypes { - using ArrayType = arrow::Int16Array; - using BuilderType = arrow::Int16Builder; - using T = int16_t; - - /** - * @brief Returns the Arrow data type for int16. - * @return The Arrow data type. - */ - static auto data_type() { return arrow::int16(); } - - /** - * @brief Adds an int16 value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const auto _val, BuilderType* _builder) { - const auto status = _builder->Append(_val); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the int16 array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The int16 array or an error. - */ - static Result> get_array( - const std::shared_ptr& _arr) { - return transform_numerical_array(_arr); - } - - /** - * @brief Returns the int16 value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The int16 value. - */ - static Result get_value(const Ref& _chunk, - const int64_t _ix) { - return _chunk->Value(_ix); - } - - /** - * @brief Creates a builder for int16 arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } -}; - template -struct ArrowTypes { - using ArrayType = arrow::Int32Array; - using BuilderType = arrow::Int32Builder; - using T = int32_t; - - /** - * @brief Returns the Arrow data type for int32. - * @return The Arrow data type. - */ - static auto data_type() { return arrow::int32(); } - - /** - * @brief Adds an int32 value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const auto _val, BuilderType* _builder) { - const auto status = _builder->Append(_val); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the int32 array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The int32 array or an error. - */ +struct ArrowTypes : ArrowScalar {}; +template <> +struct RFL_API ArrowScalar { + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static std::shared_ptr data_type(); + static void add_to_builder(const int16_t& _value, BuilderType* _builder); static Result> get_array( - const std::shared_ptr& _arr) { - return transform_numerical_array(_arr); - } - - /** - * @brief Returns the int32 value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The int32 value. - */ - static Result get_value(const Ref& _chunk, - const int64_t _ix) { - return _chunk->Value(_ix); - } - - /** - * @brief Creates a builder for int32 arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } + const std::shared_ptr& _arr); + static Result get_value(const Ref& _arr, int64_t _ix); + static BuilderType make_builder(); }; - template -struct ArrowTypes { - using ArrayType = arrow::Int64Array; - using BuilderType = arrow::Int64Builder; - using T = int64_t; - - /** - * @brief Returns the Arrow data type for int64. - * @return The Arrow data type. - */ - static auto data_type() { return arrow::int64(); } - - /** - * @brief Adds an int64 value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const auto _val, BuilderType* _builder) { - const auto status = _builder->Append(_val); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the int64 array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The int64 array or an error. - */ +struct ArrowTypes : ArrowScalar {}; +template <> +struct RFL_API ArrowScalar { + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static std::shared_ptr data_type(); + static void add_to_builder(const int32_t& _value, BuilderType* _builder); static Result> get_array( - const std::shared_ptr& _arr) { - return transform_numerical_array(_arr); - } - - /** - * @brief Returns the int64 value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The int64 value. - */ - static Result get_value(const Ref& _chunk, - const int64_t _ix) { - return _chunk->Value(_ix); - } - - /** - * @brief Creates a builder for int64 arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } + const std::shared_ptr& _arr); + static Result get_value(const Ref& _arr, int64_t _ix); + static BuilderType make_builder(); }; - template -struct ArrowTypes { - using ArrayType = arrow::FloatArray; - using BuilderType = arrow::FloatBuilder; - using T = float; - - /** - * @brief Returns the Arrow data type for float32. - * @return The Arrow data type. - */ - static auto data_type() { return arrow::float32(); } - - /** - * @brief Adds a float value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const auto _val, BuilderType* _builder) { - const auto status = _builder->Append(_val); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the float array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The float array or an error. - */ +struct ArrowTypes : ArrowScalar {}; +template <> +struct RFL_API ArrowScalar { + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static std::shared_ptr data_type(); + static void add_to_builder(const int64_t& _value, BuilderType* _builder); static Result> get_array( - const std::shared_ptr& _arr) { - return transform_numerical_array(_arr); - } - - /** - * @brief Returns the float value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The float value. - */ - static Result get_value(const Ref& _chunk, - const int64_t _ix) { - return _chunk->Value(_ix); - } - - /** - * @brief Creates a builder for float arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } + const std::shared_ptr& _arr); + static Result get_value(const Ref& _arr, int64_t _ix); + static BuilderType make_builder(); }; - template -struct ArrowTypes { - using ArrayType = arrow::DoubleArray; - using BuilderType = arrow::DoubleBuilder; - using T = double; - - /** - * @brief Returns the Arrow data type for float64. - * @return The Arrow data type. - */ - static auto data_type() { return arrow::float64(); } - - /** - * @brief Adds a double value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const auto _val, BuilderType* _builder) { - const auto status = _builder->Append(_val); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the double array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The double array or an error. - */ +struct ArrowTypes : ArrowScalar {}; +template <> +struct RFL_API ArrowScalar { + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static std::shared_ptr data_type(); + static void add_to_builder(const float& _value, BuilderType* _builder); static Result> get_array( - const std::shared_ptr& _arr) { - return transform_numerical_array(_arr); - } - - /** - * @brief Returns the double value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The double value. - */ - static Result get_value(const Ref& _chunk, - const int64_t _ix) { - return _chunk->Value(_ix); - } - - /** - * @brief Creates a builder for double arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } + const std::shared_ptr& _arr); + static Result get_value(const Ref& _arr, int64_t _ix); + static BuilderType make_builder(); }; - template -struct ArrowTypes { - using ArrayType = arrow::StringArray; - using BuilderType = arrow::StringBuilder; - - /** - * @brief Returns the Arrow data type for string (utf8). - * @return The Arrow data type. - */ - static auto data_type() { return arrow::utf8(); } - - /** - * @brief Adds a string value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const auto& _val, BuilderType* _builder) { - const auto status = append_string(_builder, _val); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the string array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The string array or an error. - */ +struct ArrowTypes : ArrowScalar {}; +template <> +struct RFL_API ArrowScalar { + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static std::shared_ptr data_type(); + static void add_to_builder(const double& _value, BuilderType* _builder); static Result> get_array( - const std::shared_ptr& _arr) { - if (_arr->type()->Equals(data_type())) { - return Ref::make(std::static_pointer_cast(_arr)); - } else { - return error("Expected string array, got " + _arr->type()->ToString() + - "."); - } - } - - /** - * @brief Returns the string value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The string value. - */ - static Result get_value(const Ref& _chunk, - const int64_t _ix) { - return std::string(_chunk->Value(_ix)); - } - - /** - * @brief Creates a builder for string arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } + const std::shared_ptr& _arr); + static Result get_value(const Ref& _arr, int64_t _ix); + static BuilderType make_builder(); +}; +template +struct ArrowTypes : ArrowScalar {}; +template <> +struct RFL_API ArrowScalar { + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static std::shared_ptr data_type(); + static void add_to_builder(const std::string& _value, BuilderType* _builder); + static Result> get_array( + const std::shared_ptr& _arr); + static Result get_value(const Ref& _arr, int64_t _ix); + static BuilderType make_builder(); }; +template +struct ArrowTypes : ArrowScalar {}; template requires enchantum::Enum -struct ArrowTypes { - using ArrayType = arrow::StringArray; - using BuilderType = arrow::StringBuilder; - - /** - * @brief Returns the Arrow data type for enums (utf8). - * @return The Arrow data type. - */ - static auto data_type() { return arrow::utf8(); } - - /** - * @brief Adds an enum value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const T _val, BuilderType* _builder) { - const auto status = append_string(_builder, enum_to_string(_val)); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the enum array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The enum array or an error. - */ - static Result> get_array( - const std::shared_ptr& _arr) { - return ArrowTypes::get_array(_arr); +struct ArrowTypes : ArrowScalar { + static void add_to_builder(T _value, BuilderType* _builder) { + ArrowScalar::add_to_builder(enum_to_string(_value), _builder); } - - /** - * @brief Returns the enum value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The enum value. - */ - static Result get_value(const Ref& _chunk, const int64_t _ix) { - return string_to_enum(std::string(_chunk->Value(_ix))); + static Result get_value(const Ref& _arr, int64_t _ix) { + return ArrowScalar::get_value(_arr, _ix).and_then( + [](const auto& _value) { return string_to_enum(_value); }); } - - /** - * @brief Creates a builder for enum arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } }; template requires concepts::ContiguousByteContainer struct ArrowTypes { - using ArrayType = arrow::BinaryArray; - using BuilderType = arrow::BinaryBuilder; - - /** - * @brief Returns the Arrow data type for binary. - * @return The Arrow data type. - */ - static auto data_type() { return arrow::binary(); } - - /** - * @brief Adds a binary value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const auto& _val, BuilderType* _builder) { - const auto status = _builder->Append( - internal::ptr_cast(_val.data()), _val.size()); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the binary array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The binary array or an error. - */ - static Result> get_array( - const std::shared_ptr& _arr) { - if (_arr->type()->Equals(data_type())) { - return Ref::make(std::static_pointer_cast(_arr)); - - } else if (_arr->type()->Equals(arrow::utf8())) { - return transform_string( - std::static_pointer_cast(_arr)); - - } else { - return error("Expected binary or string array, got " + - _arr->type()->ToString() + "."); - } - } - - /** - * @brief Returns the binary value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The binary value. - */ - static Result get_value(const Ref& _chunk, const int64_t _ix) { - const auto begin = internal::ptr_cast( - _chunk->Value(_ix).data()); - return T(begin, begin + _chunk->Value(_ix).size()); - } - - /** - * @brief Creates a builder for binary arrays. - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } - - /** - * @brief Transforms a string array to a binary array. - * @param _arr The string array. - * @return The binary array or an error. - */ - static Result> transform_string( - const std::shared_ptr& _arr) noexcept { - if (!_arr) { - return error( - "transform_string: std::shared_ptr not set. This is a " - "bug, please report."); - } - - auto builder = arrow::BinaryBuilder(); - - for (int64_t i = 0; i < _arr->length(); ++i) { - if (_arr->IsNull(i)) { - const auto status = builder.AppendNull(); - if (!status.ok()) { - return error(status.message()); - } - } else { - const std::string_view s = _arr->Value(i); - const auto status = builder.Append( - internal::ptr_cast(s.data()), s.size()); - if (!status.ok()) { - return error(status.message()); - } - } - } - - std::shared_ptr res; - const auto status = builder.Finish(&res); - return Ref::make( - std::static_pointer_cast(res)); + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static auto data_type() { return binary_data_type(); } + static auto make_builder() { return make_binary_builder(); } + static void add_to_builder(const T& _value, BuilderType* _builder) { + append_binary(_builder, internal::ptr_cast(_value.data()), + _value.size()); + } + static auto get_array(const std::shared_ptr& _arr) { + return binary_array(_arr); + } + static Result get_value(const Ref& _arr, int64_t _ix) { + const auto value = binary_value(_arr, _ix); + const auto begin = + internal::ptr_cast(value.data()); + return T(begin, begin + value.size()); } }; template struct ArrowTypes, _s> { - enum class TimeUnit { day, second, milli, micro, nano, string }; - - using ArrayType = arrow::TimestampArray; - using BuilderType = arrow::TimestampBuilder; - - /** - * @brief Returns the Arrow data type for timestamps (milli). - * @return The Arrow data type. - */ - static auto data_type() { return arrow::timestamp(arrow::TimeUnit::MILLI); } - - /** - * @brief Adds a timestamp value to the builder. - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const auto& _val, BuilderType* _builder) { - const auto status = _builder->Append(_val.to_time_t() * 1000); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the timestamp array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The timestamp array or an error. - */ - static Result> get_array( - const std::shared_ptr& _arr) { - if (_arr->type()->Equals(data_type())) { - return Ref::make(std::static_pointer_cast(_arr)); - - } else if (_arr->type()->Equals( - arrow::timestamp(arrow::TimeUnit::SECOND))) { - return transform_time_stamp( - std::static_pointer_cast(_arr)); - - } else if (_arr->type()->Equals(arrow::timestamp(arrow::TimeUnit::MICRO))) { - return transform_time_stamp( - std::static_pointer_cast(_arr)); - - } else if (_arr->type()->Equals(arrow::timestamp(arrow::TimeUnit::NANO))) { - return transform_time_stamp( - std::static_pointer_cast(_arr)); - - } else if (_arr->type()->Equals(arrow::date32())) { - return transform_time_stamp( - std::static_pointer_cast(_arr)); - - } else if (_arr->type()->Equals(arrow::date64())) { - return transform_time_stamp( - std::static_pointer_cast(_arr)); - - } else if (_arr->type()->Equals(arrow::utf8())) { - return transform_time_stamp( - std::static_pointer_cast(_arr)); - - } else { - return error("Expected timestamp, date32, date64 or string array, got " + - _arr->type()->ToString() + "."); - } - } - - /** - * @brief Returns the timestamp value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The timestamp value. - */ - static Result> get_value(const Ref& _chunk, - const int64_t _ix) { - return Timestamp<_format>(_chunk->Value(_ix) / 1000); - } - - /** - * @brief Creates a builder for timestamp arrays. - * @return The builder. - */ + using ArrayType = arrow::Array; + using BuilderType = ArrowBuilder; + static auto data_type() { return timestamp_data_type(); } static auto make_builder() { - return BuilderType(data_type(), arrow::default_memory_pool()); - } - - /** - * @brief Transforms an array with different time units to a timestamp array. - * @tparam _unit The time unit of the source array. - * @tparam SourceArrayType The type of the source array. - * @param _arr The source array. - * @return The timestamp array or an error. - */ - template - static Result> transform_time_stamp( - const std::shared_ptr& _arr) noexcept { - if (!_arr) { - return error( - "transform_time_stamp: std::shared_ptr not set. This is a " - "bug, please report."); - } - - auto builder = - arrow::TimestampBuilder(data_type(), arrow::default_memory_pool()); - - for (int64_t i = 0; i < _arr->length(); ++i) { - if (_arr->IsNull(i)) { - const auto status = builder.AppendNull(); - if (!status.ok()) { - return error(status.message()); - } - } else { - if constexpr (_unit == TimeUnit::day) { - const auto status = builder.Append( - static_cast(_arr->Value(i)) * 1000 * 24 * 60 * 60); - if (!status.ok()) { - return error(status.message()); - } - } else if constexpr (_unit == TimeUnit::second) { - const auto status = - builder.Append(static_cast(_arr->Value(i) * 1000)); - if (!status.ok()) { - return error(status.message()); - } - } else if constexpr (_unit == TimeUnit::milli) { - const auto status = - builder.Append(static_cast(_arr->Value(i))); - if (!status.ok()) { - return error(status.message()); - } - } else if constexpr (_unit == TimeUnit::micro) { - const auto status = - builder.Append(static_cast(_arr->Value(i) / 1000)); - if (!status.ok()) { - return error(status.message()); - } - } else if constexpr (_unit == TimeUnit::nano) { - const auto status = - builder.Append(static_cast(_arr->Value(i) / 1000000)); - if (!status.ok()) { - return error(status.message()); - } - } else if constexpr (_unit == TimeUnit::string) { - const auto ts = Timestamp<_format>::make(std::string(_arr->Value(i))); - if (!ts) { - return error(ts.error().what()); - } - const auto status = builder.Append(ts->to_time_t() * 1000); - if (!status.ok()) { - return error(status.message()); - } - } else { - static_assert(rfl::always_false_v, - "Unsupported time unit."); - } - } - } - - std::shared_ptr res; - const auto status = builder.Finish(&res); - return Ref::make( - std::static_pointer_cast(res)); + if constexpr (_s == SerializationType::csv) + return ArrowScalar::make_builder(); + else + return make_timestamp_builder(); } -}; - -template -struct ArrowTypes, SerializationType::csv> { - using ArrayType = arrow::TimestampArray; - using BuilderType = arrow::StringBuilder; - - /** - * @brief Returns the Arrow data type for timestamps (milli). - * @return The Arrow data type. - */ - static auto data_type() { return arrow::timestamp(arrow::TimeUnit::MILLI); } - - /** - * @brief Adds a timestamp value to the builder (as string for CSV). - * @param _val The value to add. - * @param _builder The builder to add to. - */ - static void add_to_builder(const Timestamp<_format>& _val, + static void add_to_builder(const Timestamp<_format>& _value, BuilderType* _builder) { - const auto status = append_string(_builder, _val.str()); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } - } - - /** - * @brief Returns the timestamp array from the shared pointer. - * @param _arr The shared pointer to the arrow array. - * @return The timestamp array or an error. - */ - static Result> get_array( - const std::shared_ptr& _arr) { - return ArrowTypes, - SerializationType::parquet>::get_array(_arr); + if constexpr (_s == SerializationType::csv) + ArrowScalar::add_to_builder(_value.str(), _builder); + else + append_timestamp(_builder, _value.to_time_t() * 1000); + } + static auto get_array(const std::shared_ptr& _arr) { + return timestamp_array( + _arr, [](std::string_view _value) -> Result { + return Timestamp<_format>::make(std::string(_value)) + .transform([](const auto& _ts) -> int64_t { + return _ts.to_time_t() * 1000; + }); + }); } - - /** - * @brief Returns the timestamp value from the array at the given index. - * @param _chunk The array to get the value from. - * @param _ix The index of the value. - * @return The timestamp value. - */ - static Result> get_value(const Ref& _chunk, - const int64_t _ix) { - return ArrowTypes, - SerializationType::parquet>::get_value(_chunk, _ix); + static Result> get_value(const Ref& _arr, + int64_t _ix) { + return Timestamp<_format>(timestamp_value(_arr, _ix) / 1000); } - - /** - * @brief Creates a builder for timestamp arrays (string builder for CSV). - * @return The builder. - */ - static auto make_builder() { return BuilderType(); } }; template @@ -1126,10 +332,7 @@ struct ArrowTypes, _s> { if (_val) { ArrowTypes::add_to_builder(*_val, _builder); } else { - const auto status = append_null(_builder); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } + _builder->append_null(); } } @@ -1182,10 +385,7 @@ struct ArrowTypes, _s> { if (_val) { ArrowTypes::add_to_builder(*_val, _builder); } else { - const auto status = append_null(_builder); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } + _builder->append_null(); } } @@ -1238,10 +438,7 @@ struct ArrowTypes, _s> { if (_val) { ArrowTypes::add_to_builder(*_val, _builder); } else { - const auto status = append_null(_builder); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } + _builder->append_null(); } } @@ -1420,124 +617,5 @@ struct ArrowTypes, _s> { static auto make_builder() { return ArrowTypes::make_builder(); } }; -/** - * @brief Implementation of numerical array transformation. - * @tparam T The target type. - * @tparam _s The serialization type. - * @tparam SourceArrayType The type of the source array. - * @param _arr The source array. - * @return The transformed array or an error. - */ -template -Result::ArrayType>> -transform_numerical_array_impl( - const std::shared_ptr& _arr) noexcept { - if (!_arr) { - return error( - "transform_numerical_array_impl: std::shared_ptr not set. This is a " - "bug, please report."); - } - - auto builder = ArrowTypes::make_builder(); - - for (int64_t i = 0; i < _arr->length(); ++i) { - if (_arr->IsNull(i)) { - const auto status = builder.AppendNull(); - if (!status.ok()) { - return error(status.message()); - } - } else { - const auto status = builder.Append(static_cast(_arr->Value(i))); - if (!status.ok()) { - return error(status.message()); - } - } - } - - using TargetArrayType = typename ArrowTypes::ArrayType; - - std::shared_ptr res; - const auto status = builder.Finish(&res); - return Ref::make( - std::static_pointer_cast(res)); -} - -/** - * @brief Transforms a numerical array to the desired type T. - * @tparam T The desired type. - * @tparam _s The serialization type. - * @param _arr The array to transform. - * @return The transformed array or an error. - */ -template -Result::ArrayType>> transform_numerical_array( - const std::shared_ptr& _arr) noexcept { - if (!_arr) { - return error( - "Could not transform the numerical array. std::shared_ptr not set."); - } - - using ArrayType = typename ArrowTypes::ArrayType; - - if (_arr->type()->Equals(ArrowTypes::data_type())) { - return Ref::make(std::static_pointer_cast(_arr)); - - } else if (_arr->type()->Equals(ArrowTypes::data_type())) { - return transform_numerical_array_impl( - std::static_pointer_cast::ArrayType>( - _arr)); - - } else if (_arr->type()->Equals(ArrowTypes::data_type())) { - return transform_numerical_array_impl( - std::static_pointer_cast::ArrayType>( - _arr)); - - } else if (_arr->type()->Equals(ArrowTypes::data_type())) { - return transform_numerical_array_impl( - std::static_pointer_cast::ArrayType>( - _arr)); - - } else if (_arr->type()->Equals(ArrowTypes::data_type())) { - return transform_numerical_array_impl( - std::static_pointer_cast::ArrayType>( - _arr)); - - } else if (_arr->type()->Equals(ArrowTypes::data_type())) { - return transform_numerical_array_impl( - std::static_pointer_cast::ArrayType>( - _arr)); - - } else if (_arr->type()->Equals(ArrowTypes::data_type())) { - return transform_numerical_array_impl( - std::static_pointer_cast::ArrayType>( - _arr)); - - } else if (_arr->type()->Equals(ArrowTypes::data_type())) { - return transform_numerical_array_impl( - std::static_pointer_cast::ArrayType>( - _arr)); - - } else if (_arr->type()->Equals(ArrowTypes::data_type())) { - return transform_numerical_array_impl( - std::static_pointer_cast::ArrayType>( - _arr)); - - } else if (_arr->type()->Equals(ArrowTypes::data_type())) { - return transform_numerical_array_impl( - std::static_pointer_cast::ArrayType>( - _arr)); - - } else if (_arr->type()->Equals(ArrowTypes::data_type())) { - return transform_numerical_array_impl( - std::static_pointer_cast::ArrayType>( - _arr)); - - } else { - return error("Expected numerical array, got " + _arr->type()->ToString() + - "."); - } -} - } // namespace rfl::parsing::tabular - #endif diff --git a/include/rfl/parsing/tabular/ArrowWriter.hpp b/include/rfl/parsing/tabular/ArrowWriter.hpp index 2b240676c..b2ed7509f 100644 --- a/include/rfl/parsing/tabular/ArrowWriter.hpp +++ b/include/rfl/parsing/tabular/ArrowWriter.hpp @@ -1,8 +1,6 @@ #ifndef RFL_PARSING_TABULAR_ARROWWRITER_HPP_ #define RFL_PARSING_TABULAR_ARROWWRITER_HPP_ -#include - #include #include #include @@ -17,6 +15,7 @@ #include "../../internal/no_optionals_v.hpp" #include "../../named_tuple_t.hpp" #include "../../to_view.hpp" +#include "ArrowBridge.hpp" #include "add_to_builder.hpp" #include "make_arrow_builders.hpp" #include "make_arrow_data_types.hpp" @@ -60,9 +59,8 @@ class ArrowWriter { * @return The Arrow table. */ std::shared_ptr to_table(const VecType& _data) const { - return arrow::Table::Make( - make_arrow_schema, _s>(), - to_chunked_arrays(_data)); + return make_table(make_arrow_schema, _s>(), + to_chunked_arrays(_data)); } private: @@ -110,10 +108,7 @@ ArrowWriter::to_chunked_arrays(const VecType& _data) const { std::vector> chunks(size); const auto finish_builder = [](auto* _b, auto* _c) { - const auto status = _b->Finish(_c); - if (!status.ok()) { - throw std::runtime_error(status.message()); - } + *_c = _b->finish(); }; [&](auto* _b, auto* _c, @@ -131,8 +126,8 @@ ArrowWriter::to_chunked_arrays(const VecType& _data) const { return [&](std::integer_sequence) { return std::vector>( - {std::make_shared(array_chunks.at(_is), - std::get<_is>(data_types))...}); + {make_chunked_array(array_chunks.at(_is), + std::get<_is>(data_types))...}); }(std::make_integer_sequence()); } diff --git a/include/rfl/parsing/tabular/ChunkedArrayIterator.hpp b/include/rfl/parsing/tabular/ChunkedArrayIterator.hpp index 5e1ebbeee..9fec83c9a 100644 --- a/include/rfl/parsing/tabular/ChunkedArrayIterator.hpp +++ b/include/rfl/parsing/tabular/ChunkedArrayIterator.hpp @@ -1,12 +1,11 @@ #ifndef RFL_PARSING_TABULAR_CHUNKEDARRAYITERATOR_HPP_ #define RFL_PARSING_TABULAR_CHUNKEDARRAYITERATOR_HPP_ -#include - #include "../../Ref.hpp" #include "../../Result.hpp" #include "../../internal/ptr_cast.hpp" #include "../is_required.hpp" +#include "ArrowBridge.hpp" #include "array_t.hpp" namespace rfl::parsing::tabular { @@ -44,7 +43,7 @@ class ChunkedArrayIterator { Result operator*() const noexcept { const bool is_null = current_chunk_ - .transform([&](const auto& _c) { return _c->IsNull(ix_); }) + .transform([&](const auto& _c) { return array_is_null(_c, ix_); }) .value_or(false); if (is_null) { @@ -63,7 +62,7 @@ class ChunkedArrayIterator { * @brief Checks if the iterator has reached the end. * @return true if the end has been reached, false otherwise. */ - bool end() const noexcept { return chunk_ix_ >= arr_->num_chunks(); } + bool end() const noexcept { return chunk_ix_ >= num_chunks(arr_); } /** * @brief Advances the iterator to the next position. @@ -74,7 +73,7 @@ class ChunkedArrayIterator { return *this; } ++ix_; - if (ix_ >= (*current_chunk_)->length()) { + if (ix_ >= array_length(*current_chunk_)) { ++chunk_ix_; current_chunk_ = get_chunk(arr_, chunk_ix_); ix_ = 0; @@ -96,8 +95,8 @@ class ChunkedArrayIterator { */ static Result> get_chunk(const Ref& _arr, const int _chunk_ix) noexcept { - if (_chunk_ix < _arr->num_chunks()) { - return ArrowTypes::get_array(_arr->chunk(_chunk_ix)); + if (_chunk_ix < num_chunks(_arr)) { + return ArrowTypes::get_array(array_chunk(_arr, _chunk_ix)); } else { return error("chunk_ix out of bounds."); } diff --git a/include/rfl/parsing/tabular/make_arrow_builders.hpp b/include/rfl/parsing/tabular/make_arrow_builders.hpp index 85b0de114..858fe51c2 100644 --- a/include/rfl/parsing/tabular/make_arrow_builders.hpp +++ b/include/rfl/parsing/tabular/make_arrow_builders.hpp @@ -1,11 +1,10 @@ #ifndef RFL_PARSING_TABULAR_MAKEARROWBUILDERS_HPP_ #define RFL_PARSING_TABULAR_MAKEARROWBUILDERS_HPP_ -#include - #include #include "../../named_tuple_t.hpp" +#include "ArrowBridge.hpp" #include "ArrowTypes.hpp" namespace rfl::parsing::tabular { @@ -48,10 +47,10 @@ struct ArrowBuildersType, _s> { */ static auto schema() { const auto fields = - std::vector>({arrow::field( + std::vector>({make_arrow_field( typename FieldTypes::Name().str(), ArrowTypes::data_type())...}); - return arrow::schema(fields); + return make_schema(fields); } }; diff --git a/include/rfl/parsing/tabular/make_chunked_array_iterators.hpp b/include/rfl/parsing/tabular/make_chunked_array_iterators.hpp index 2cf66a56c..91a7a499e 100644 --- a/include/rfl/parsing/tabular/make_chunked_array_iterators.hpp +++ b/include/rfl/parsing/tabular/make_chunked_array_iterators.hpp @@ -1,14 +1,13 @@ #ifndef RFL_PARSING_TABULAR_MAKECHUNKEDARRAYITERATORS_HPP_ #define RFL_PARSING_TABULAR_MAKECHUNKEDARRAYITERATORS_HPP_ -#include - #include #include "../../NamedTuple.hpp" #include "../../Ref.hpp" #include "../../Result.hpp" #include "../../Tuple.hpp" +#include "ArrowBridge.hpp" #include "ChunkedArrayIterator.hpp" namespace rfl::parsing::tabular { @@ -22,18 +21,15 @@ struct MakeChunkedArrayIterators, _s> { Tuple...>; /** - * @brief Creates a tuple of chunked array iterators for the fields in the named tuple. + * @brief Creates a tuple of chunked array iterators for the fields in the + * named tuple. * @param _table The arrow table to read from. * @return A Result containing the tuple of iterators or an error. */ Result operator()(const Ref& _table) const { const auto get_column = [&](const std::string& _colname) -> Result> { - const auto col = _table->GetColumnByName(_colname); - if (!col) { - return error("Column named '" + _colname + "' not found."); - } - return Ref::make(col); + return table_column(_table, _colname); }; try { diff --git a/modules/rfl.capnproto.cppm b/modules/rfl.capnproto.cppm index 97465f812..29c4b9bf7 100644 --- a/modules/rfl.capnproto.cppm +++ b/modules/rfl.capnproto.cppm @@ -1,16 +1,18 @@ module; +#define RFL_CAPNPROTO_MODULE_INTERFACE #include "rfl/capnproto.hpp" +#undef RFL_CAPNPROTO_MODULE_INTERFACE export module rfl.capnproto; export import rfl; export namespace rfl::capnproto { -using ::rfl::capnproto::Schema; using ::rfl::capnproto::load; using ::rfl::capnproto::read; using ::rfl::capnproto::save; +using ::rfl::capnproto::Schema; using ::rfl::capnproto::to_schema; using ::rfl::capnproto::write; -} +} // namespace rfl::capnproto diff --git a/modules/rfl.csv.cppm b/modules/rfl.csv.cppm index 3d345d7c3..06b4d3142 100644 --- a/modules/rfl.csv.cppm +++ b/modules/rfl.csv.cppm @@ -1,15 +1,17 @@ module; +#define RFL_ARROW_MODULE_INTERFACE #include "rfl/csv.hpp" +#undef RFL_ARROW_MODULE_INTERFACE export module rfl.csv; export import rfl; export namespace rfl::csv { -using ::rfl::csv::Settings; using ::rfl::csv::load; using ::rfl::csv::read; using ::rfl::csv::save; +using ::rfl::csv::Settings; using ::rfl::csv::write; -} +} // namespace rfl::csv diff --git a/modules/rfl.parquet.cppm b/modules/rfl.parquet.cppm index 43b335898..175666c25 100644 --- a/modules/rfl.parquet.cppm +++ b/modules/rfl.parquet.cppm @@ -1,6 +1,8 @@ module; +#define RFL_ARROW_MODULE_INTERFACE #include "rfl/parquet.hpp" +#undef RFL_ARROW_MODULE_INTERFACE export module rfl.parquet; @@ -8,9 +10,9 @@ export import rfl; export namespace rfl::parquet { using ::rfl::parquet::Compression; -using ::rfl::parquet::Settings; using ::rfl::parquet::load; using ::rfl::parquet::read; using ::rfl::parquet::save; +using ::rfl::parquet::Settings; using ::rfl::parquet::write; -} +} // namespace rfl::parquet diff --git a/scripts/ci/README.md b/scripts/ci/README.md index a31c50d0a..147f2481d 100644 --- a/scripts/ci/README.md +++ b/scripts/ci/README.md @@ -109,29 +109,40 @@ its native portable binary format and existing archive-reference overloads. Regression tests cover those overloads against a separate native Cereal TU, byte compatibility, stream reads/writes, and malformed input. -GCC 15.2 and GCC 16.2.1 passed the CBOR, UBJSON, and Cereal module suites in -C++20 and C++23 with PCH enabled. Clang 19 also passed a combined C++20 build -of CBOR, UBJSON, Cereal, CSV, and Parquet: 224 tests passed and one locale test -was skipped. The same combined suite also passed with GCC 11 in C++20 -header mode using a shared reflectcpp library (224 tests and one locale skip). -An installed GCC 11 shared-library consumer also passed CBOR, UBJSON, and Cereal -round trips through `find_package(reflectcpp)`; the local PyArrow fixture needs -its library directory in `LD_LIBRARY_PATH`. - -Arrow string and null appends now run in an ordinary implementation file. -GCC 16.2.1 passed the Parquet/Arrow 21.0.0 module suite in C++20 and C++23 -(61 tests and one locale skip per run) with the usual optimization flags and `-Werror`. No compiler -warning or optimization is disabled by this workaround. - -Two dependency boundaries remain unresolved. GCC 15 rejects Arrow/Parquet's -TU-local constants and static helper functions in the module interface. -GCC 16 still rejects Cap'n Proto 1.2.0/KJ types: even exporting a struct with -only a `capnp::DynamicValue::Reader` member reproduces the KJ `Bounded` error. -Moving packed-message and schema-parser operations out of templates did not -remove that type dependency. A complete rfl-side fix needs opaque reader and -writer handles rather than merely wrapping calls; that public representation -change is not part of this patch. Upgrading to GCC 16 alone therefore still -does not make the entire optional-format matrix pass. +CSV and Parquet module interfaces now include Arrow forward declarations. +Native builders, array conversions and file I/O live in ordinary implementation +files. `to_buffer` retains its Arrow-buffer return type. String and null appends +are also isolated from Arrow's complete builder hierarchy to avoid GCC 16's +incorrect speculative devirtualization. No compiler warning or optimization is +disabled. The private native conversion code preserves numerical casts, nulls, +binary data and timestamp units. + +Cap'n Proto 1.2.0 uses opaque native-view handles and ordinary packed-message +owners. Native calls leave the exported templates, and the schema cache has +inline linkage. The byte/stream read/write entry points and schema API remain; +low-level `val_` fields now hold handles, with `.as()` for custom constructors +and `.native()` for direct integration. Handle ownership adds allocations; these +checks establish functional compatibility, not performance equivalence. + +Separate native Arrow/Parquet and Cap'n Proto translation units verify both +read directions. Cap'n Proto checks exact bytes; Parquet checks numerical +conversion, nanosecond timestamps, binary data, nulls, builder growth and multiple +row groups. All local runs below keep PCH enabled and the usual optimization +and warning flags. A locale test is skipped because its locale is unavailable. + +| Compiler | Standard and mode | Formats | Passed | Skipped | +| --- | --- | --- | --- | --- | +| GCC 15.2 | C++20 modules | CBOR, UBJSON, Cereal, CSV, Parquet, Cap'n Proto | 278 | 1 | +| GCC 15.2 | C++23 modules | CSV, Parquet, Cap'n Proto | 130 | 1 | +| GCC 16.2.1 | C++20 modules | Parquet | 63 | 1 | +| GCC 16.2.1 | C++20 modules | Cap'n Proto | 98 | 1 | +| Clang 19 | C++20 modules | All six formats above | 278 | 1 | +| GCC 11 | C++20 headers, shared library | All six formats above | 278 | 1 | + +GCC 15.2 and GCC 16.2.1 also passed the CBOR, UBJSON and Cereal module suites +in C++23. An installed GCC 11 shared-library consumer exercises all six formats +through `find_package(reflectcpp)`; the local PyArrow fixture needs its library +directory in `LD_LIBRARY_PATH`. Sources: [CMake 3.31](https://cmake.org/cmake/help/v3.31/manual/cmake-cxxmodules.7.html), [GCC 14](https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/C_002b_002b-Modules.html), diff --git a/src/reflectcpp_arrow_bridge.cpp b/src/reflectcpp_arrow_bridge.cpp new file mode 100644 index 000000000..2364210e4 --- /dev/null +++ b/src/reflectcpp_arrow_bridge.cpp @@ -0,0 +1,3 @@ +// Keep native conversions out of importing templates and share them between +// CSV and Parquet. +#include "rfl/parsing/tabular/ArrowBridge.cpp" diff --git a/src/reflectcpp_capnproto.cpp b/src/reflectcpp_capnproto.cpp index 217e3f232..3634c133a 100644 --- a/src/reflectcpp_capnproto.cpp +++ b/src/reflectcpp_capnproto.cpp @@ -35,6 +35,8 @@ SOFTWARE. #include "rfl/avro/Type.cpp" #include "rfl/avro/Writer.cpp" #include "rfl/avro/to_schema.cpp"*/ +#include "rfl/capnproto/Buffers.cpp" +#include "rfl/capnproto/NativeHandle.cpp" #include "rfl/capnproto/Reader.cpp" #include "rfl/capnproto/SchemaImpl.cpp" #include "rfl/capnproto/Type.cpp" diff --git a/src/reflectcpp_csv.cpp b/src/reflectcpp_csv.cpp new file mode 100644 index 000000000..f351cd347 --- /dev/null +++ b/src/reflectcpp_csv.cpp @@ -0,0 +1,83 @@ +#include +#include + +#include "rfl/csv/Table.hpp" + +namespace rfl::csv::detail { +Result> read_table(const char* _str, + const size_t _size, + const Settings& _settings) { + arrow::io::IOContext io_context = arrow::io::default_io_context(); + + const auto buffer = std::make_shared( + internal::ptr_cast(_str), _size); + + std::shared_ptr input = + std::make_shared(buffer); + + auto read_options = arrow::csv::ReadOptions::Defaults(); + auto convert_options = arrow::csv::ConvertOptions::Defaults(); + convert_options.null_values = + std::vector({_settings.null_string}); + convert_options.strings_can_be_null = true; + + auto parse_options = arrow::csv::ParseOptions::Defaults(); + parse_options.delimiter = _settings.delimiter; + parse_options.quoting = _settings.quoting; + parse_options.quote_char = _settings.quote_char; + parse_options.double_quote = _settings.double_quote; + parse_options.escaping = _settings.escaping; + parse_options.escape_char = _settings.escape_char; + parse_options.newlines_in_values = _settings.newlines_in_values; + parse_options.ignore_empty_lines = _settings.ignore_empty_lines; + + auto maybe_reader = arrow::csv::TableReader::Make( + io_context, input, read_options, parse_options, convert_options); + + if (!maybe_reader.ok()) { + return error("Could not construct CSV reader: " + + maybe_reader.status().message()); + } + + std::shared_ptr reader = *maybe_reader; + + auto maybe_table = reader->Read(); + if (!maybe_table.ok()) { + return error("Could not read table: " + maybe_table.status().message()); + } + + const std::shared_ptr table = *maybe_table; + + return table; +} +Ref write_table(const std::shared_ptr& table, + const Settings& _settings) { + const auto output_buffer = arrow::io::BufferOutputStream::Create(); + + if (!output_buffer.ok()) { + throw std::runtime_error(output_buffer.status().message()); + } + + auto options = arrow::csv::WriteOptions::Defaults(); + options.batch_size = _settings.batch_size; + options.delimiter = _settings.delimiter; + options.null_string = _settings.null_string; + options.quoting_style = _settings.quoting ? arrow::csv::QuotingStyle::Needed + : arrow::csv::QuotingStyle::None; + + const auto status = + arrow::csv::WriteCSV(*table, options, output_buffer.ValueOrDie().get()); + + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + + const auto buffer = output_buffer.ValueOrDie()->Finish(); + + if (!buffer.ok()) { + throw std::runtime_error(output_buffer.status().message()); + } + + return Ref::make(buffer.ValueOrDie()).value(); +} +} // namespace rfl::csv::detail diff --git a/src/reflectcpp_parquet.cpp b/src/reflectcpp_parquet.cpp new file mode 100644 index 000000000..566ec21c9 --- /dev/null +++ b/src/reflectcpp_parquet.cpp @@ -0,0 +1,65 @@ +#include +#include +#include + +#include "rfl/parquet/Table.hpp" + +namespace rfl::parquet::detail { +Result> read_table(const uint8_t* _bytes, + const size_t _size) { + arrow::MemoryPool* pool = arrow::default_memory_pool(); + + const auto buffer = std::make_shared( + internal::ptr_cast(_bytes), _size); + + const auto input = std::make_shared(buffer); + + auto arrow_reader = ::parquet::arrow::OpenFile(input, pool); + + if (!arrow_reader.ok()) { + return error(std::string("Could not generate the arrow reader: ") + + arrow_reader.status().message()); + } + + std::shared_ptr table; + + const auto status = arrow_reader.ValueOrDie()->ReadTable(&table); + + if (!status.ok()) { + return error("Could not read table: " + status.message()); + } + + return table; +} +Ref write_table(const std::shared_ptr& table, + const Settings& _settings) { + const auto props = ::parquet::WriterProperties::Builder() + .compression(_settings.compression) + ->build(); + + const auto arrow_props = + ::parquet::ArrowWriterProperties::Builder().store_schema()->build(); + + const auto output_buffer = arrow::io::BufferOutputStream::Create(); + + if (!output_buffer.ok()) { + throw std::runtime_error(output_buffer.status().message()); + } + + const auto status = ::parquet::arrow::WriteTable( + *table.get(), arrow::default_memory_pool(), output_buffer.ValueOrDie(), + _settings.chunksize, props, arrow_props); + + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + + const auto buffer = output_buffer.ValueOrDie()->Finish(); + + if (!buffer.ok()) { + throw std::runtime_error(output_buffer.status().message()); + } + + return Ref::make(buffer.ValueOrDie()).value(); +} +} // namespace rfl::parquet::detail diff --git a/src/rfl/capnproto/Buffers.cpp b/src/rfl/capnproto/Buffers.cpp new file mode 100644 index 000000000..48204d287 --- /dev/null +++ b/src/rfl/capnproto/Buffers.cpp @@ -0,0 +1,46 @@ +#include "rfl/capnproto/Buffers.hpp" + +#include +#include +#include + +namespace rfl::capnproto::detail { +struct PackedReader::Impl { + Impl(const void* _bytes, size_t _size, const capnp::ParsedSchema& _schema, + const std::string& _name) + : stream(kj::ArrayPtr( + static_cast(_bytes), _size)), + message(stream), + root(message.getRoot( + _schema.getNested(_name.c_str()).asStruct())) {} + kj::ArrayInputStream stream; + capnp::PackedMessageReader message; + capnp::DynamicStruct::Reader root; +}; +PackedReader::PackedReader(const void* _bytes, size_t _size, + const capnp::ParsedSchema& _schema, + const std::string& _name) + : impl_(std::make_unique(_bytes, _size, _schema, _name)) {} +PackedReader::~PackedReader() = default; +Reader::InputVarType PackedReader::root() const { return {impl_->root}; } + +struct PackedWriter::Impl { + Impl(const capnp::ParsedSchema& _schema, const std::string& _name) + : root(message.initRoot( + _schema.getNested(_name.c_str()).asStruct())) {} + capnp::MallocMessageBuilder message; + capnp::DynamicStruct::Builder root; +}; +PackedWriter::PackedWriter(const capnp::ParsedSchema& _schema, + const std::string& _name) + : impl_(std::make_unique(_schema, _name)) {} +PackedWriter::~PackedWriter() = default; +Writer PackedWriter::writer() const { return Writer(&impl_->root); } +std::vector PackedWriter::bytes() const { + kj::VectorOutputStream stream; + capnp::writePackedMessage(stream, impl_->message); + const auto bytes = stream.getArray(); + const auto begin = internal::ptr_cast(bytes.begin()); + return {begin, begin + bytes.size()}; +} +} // namespace rfl::capnproto::detail diff --git a/src/rfl/capnproto/NativeHandle.cpp b/src/rfl/capnproto/NativeHandle.cpp new file mode 100644 index 000000000..c7f6b7a71 --- /dev/null +++ b/src/rfl/capnproto/NativeHandle.cpp @@ -0,0 +1,65 @@ +#include "rfl/capnproto/NativeHandle.hpp" + +#include + +namespace rfl::capnproto::detail { +template +struct NativeHandle::Impl { + using Value = std::conditional_t; + explicit Impl(Value _value) : value(std::move(_value)) {} + Value value; +}; + +template +std::shared_ptr::Impl> +NativeHandle::make(const void* _value, NativeKind _kind) { + using Value = typename Impl::Value; + if constexpr (IsBuilder) { + // Builder construction passes a non-const local copy of the native view. + // DynamicValue::Builder's copy constructor deliberately takes Builder&. + if constexpr (std::is_same_v) { + switch (_kind) { + case NativeKind::value: + return std::make_shared( + *static_cast(const_cast(_value))); + case NativeKind::object: + return std::make_shared( + Value(*static_cast( + const_cast(_value)))); + case NativeKind::list: + return std::make_shared( + Value(*static_cast( + const_cast(_value)))); + } + } else + return std::make_shared( + *static_cast(const_cast(_value))); + } else if constexpr (std::is_same_v) { + switch (_kind) { + case NativeKind::value: + return std::make_shared(*static_cast(_value)); + case NativeKind::object: + return std::make_shared( + Value(*static_cast(_value))); + case NativeKind::list: + return std::make_shared( + Value(*static_cast(_value))); + } + } else + return std::make_shared(*static_cast(_value)); + throw std::runtime_error("Invalid Cap'n Proto native view."); +} +template +void* NativeHandle::native_ptr() const { + if (!impl_) throw std::logic_error("Empty Cap'n Proto native handle."); + return &impl_->value; +} + +template class NativeHandle; +template class NativeHandle; +template class NativeHandle; +template class NativeHandle; +template class NativeHandle; +template class NativeHandle; +} // namespace rfl::capnproto::detail diff --git a/src/rfl/capnproto/Reader.cpp b/src/rfl/capnproto/Reader.cpp index 08ea2bad3..2815df271 100644 --- a/src/rfl/capnproto/Reader.cpp +++ b/src/rfl/capnproto/Reader.cpp @@ -3,20 +3,125 @@ #include "rfl/parsing/schemaful/IsSchemafulReader.hpp" namespace rfl::capnproto { - -static_assert(parsing::schemaful::IsSchemafulReader, - "This must be a schemaful reader."); - -std::optional> +static_assert(parsing::schemaful::IsSchemafulReader); +bool Reader::is_empty(const InputVarType& _var) const noexcept { + return _var.val_.native().getType() == capnp::DynamicValue::VOID; +} +Result Reader::read_string( + const InputVarType& _var) const noexcept { + const auto& value = _var.val_.native(); + if (value.getType() != capnp::DynamicValue::TEXT) + return error("Could not cast to string."); + return std::string(value.as().cStr()); +} +Result> Reader::read_bytes( + const InputVarType& _var, bool _vectorstring) const noexcept { + const auto& value = _var.val_.native(); + if (value.getType() != capnp::DynamicValue::DATA) + return error(_vectorstring ? "Could not cast to vectorstring." + : "Could not cast to bytestring."); + const auto bytes = value.as(); + const auto begin = internal::ptr_cast(bytes.begin()); + return std::vector(begin, begin + bytes.size()); +} +Result Reader::read_bool(const InputVarType& _var) const noexcept { + const auto& value = _var.val_.native(); + if (value.getType() != capnp::DynamicValue::BOOL) + return error("Could not cast to boolean."); + return value.as(); +} +Result Reader::read_double(const InputVarType& _var) const noexcept { + const auto& value = _var.val_.native(); + if (value.getType() != capnp::DynamicValue::FLOAT) + return error("Could not cast to float."); + return value.as(); +} +bool Reader::is_unsigned(const InputVarType& _var) const noexcept { + return _var.val_.native().getType() == capnp::DynamicValue::UINT; +} +Result Reader::read_int64(const InputVarType& _var) const noexcept { + const auto& value = _var.val_.native(); + if (value.getType() != capnp::DynamicValue::INT) + return error("Could not cast to an integer."); + return value.as(); +} +Result Reader::read_uint64(const InputVarType& _var) const noexcept { + const auto& value = _var.val_.native(); + if (value.getType() != capnp::DynamicValue::UINT) + return error("Could not cast to an integer."); + return value.as(); +} +Result Reader::read_enum(const InputVarType& _var) const noexcept { + const auto& value = _var.val_.native(); + if (value.getType() != capnp::DynamicValue::ENUM) + return error("Could not cast to an enum."); + return value.as().getRaw(); +} +Result Reader::to_array( + const InputVarType& _var) const noexcept { + const auto& value = _var.val_.native(); + if (value.getType() != capnp::DynamicValue::LIST) + return error("Could not cast to a list."); + return InputArrayType{value.as()}; +} +Result Reader::to_object( + const InputVarType& _var) const noexcept { + const auto& value = _var.val_.native(); + if (value.getType() != capnp::DynamicValue::STRUCT) + return error("Could not cast to a struct."); + return InputObjectType{value.as()}; +} +Result Reader::to_map( + const InputVarType& _var) const noexcept { + const auto& value = _var.val_.native(); + if (value.getType() != capnp::DynamicValue::STRUCT) + return error("Could not cast to a map."); + return InputMapType{value.as()}; +} +Result Reader::to_union( + const InputVarType& _var) const noexcept { + const auto& value = _var.val_.native(); + if (value.getType() != capnp::DynamicValue::STRUCT) + return error("Could not cast to a struct."); + return InputUnionType{value.as()}; +} +size_t Reader::array_size(const InputArrayType& _arr) const { + return _arr.val_.native().size(); +} +Reader::InputVarType Reader::array_at(const InputArrayType& _arr, + size_t _ix) const { + return {_arr.val_.native()[static_cast(_ix)]}; +} +size_t Reader::object_size(const InputObjectType& _obj) const { + return _obj.val_.native().getSchema().getFields().size(); +} +Reader::InputVarType Reader::object_at(const InputObjectType& _obj, + size_t _ix) const { + const auto& value = _obj.val_.native(); + return {value.get(value.getSchema().getFields()[static_cast(_ix)])}; +} +Reader::InputArrayType Reader::map_entries(const InputMapType& _map) const { + return {_map.val_.native().get("entries").as()}; +} +std::string_view Reader::map_key(const InputVarType& _entry) const { + const auto key = _entry.val_.native() + .as() + .get("key") + .as(); + return {key.cStr(), key.size()}; +} +Reader::InputVarType Reader::map_value(const InputVarType& _entry) const { + return {_entry.val_.native().as().get("value")}; +} +std::optional> Reader::identify_discriminant(const InputUnionType& _union) const noexcept { + const auto& value = _union.val_.native(); size_t ix = 0; - for (auto field : _union.val_.getSchema().getFields()) { - if (_union.val_.has(field)) { - return std::make_pair(field, ix); - } + for (auto field : value.getSchema().getFields()) { + if (value.has(field)) + return std::make_pair(InputVarType{value.get(field)}, ix); ++ix; } - return std::optional>(); + return std::nullopt; } - } // namespace rfl::capnproto diff --git a/src/rfl/capnproto/SchemaImpl.cpp b/src/rfl/capnproto/SchemaImpl.cpp index 15078e5c1..b6167391c 100644 --- a/src/rfl/capnproto/SchemaImpl.cpp +++ b/src/rfl/capnproto/SchemaImpl.cpp @@ -4,6 +4,8 @@ #include namespace rfl::capnproto { +SchemaImpl::~SchemaImpl() = default; +const capnp::ParsedSchema& SchemaImpl::value() const { return *schema_; } SchemaImpl::SchemaImpl(const std::string& _str) : str_(_str), diff --git a/src/rfl/capnproto/Writer.cpp b/src/rfl/capnproto/Writer.cpp index 333d5571d..74595a8dd 100644 --- a/src/rfl/capnproto/Writer.cpp +++ b/src/rfl/capnproto/Writer.cpp @@ -5,6 +5,27 @@ #include "rfl/parsing/schemaful/IsSchemafulWriter.hpp" namespace rfl::capnproto { +namespace { +kj::StringPtr to_kj_string_ptr(const std::string_view& _str) { + return {_str.data(), _str.size()}; +} +template +void set_basic_value(const auto& _value, const Set& _set) { + std::visit( + [&](const auto& _v) { + using T = std::remove_cvref_t; + if constexpr (std::is_same_v) + _set(capnp::DynamicValue::Reader(_v.c_str())); + else if constexpr (std::is_same_v>) { + const auto bytes = kj::ArrayPtr( + internal::ptr_cast(_v.data()), _v.size()); + _set(capnp::DynamicValue::Reader(capnp::Data::Reader(bytes))); + } else + _set(capnp::DynamicValue::Reader(_v)); + }, + _value); +} +} // namespace static_assert(parsing::schemaful::IsSchemafulWriter, "This must be a schemaful writer."); @@ -18,18 +39,18 @@ inline unsigned int SafeSizeToUInt(size_t sizeValue) { return static_cast(sizeValue); } -Writer::Writer(capnp::DynamicStruct::Builder* _root) : root_(_root){}; - Writer::~Writer() = default; Writer::OutputObjectType Writer::object_as_root(const size_t /*_size*/) const { - return OutputObjectType{root_->as()}; + return OutputObjectType{static_cast(root_) + ->as()}; } Writer::OutputArrayType Writer::add_array_to_array( const size_t _size, OutputArrayType* _parent) const { return OutputArrayType{ - _parent->val_.init(SafeSizeToUInt(_parent->ix_++), SafeSizeToUInt(_size)) + _parent->val_.native() + .init(SafeSizeToUInt(_parent->ix_++), SafeSizeToUInt(_size)) .as()}; } @@ -37,7 +58,7 @@ Writer::OutputArrayType Writer::add_array_to_map(const std::string_view& _name, const size_t _size, OutputMapType* _parent) const { auto entries = OutputArrayType{ - .val_ = _parent->val_.get("entries").as(), + .val_ = _parent->val_.native().get("entries").as(), .ix_ = _parent->ix_++}; auto new_entry = add_object_to_array(2, &entries); add_value_to_object("key", std::string(_name), &new_entry); @@ -48,15 +69,17 @@ Writer::OutputArrayType Writer::add_array_to_object( const std::string_view& _name, const size_t _size, OutputObjectType* _parent) const { return OutputArrayType{ - _parent->val_.init(to_kj_string_ptr(_name), SafeSizeToUInt(_size)) + _parent->val_.native() + .init(to_kj_string_ptr(_name), SafeSizeToUInt(_size)) .as()}; } Writer::OutputArrayType Writer::add_array_to_union( const size_t _index, const size_t _size, OutputUnionType* _parent) const { const auto field = - _parent->val_.getSchema().getFields()[SafeSizeToUInt(_index)]; - return OutputArrayType{_parent->val_.init(field, SafeSizeToUInt(_size)) + _parent->val_.native().getSchema().getFields()[SafeSizeToUInt(_index)]; + return OutputArrayType{_parent->val_.native() + .init(field, SafeSizeToUInt(_size)) .template as()}; } @@ -93,15 +116,15 @@ Writer::OutputMapType Writer::add_map_to_union(const size_t _index, Writer::OutputObjectType Writer::add_object_to_array( const size_t /*_size*/, OutputArrayType* _parent) const { - return OutputObjectType{ - _parent->val_[SafeSizeToUInt(_parent->ix_++)].as()}; + return OutputObjectType{_parent->val_.native()[SafeSizeToUInt(_parent->ix_++)] + .as()}; } Writer::OutputObjectType Writer::add_object_to_map( const std::string_view& _name, const size_t _size, OutputMapType* _parent) const { auto entries = OutputArrayType{ - .val_ = _parent->val_.get("entries").as(), + .val_ = _parent->val_.native().get("entries").as(), .ix_ = _parent->ix_++}; auto new_entry = add_object_to_array(2, &entries); add_value_to_object("key", std::string(_name), &new_entry); @@ -111,29 +134,30 @@ Writer::OutputObjectType Writer::add_object_to_map( Writer::OutputObjectType Writer::add_object_to_object( const std::string_view& _name, const size_t /*_size*/, OutputObjectType* _parent) const { - return OutputObjectType{ - _parent->val_.get(to_kj_string_ptr(_name)).as()}; + return OutputObjectType{_parent->val_.native() + .get(to_kj_string_ptr(_name)) + .as()}; } Writer::OutputObjectType Writer::add_object_to_union( const size_t _index, const size_t /*_size*/, OutputUnionType* _parent) const { const auto field = - _parent->val_.getSchema().getFields()[SafeSizeToUInt(_index)]; + _parent->val_.native().getSchema().getFields()[SafeSizeToUInt(_index)]; return OutputObjectType{ - _parent->val_.init(field).template as()}; + _parent->val_.native().init(field).template as()}; } Writer::OutputUnionType Writer::add_union_to_array( OutputArrayType* _parent) const { - return OutputUnionType{ - _parent->val_[SafeSizeToUInt(_parent->ix_++)].as()}; + return OutputUnionType{_parent->val_.native()[SafeSizeToUInt(_parent->ix_++)] + .as()}; } Writer::OutputUnionType Writer::add_union_to_map(const std::string_view& _name, OutputMapType* _parent) const { auto entries = OutputArrayType{ - .val_ = _parent->val_.get("entries").as(), + .val_ = _parent->val_.native().get("entries").as(), .ix_ = _parent->ix_++}; auto new_entry = add_object_to_array(2, &entries); add_value_to_object("key", std::string(_name), &new_entry); @@ -142,28 +166,29 @@ Writer::OutputUnionType Writer::add_union_to_map(const std::string_view& _name, Writer::OutputUnionType Writer::add_union_to_object( const std::string_view& _name, OutputObjectType* _parent) const { - return OutputUnionType{ - _parent->val_.get(to_kj_string_ptr(_name)).as()}; + return OutputUnionType{_parent->val_.native() + .get(to_kj_string_ptr(_name)) + .as()}; } Writer::OutputUnionType Writer::add_union_to_union( const size_t _index, OutputUnionType* _parent) const { const auto field = - _parent->val_.getSchema().getFields()[SafeSizeToUInt(_index)]; + _parent->val_.native().getSchema().getFields()[SafeSizeToUInt(_index)]; return OutputUnionType{ - _parent->val_.init(field).template as()}; + _parent->val_.native().init(field).template as()}; } Writer::OutputVarType Writer::add_null_to_array( OutputArrayType* _parent) const { - _parent->val_.set(SafeSizeToUInt(_parent->ix_++), capnp::VOID); + _parent->val_.native().set(SafeSizeToUInt(_parent->ix_++), capnp::VOID); return OutputVarType{}; } Writer::OutputVarType Writer::add_null_to_map(const std::string_view& _name, OutputMapType* _parent) const { auto entries = OutputArrayType{ - .val_ = _parent->val_.get("entries").as(), + .val_ = _parent->val_.native().get("entries").as(), .ix_ = _parent->ix_++}; auto new_entry = add_object_to_array(2, &entries); add_value_to_object("key", std::string(_name), &new_entry); @@ -172,16 +197,48 @@ Writer::OutputVarType Writer::add_null_to_map(const std::string_view& _name, Writer::OutputVarType Writer::add_null_to_object( const std::string_view& _name, OutputObjectType* _parent) const { - _parent->val_.set(to_kj_string_ptr(_name), capnp::VOID); + _parent->val_.native().set(to_kj_string_ptr(_name), capnp::VOID); return OutputVarType{}; } Writer::OutputVarType Writer::add_null_to_union( const size_t _index, OutputUnionType* _parent) const { const auto field = - _parent->val_.getSchema().getFields()[SafeSizeToUInt(_index)]; - _parent->val_.set(field, capnp::VOID); + _parent->val_.native().getSchema().getFields()[SafeSizeToUInt(_index)]; + _parent->val_.native().set(field, capnp::VOID); return OutputVarType{}; } +Writer::OutputObjectType Writer::map_entry(const std::string_view& _name, + OutputMapType* _parent) const { + auto entries = OutputArrayType{ + .val_ = _parent->val_.native().get("entries").as(), + .ix_ = _parent->ix_++}; + auto entry = add_object_to_array(2, &entries); + add_value_to_object("key", std::string(_name), &entry); + return entry; +} +Writer::OutputVarType Writer::set_array(const BasicValue& _value, + OutputArrayType* _parent) const { + const auto ix = SafeSizeToUInt(_parent->ix_++); + set_basic_value(_value, + [&](const auto& _v) { _parent->val_.native().set(ix, _v); }); + return {}; +} +Writer::OutputVarType Writer::set_object(const std::string_view& _name, + const BasicValue& _value, + OutputObjectType* _parent) const { + set_basic_value(_value, [&](const auto& _v) { + _parent->val_.native().set(to_kj_string_ptr(_name), _v); + }); + return {}; +} +Writer::OutputVarType Writer::set_union(size_t _index, const BasicValue& _value, + OutputUnionType* _parent) const { + const auto field = + _parent->val_.native().getSchema().getFields()[SafeSizeToUInt(_index)]; + set_basic_value( + _value, [&](const auto& _v) { _parent->val_.native().set(field, _v); }); + return {}; +} } // namespace rfl::capnproto diff --git a/src/rfl/parsing/tabular/ArrowBridge.cpp b/src/rfl/parsing/tabular/ArrowBridge.cpp new file mode 100644 index 000000000..4103adbf9 --- /dev/null +++ b/src/rfl/parsing/tabular/ArrowBridge.cpp @@ -0,0 +1,483 @@ +#include "NativeArrowTypes.hpp" +#include "rfl/parsing/tabular/ArrowTypes.hpp" + +namespace rfl::parsing::tabular { +namespace { +void check_status(const arrow::Status& _status) { + if (!_status.ok()) throw std::runtime_error(_status.message()); +} +} // namespace +ArrowBuilder::ArrowBuilder(std::shared_ptr _impl) + : impl_(std::move(_impl)) {} +void ArrowBuilder::append_null() { + check_status(tabular::append_null(impl_.get())); +} +std::shared_ptr ArrowBuilder::finish() { + std::shared_ptr result; + check_status(impl_->Finish(&result)); + return result; +} +arrow::ArrayBuilder* ArrowBuilder::get() const { return impl_.get(); } + +std::shared_ptr ArrowScalar::data_type() { + return NativeArrowTypes::data_type(); +} +ArrowBuilder ArrowScalar::make_builder() { + using Native = NativeArrowTypes; + return ArrowBuilder(std::make_shared()); +} +void ArrowScalar::add_to_builder(const bool& _value, + BuilderType* _builder) { + using Native = NativeArrowTypes; + Native::add_to_builder( + _value, static_cast(_builder->get())); +} +Result> ArrowScalar::get_array( + const std::shared_ptr& _arr) { + return NativeArrowTypes::get_array(_arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +Result ArrowScalar::get_value(const Ref& _arr, + int64_t _ix) { + using Native = NativeArrowTypes; + return Native::get_value( + Ref::make( + std::static_pointer_cast(_arr.ptr())) + .value(), + _ix); +} +std::shared_ptr ArrowScalar::data_type() { + return NativeArrowTypes::data_type(); +} +ArrowBuilder ArrowScalar::make_builder() { + using Native = NativeArrowTypes; + return ArrowBuilder(std::make_shared()); +} +void ArrowScalar::add_to_builder(const uint8_t& _value, + BuilderType* _builder) { + using Native = NativeArrowTypes; + Native::add_to_builder( + _value, static_cast(_builder->get())); +} +Result> ArrowScalar::get_array( + const std::shared_ptr& _arr) { + return NativeArrowTypes::get_array(_arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +Result ArrowScalar::get_value(const Ref& _arr, + int64_t _ix) { + using Native = NativeArrowTypes; + return Native::get_value( + Ref::make( + std::static_pointer_cast(_arr.ptr())) + .value(), + _ix); +} +std::shared_ptr ArrowScalar::data_type() { + return NativeArrowTypes::data_type(); +} +ArrowBuilder ArrowScalar::make_builder() { + using Native = NativeArrowTypes; + return ArrowBuilder(std::make_shared()); +} +void ArrowScalar::add_to_builder(const uint16_t& _value, + BuilderType* _builder) { + using Native = NativeArrowTypes; + Native::add_to_builder( + _value, static_cast(_builder->get())); +} +Result> ArrowScalar::get_array( + const std::shared_ptr& _arr) { + return NativeArrowTypes::get_array(_arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +Result ArrowScalar::get_value(const Ref& _arr, + int64_t _ix) { + using Native = NativeArrowTypes; + return Native::get_value( + Ref::make( + std::static_pointer_cast(_arr.ptr())) + .value(), + _ix); +} +std::shared_ptr ArrowScalar::data_type() { + return NativeArrowTypes::data_type(); +} +ArrowBuilder ArrowScalar::make_builder() { + using Native = NativeArrowTypes; + return ArrowBuilder(std::make_shared()); +} +void ArrowScalar::add_to_builder(const uint32_t& _value, + BuilderType* _builder) { + using Native = NativeArrowTypes; + Native::add_to_builder( + _value, static_cast(_builder->get())); +} +Result> ArrowScalar::get_array( + const std::shared_ptr& _arr) { + return NativeArrowTypes::get_array(_arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +Result ArrowScalar::get_value(const Ref& _arr, + int64_t _ix) { + using Native = NativeArrowTypes; + return Native::get_value( + Ref::make( + std::static_pointer_cast(_arr.ptr())) + .value(), + _ix); +} +std::shared_ptr ArrowScalar::data_type() { + return NativeArrowTypes::data_type(); +} +ArrowBuilder ArrowScalar::make_builder() { + using Native = NativeArrowTypes; + return ArrowBuilder(std::make_shared()); +} +void ArrowScalar::add_to_builder(const uint64_t& _value, + BuilderType* _builder) { + using Native = NativeArrowTypes; + Native::add_to_builder( + _value, static_cast(_builder->get())); +} +Result> ArrowScalar::get_array( + const std::shared_ptr& _arr) { + return NativeArrowTypes::get_array(_arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +Result ArrowScalar::get_value(const Ref& _arr, + int64_t _ix) { + using Native = NativeArrowTypes; + return Native::get_value( + Ref::make( + std::static_pointer_cast(_arr.ptr())) + .value(), + _ix); +} +std::shared_ptr ArrowScalar::data_type() { + return NativeArrowTypes::data_type(); +} +ArrowBuilder ArrowScalar::make_builder() { + using Native = NativeArrowTypes; + return ArrowBuilder(std::make_shared()); +} +void ArrowScalar::add_to_builder(const int8_t& _value, + BuilderType* _builder) { + using Native = NativeArrowTypes; + Native::add_to_builder( + _value, static_cast(_builder->get())); +} +Result> ArrowScalar::get_array( + const std::shared_ptr& _arr) { + return NativeArrowTypes::get_array(_arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +Result ArrowScalar::get_value(const Ref& _arr, + int64_t _ix) { + using Native = NativeArrowTypes; + return Native::get_value( + Ref::make( + std::static_pointer_cast(_arr.ptr())) + .value(), + _ix); +} +std::shared_ptr ArrowScalar::data_type() { + return NativeArrowTypes::data_type(); +} +ArrowBuilder ArrowScalar::make_builder() { + using Native = NativeArrowTypes; + return ArrowBuilder(std::make_shared()); +} +void ArrowScalar::add_to_builder(const int16_t& _value, + BuilderType* _builder) { + using Native = NativeArrowTypes; + Native::add_to_builder( + _value, static_cast(_builder->get())); +} +Result> ArrowScalar::get_array( + const std::shared_ptr& _arr) { + return NativeArrowTypes::get_array(_arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +Result ArrowScalar::get_value(const Ref& _arr, + int64_t _ix) { + using Native = NativeArrowTypes; + return Native::get_value( + Ref::make( + std::static_pointer_cast(_arr.ptr())) + .value(), + _ix); +} +std::shared_ptr ArrowScalar::data_type() { + return NativeArrowTypes::data_type(); +} +ArrowBuilder ArrowScalar::make_builder() { + using Native = NativeArrowTypes; + return ArrowBuilder(std::make_shared()); +} +void ArrowScalar::add_to_builder(const int32_t& _value, + BuilderType* _builder) { + using Native = NativeArrowTypes; + Native::add_to_builder( + _value, static_cast(_builder->get())); +} +Result> ArrowScalar::get_array( + const std::shared_ptr& _arr) { + return NativeArrowTypes::get_array(_arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +Result ArrowScalar::get_value(const Ref& _arr, + int64_t _ix) { + using Native = NativeArrowTypes; + return Native::get_value( + Ref::make( + std::static_pointer_cast(_arr.ptr())) + .value(), + _ix); +} +std::shared_ptr ArrowScalar::data_type() { + return NativeArrowTypes::data_type(); +} +ArrowBuilder ArrowScalar::make_builder() { + using Native = NativeArrowTypes; + return ArrowBuilder(std::make_shared()); +} +void ArrowScalar::add_to_builder(const int64_t& _value, + BuilderType* _builder) { + using Native = NativeArrowTypes; + Native::add_to_builder( + _value, static_cast(_builder->get())); +} +Result> ArrowScalar::get_array( + const std::shared_ptr& _arr) { + return NativeArrowTypes::get_array(_arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +Result ArrowScalar::get_value(const Ref& _arr, + int64_t _ix) { + using Native = NativeArrowTypes; + return Native::get_value( + Ref::make( + std::static_pointer_cast(_arr.ptr())) + .value(), + _ix); +} +std::shared_ptr ArrowScalar::data_type() { + return NativeArrowTypes::data_type(); +} +ArrowBuilder ArrowScalar::make_builder() { + using Native = NativeArrowTypes; + return ArrowBuilder(std::make_shared()); +} +void ArrowScalar::add_to_builder(const float& _value, + BuilderType* _builder) { + using Native = NativeArrowTypes; + Native::add_to_builder( + _value, static_cast(_builder->get())); +} +Result> ArrowScalar::get_array( + const std::shared_ptr& _arr) { + return NativeArrowTypes::get_array(_arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +Result ArrowScalar::get_value(const Ref& _arr, + int64_t _ix) { + using Native = NativeArrowTypes; + return Native::get_value( + Ref::make( + std::static_pointer_cast(_arr.ptr())) + .value(), + _ix); +} +std::shared_ptr ArrowScalar::data_type() { + return NativeArrowTypes::data_type(); +} +ArrowBuilder ArrowScalar::make_builder() { + using Native = NativeArrowTypes; + return ArrowBuilder(std::make_shared()); +} +void ArrowScalar::add_to_builder(const double& _value, + BuilderType* _builder) { + using Native = NativeArrowTypes; + Native::add_to_builder( + _value, static_cast(_builder->get())); +} +Result> ArrowScalar::get_array( + const std::shared_ptr& _arr) { + return NativeArrowTypes::get_array(_arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +Result ArrowScalar::get_value(const Ref& _arr, + int64_t _ix) { + using Native = NativeArrowTypes; + return Native::get_value( + Ref::make( + std::static_pointer_cast(_arr.ptr())) + .value(), + _ix); +} +std::shared_ptr ArrowScalar::data_type() { + return NativeArrowTypes::data_type(); +} +ArrowBuilder ArrowScalar::make_builder() { + using Native = NativeArrowTypes; + return ArrowBuilder(std::make_shared()); +} +void ArrowScalar::add_to_builder(const std::string& _value, + BuilderType* _builder) { + using Native = NativeArrowTypes; + Native::add_to_builder( + _value, static_cast(_builder->get())); +} +Result> ArrowScalar::get_array( + const std::shared_ptr& _arr) { + return NativeArrowTypes::get_array( + _arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +Result ArrowScalar::get_value( + const Ref& _arr, int64_t _ix) { + using Native = NativeArrowTypes; + return Native::get_value( + Ref::make( + std::static_pointer_cast(_arr.ptr())) + .value(), + _ix); +} +std::shared_ptr binary_data_type() { return arrow::binary(); } +ArrowBuilder make_binary_builder() { + return ArrowBuilder(std::make_shared()); +} +void append_binary(ArrowBuilder* _builder, const uint8_t* _bytes, + size_t _size) { + check_status(static_cast(_builder->get()) + ->Append(_bytes, _size)); +} +Result> binary_array( + const std::shared_ptr& _arr) { + return NativeArrowTypes, + SerializationType::parquet>::get_array(_arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +std::string_view binary_value(const Ref& _arr, int64_t _ix) { + return static_cast(_arr.get())->Value(_ix); +} +std::shared_ptr timestamp_data_type() { + return arrow::timestamp(arrow::TimeUnit::MILLI); +} +ArrowBuilder make_timestamp_builder() { + return ArrowBuilder(std::make_shared( + timestamp_data_type(), arrow::default_memory_pool())); +} +void append_timestamp(ArrowBuilder* _builder, int64_t _value) { + check_status( + static_cast(_builder->get())->Append(_value)); +} +Result> timestamp_array( + const std::shared_ptr& _arr, + Result (*_parse)(std::string_view)) { + // The format-dependent conversion is supplied by the importing template. + // Arrow types and builders stay in this translation unit. + if (_arr->type()->Equals(arrow::utf8())) { + const auto strings = std::static_pointer_cast(_arr); + auto builder = make_timestamp_builder(); + for (int64_t i = 0; i < strings->length(); ++i) { + if (strings->IsNull(i)) + builder.append_null(); + else { + const auto value = _parse(strings->Value(i)); + if (!value) return error(value.error().what()); + append_timestamp(&builder, *value); + } + } + return Ref::make(builder.finish()); + } + // Non-string timestamps do not depend on the user's format. + return NativeArrowTypes, + SerializationType::parquet>::get_array(_arr) + .and_then([](const auto& _value) { + return Ref::make( + std::static_pointer_cast(_value.ptr())); + }); +} +int64_t timestamp_value(const Ref& _arr, int64_t _ix) { + return static_cast(_arr.get())->Value(_ix); +} +bool array_is_null(const Ref& _arr, int64_t _ix) { + return _arr->IsNull(_ix); +} +int64_t array_length(const Ref& _arr) { return _arr->length(); } +int num_chunks(const Ref& _arr) { + return _arr->num_chunks(); +} +std::shared_ptr array_chunk(const Ref& _arr, + int _ix) { + return _arr->chunk(_ix); +} +Result> table_column(const Ref& _table, + const std::string& _name) { + const auto column = _table->GetColumnByName(_name); + if (!column) return error("Column named '" + _name + "' not found."); + return Ref::make(column); +} +std::shared_ptr make_arrow_field( + const std::string& _name, const std::shared_ptr& _type) { + return arrow::field(_name, _type); +} +std::shared_ptr make_schema( + const std::vector>& _fields) { + return arrow::schema(_fields); +} +std::shared_ptr make_table( + const std::shared_ptr& _schema, + const std::vector>& _arrays) { + return arrow::Table::Make(_schema, _arrays); +} +std::shared_ptr make_chunked_array( + const std::vector>& _arrays, + const std::shared_ptr& _type) { + return std::make_shared(_arrays, _type); +} +std::string_view buffer_view(const Ref& _buffer) { + return std::string_view(*_buffer); +} +} // namespace rfl::parsing::tabular diff --git a/src/rfl/parsing/tabular/NativeArrowTypes.hpp b/src/rfl/parsing/tabular/NativeArrowTypes.hpp new file mode 100644 index 000000000..1d0c1a76b --- /dev/null +++ b/src/rfl/parsing/tabular/NativeArrowTypes.hpp @@ -0,0 +1,1059 @@ +#ifndef RFL_NATIVE_ARROW_TYPES_HPP_ +#define RFL_NATIVE_ARROW_TYPES_HPP_ + +#include + +#include +#include +#include +#include + +#include "rfl/Ref.hpp" +#include "rfl/Timestamp.hpp" +#include "rfl/always_false.hpp" +#include "rfl/concepts.hpp" +#include "rfl/internal/StringLiteral.hpp" +#include "rfl/internal/ptr_cast.hpp" +#include "rfl/parsing/tabular/ArrowBridge.hpp" +#include "rfl/parsing/tabular/arrow_builder_operations.hpp" + +namespace rfl::parsing::tabular { + +template +struct NativeArrowTypes; + +/** + * @brief Transforms a numerical array to the desired type T. + * @tparam T The desired type. + * @tparam _s The serialization type. + * @param _arr The array to transform. + * @return The transformed array or an error. + */ +template +Result::ArrayType>> +native_transform_numerical_array( + const std::shared_ptr& _arr) noexcept; + +template +struct NativeArrowTypes { + using ArrayType = arrow::BooleanArray; + using BuilderType = arrow::BooleanBuilder; + + /** + * @brief Returns the Arrow data type for boolean. + * @return The Arrow data type. + */ + static auto data_type() { return arrow::boolean(); } + + /** + * @brief Adds a boolean value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const bool _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the boolean array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The boolean array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + if (_arr->type()->Equals(data_type())) { + return Ref::make(std::static_pointer_cast(_arr)); + } else { + return error("Expected boolean array, got " + _arr->type()->ToString() + + "."); + } + } + + /** + * @brief Returns the boolean value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The boolean value. + */ + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + /** + * @brief Creates a builder for boolean arrays. + * @return The builder. + */ + static auto make_builder() { return BuilderType(); } +}; + +template +struct NativeArrowTypes { + using ArrayType = arrow::UInt8Array; + using BuilderType = arrow::UInt8Builder; + using T = uint8_t; + + /** + * @brief Returns the Arrow data type for uint8. + * @return The Arrow data type. + */ + static auto data_type() { return arrow::uint8(); } + + /** + * @brief Adds a uint8 value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the uint8 array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The uint8 array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + return native_transform_numerical_array(_arr); + } + + /** + * @brief Returns the uint8 value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The uint8 value. + */ + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + /** + * @brief Creates a builder for uint8 arrays. + * @return The builder. + */ + static auto make_builder() { return BuilderType(); } +}; + +template +struct NativeArrowTypes { + using ArrayType = arrow::UInt16Array; + using BuilderType = arrow::UInt16Builder; + using T = uint16_t; + + /** + * @brief Returns the Arrow data type for uint16. + * @return The Arrow data type. + */ + static auto data_type() { return arrow::uint16(); } + + /** + * @brief Adds a uint16 value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the uint16 array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The uint16 array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + return native_transform_numerical_array(_arr); + } + + /** + * @brief Returns the uint16 value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The uint16 value. + */ + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + /** + * @brief Creates a builder for uint16 arrays. + * @return The builder. + */ + static auto make_builder() { return BuilderType(); } +}; + +template +struct NativeArrowTypes { + using ArrayType = arrow::UInt32Array; + using BuilderType = arrow::UInt32Builder; + using T = uint32_t; + + /** + * @brief Returns the Arrow data type for uint32. + * @return The Arrow data type. + */ + static auto data_type() { return arrow::uint32(); } + + /** + * @brief Adds a uint32 value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the uint32 array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The uint32 array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + return native_transform_numerical_array(_arr); + } + + /** + * @brief Returns the uint32 value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The uint32 value. + */ + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + /** + * @brief Creates a builder for uint32 arrays. + * @return The builder. + */ + static auto make_builder() { return BuilderType(); } +}; + +template +struct NativeArrowTypes { + using ArrayType = arrow::UInt64Array; + using BuilderType = arrow::UInt64Builder; + using T = uint64_t; + + /** + * @brief Returns the Arrow data type for uint64. + * @return The Arrow data type. + */ + static auto data_type() { return arrow::uint64(); } + + /** + * @brief Adds a uint64 value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the uint64 array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The uint64 array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + return native_transform_numerical_array(_arr); + } + + /** + * @brief Returns the uint64 value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The uint64 value. + */ + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + /** + * @brief Creates a builder for uint64 arrays. + * @return The builder. + */ + static auto make_builder() { return BuilderType(); } +}; + +template +struct NativeArrowTypes { + using ArrayType = arrow::Int8Array; + using BuilderType = arrow::Int8Builder; + using T = int8_t; + + /** + * @brief Returns the Arrow data type for int8. + * @return The Arrow data type. + */ + static auto data_type() { return arrow::int8(); } + + /** + * @brief Adds an int8 value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the int8 array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The int8 array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + return native_transform_numerical_array(_arr); + } + + /** + * @brief Returns the int8 value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The int8 value. + */ + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + /** + * @brief Creates a builder for int8 arrays. + * @return The builder. + */ + static auto make_builder() { return BuilderType(); } +}; + +template +struct NativeArrowTypes { + using ArrayType = arrow::Int16Array; + using BuilderType = arrow::Int16Builder; + using T = int16_t; + + /** + * @brief Returns the Arrow data type for int16. + * @return The Arrow data type. + */ + static auto data_type() { return arrow::int16(); } + + /** + * @brief Adds an int16 value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the int16 array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The int16 array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + return native_transform_numerical_array(_arr); + } + + /** + * @brief Returns the int16 value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The int16 value. + */ + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + /** + * @brief Creates a builder for int16 arrays. + * @return The builder. + */ + static auto make_builder() { return BuilderType(); } +}; + +template +struct NativeArrowTypes { + using ArrayType = arrow::Int32Array; + using BuilderType = arrow::Int32Builder; + using T = int32_t; + + /** + * @brief Returns the Arrow data type for int32. + * @return The Arrow data type. + */ + static auto data_type() { return arrow::int32(); } + + /** + * @brief Adds an int32 value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the int32 array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The int32 array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + return native_transform_numerical_array(_arr); + } + + /** + * @brief Returns the int32 value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The int32 value. + */ + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + /** + * @brief Creates a builder for int32 arrays. + * @return The builder. + */ + static auto make_builder() { return BuilderType(); } +}; + +template +struct NativeArrowTypes { + using ArrayType = arrow::Int64Array; + using BuilderType = arrow::Int64Builder; + using T = int64_t; + + /** + * @brief Returns the Arrow data type for int64. + * @return The Arrow data type. + */ + static auto data_type() { return arrow::int64(); } + + /** + * @brief Adds an int64 value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the int64 array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The int64 array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + return native_transform_numerical_array(_arr); + } + + /** + * @brief Returns the int64 value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The int64 value. + */ + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + /** + * @brief Creates a builder for int64 arrays. + * @return The builder. + */ + static auto make_builder() { return BuilderType(); } +}; + +template +struct NativeArrowTypes { + using ArrayType = arrow::FloatArray; + using BuilderType = arrow::FloatBuilder; + using T = float; + + /** + * @brief Returns the Arrow data type for float32. + * @return The Arrow data type. + */ + static auto data_type() { return arrow::float32(); } + + /** + * @brief Adds a float value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the float array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The float array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + return native_transform_numerical_array(_arr); + } + + /** + * @brief Returns the float value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The float value. + */ + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + /** + * @brief Creates a builder for float arrays. + * @return The builder. + */ + static auto make_builder() { return BuilderType(); } +}; + +template +struct NativeArrowTypes { + using ArrayType = arrow::DoubleArray; + using BuilderType = arrow::DoubleBuilder; + using T = double; + + /** + * @brief Returns the Arrow data type for float64. + * @return The Arrow data type. + */ + static auto data_type() { return arrow::float64(); } + + /** + * @brief Adds a double value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const auto _val, BuilderType* _builder) { + const auto status = _builder->Append(_val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the double array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The double array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + return native_transform_numerical_array(_arr); + } + + /** + * @brief Returns the double value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The double value. + */ + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return _chunk->Value(_ix); + } + + /** + * @brief Creates a builder for double arrays. + * @return The builder. + */ + static auto make_builder() { return BuilderType(); } +}; + +template +struct NativeArrowTypes { + using ArrayType = arrow::StringArray; + using BuilderType = arrow::StringBuilder; + + /** + * @brief Returns the Arrow data type for string (utf8). + * @return The Arrow data type. + */ + static auto data_type() { return arrow::utf8(); } + + /** + * @brief Adds a string value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const auto& _val, BuilderType* _builder) { + const auto status = append_string(_builder, _val); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the string array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The string array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + if (_arr->type()->Equals(data_type())) { + return Ref::make(std::static_pointer_cast(_arr)); + } else { + return error("Expected string array, got " + _arr->type()->ToString() + + "."); + } + } + + /** + * @brief Returns the string value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The string value. + */ + static Result get_value(const Ref& _chunk, + const int64_t _ix) { + return std::string(_chunk->Value(_ix)); + } + + /** + * @brief Creates a builder for string arrays. + * @return The builder. + */ + static auto make_builder() { return BuilderType(); } +}; + +template + requires concepts::ContiguousByteContainer +struct NativeArrowTypes { + using ArrayType = arrow::BinaryArray; + using BuilderType = arrow::BinaryBuilder; + + /** + * @brief Returns the Arrow data type for binary. + * @return The Arrow data type. + */ + static auto data_type() { return arrow::binary(); } + + /** + * @brief Adds a binary value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const auto& _val, BuilderType* _builder) { + const auto status = _builder->Append( + internal::ptr_cast(_val.data()), _val.size()); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the binary array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The binary array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + if (_arr->type()->Equals(data_type())) { + return Ref::make(std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(arrow::utf8())) { + return transform_string( + std::static_pointer_cast(_arr)); + + } else { + return error("Expected binary or string array, got " + + _arr->type()->ToString() + "."); + } + } + + /** + * @brief Returns the binary value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The binary value. + */ + static Result get_value(const Ref& _chunk, const int64_t _ix) { + const auto begin = internal::ptr_cast( + _chunk->Value(_ix).data()); + return T(begin, begin + _chunk->Value(_ix).size()); + } + + /** + * @brief Creates a builder for binary arrays. + * @return The builder. + */ + static auto make_builder() { return BuilderType(); } + + /** + * @brief Transforms a string array to a binary array. + * @param _arr The string array. + * @return The binary array or an error. + */ + static Result> transform_string( + const std::shared_ptr& _arr) noexcept { + if (!_arr) { + return error( + "transform_string: std::shared_ptr not set. This is a " + "bug, please report."); + } + + auto builder = arrow::BinaryBuilder(); + + for (int64_t i = 0; i < _arr->length(); ++i) { + if (_arr->IsNull(i)) { + const auto status = builder.AppendNull(); + if (!status.ok()) { + return error(status.message()); + } + } else { + const std::string_view s = _arr->Value(i); + const auto status = builder.Append( + internal::ptr_cast(s.data()), s.size()); + if (!status.ok()) { + return error(status.message()); + } + } + } + + std::shared_ptr res; + const auto status = builder.Finish(&res); + return Ref::make( + std::static_pointer_cast(res)); + } +}; + +template +struct NativeArrowTypes, _s> { + enum class TimeUnit { day, second, milli, micro, nano, string }; + + using ArrayType = arrow::TimestampArray; + using BuilderType = arrow::TimestampBuilder; + + /** + * @brief Returns the Arrow data type for timestamps (milli). + * @return The Arrow data type. + */ + static auto data_type() { return arrow::timestamp(arrow::TimeUnit::MILLI); } + + /** + * @brief Adds a timestamp value to the builder. + * @param _val The value to add. + * @param _builder The builder to add to. + */ + static void add_to_builder(const auto& _val, BuilderType* _builder) { + const auto status = _builder->Append(_val.to_time_t() * 1000); + if (!status.ok()) { + throw std::runtime_error(status.message()); + } + } + + /** + * @brief Returns the timestamp array from the shared pointer. + * @param _arr The shared pointer to the arrow array. + * @return The timestamp array or an error. + */ + static Result> get_array( + const std::shared_ptr& _arr) { + if (_arr->type()->Equals(data_type())) { + return Ref::make(std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals( + arrow::timestamp(arrow::TimeUnit::SECOND))) { + return transform_time_stamp( + std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(arrow::timestamp(arrow::TimeUnit::MICRO))) { + return transform_time_stamp( + std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(arrow::timestamp(arrow::TimeUnit::NANO))) { + return transform_time_stamp( + std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(arrow::date32())) { + return transform_time_stamp( + std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(arrow::date64())) { + return transform_time_stamp( + std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(arrow::utf8())) { + return transform_time_stamp( + std::static_pointer_cast(_arr)); + + } else { + return error("Expected timestamp, date32, date64 or string array, got " + + _arr->type()->ToString() + "."); + } + } + + /** + * @brief Returns the timestamp value from the array at the given index. + * @param _chunk The array to get the value from. + * @param _ix The index of the value. + * @return The timestamp value. + */ + static Result> get_value(const Ref& _chunk, + const int64_t _ix) { + return Timestamp<_format>(_chunk->Value(_ix) / 1000); + } + + /** + * @brief Creates a builder for timestamp arrays. + * @return The builder. + */ + static auto make_builder() { + return BuilderType(data_type(), arrow::default_memory_pool()); + } + + /** + * @brief Transforms an array with different time units to a timestamp array. + * @tparam _unit The time unit of the source array. + * @tparam SourceArrayType The type of the source array. + * @param _arr The source array. + * @return The timestamp array or an error. + */ + template + static Result> transform_time_stamp( + const std::shared_ptr& _arr) noexcept { + if (!_arr) { + return error( + "transform_time_stamp: std::shared_ptr not set. This is a " + "bug, please report."); + } + + auto builder = + arrow::TimestampBuilder(data_type(), arrow::default_memory_pool()); + + for (int64_t i = 0; i < _arr->length(); ++i) { + if (_arr->IsNull(i)) { + const auto status = builder.AppendNull(); + if (!status.ok()) { + return error(status.message()); + } + } else { + if constexpr (_unit == TimeUnit::day) { + const auto status = builder.Append( + static_cast(_arr->Value(i)) * 1000 * 24 * 60 * 60); + if (!status.ok()) { + return error(status.message()); + } + } else if constexpr (_unit == TimeUnit::second) { + const auto status = + builder.Append(static_cast(_arr->Value(i) * 1000)); + if (!status.ok()) { + return error(status.message()); + } + } else if constexpr (_unit == TimeUnit::milli) { + const auto status = + builder.Append(static_cast(_arr->Value(i))); + if (!status.ok()) { + return error(status.message()); + } + } else if constexpr (_unit == TimeUnit::micro) { + const auto status = + builder.Append(static_cast(_arr->Value(i) / 1000)); + if (!status.ok()) { + return error(status.message()); + } + } else if constexpr (_unit == TimeUnit::nano) { + const auto status = + builder.Append(static_cast(_arr->Value(i) / 1000000)); + if (!status.ok()) { + return error(status.message()); + } + } else if constexpr (_unit == TimeUnit::string) { + const auto ts = Timestamp<_format>::make(std::string(_arr->Value(i))); + if (!ts) { + return error(ts.error().what()); + } + const auto status = builder.Append(ts->to_time_t() * 1000); + if (!status.ok()) { + return error(status.message()); + } + } else { + static_assert(rfl::always_false_v, + "Unsupported time unit."); + } + } + } + + std::shared_ptr res; + const auto status = builder.Finish(&res); + return Ref::make( + std::static_pointer_cast(res)); + } +}; + +/** + * @brief Implementation of numerical array transformation. + * @tparam T The target type. + * @tparam _s The serialization type. + * @tparam SourceArrayType The type of the source array. + * @param _arr The source array. + * @return The transformed array or an error. + */ +template +Result::ArrayType>> +native_transform_numerical_array_impl( + const std::shared_ptr& _arr) noexcept { + if (!_arr) { + return error( + "native_transform_numerical_array_impl: std::shared_ptr not set. This " + "is a " + "bug, please report."); + } + + auto builder = NativeArrowTypes::make_builder(); + + for (int64_t i = 0; i < _arr->length(); ++i) { + if (_arr->IsNull(i)) { + const auto status = builder.AppendNull(); + if (!status.ok()) { + return error(status.message()); + } + } else { + const auto status = builder.Append(static_cast(_arr->Value(i))); + if (!status.ok()) { + return error(status.message()); + } + } + } + + using TargetArrayType = typename NativeArrowTypes::ArrayType; + + std::shared_ptr res; + const auto status = builder.Finish(&res); + return Ref::make( + std::static_pointer_cast(res)); +} + +/** + * @brief Transforms a numerical array to the desired type T. + * @tparam T The desired type. + * @tparam _s The serialization type. + * @param _arr The array to transform. + * @return The transformed array or an error. + */ +template +Result::ArrayType>> +native_transform_numerical_array( + const std::shared_ptr& _arr) noexcept { + if (!_arr) { + return error( + "Could not transform the numerical array. std::shared_ptr not set."); + } + + using ArrayType = typename NativeArrowTypes::ArrayType; + + if (_arr->type()->Equals(NativeArrowTypes::data_type())) { + return Ref::make(std::static_pointer_cast(_arr)); + + } else if (_arr->type()->Equals(NativeArrowTypes::data_type())) { + return native_transform_numerical_array_impl( + std::static_pointer_cast< + typename NativeArrowTypes::ArrayType>(_arr)); + + } else if (_arr->type()->Equals( + NativeArrowTypes::data_type())) { + return native_transform_numerical_array_impl( + std::static_pointer_cast< + typename NativeArrowTypes::ArrayType>(_arr)); + + } else if (_arr->type()->Equals( + NativeArrowTypes::data_type())) { + return native_transform_numerical_array_impl( + std::static_pointer_cast< + typename NativeArrowTypes::ArrayType>(_arr)); + + } else if (_arr->type()->Equals( + NativeArrowTypes::data_type())) { + return native_transform_numerical_array_impl( + std::static_pointer_cast< + typename NativeArrowTypes::ArrayType>(_arr)); + + } else if (_arr->type()->Equals(NativeArrowTypes::data_type())) { + return native_transform_numerical_array_impl( + std::static_pointer_cast< + typename NativeArrowTypes::ArrayType>(_arr)); + + } else if (_arr->type()->Equals(NativeArrowTypes::data_type())) { + return native_transform_numerical_array_impl( + std::static_pointer_cast< + typename NativeArrowTypes::ArrayType>(_arr)); + + } else if (_arr->type()->Equals(NativeArrowTypes::data_type())) { + return native_transform_numerical_array_impl( + std::static_pointer_cast< + typename NativeArrowTypes::ArrayType>(_arr)); + + } else if (_arr->type()->Equals(NativeArrowTypes::data_type())) { + return native_transform_numerical_array_impl( + std::static_pointer_cast< + typename NativeArrowTypes::ArrayType>(_arr)); + + } else if (_arr->type()->Equals(NativeArrowTypes::data_type())) { + return native_transform_numerical_array_impl( + std::static_pointer_cast< + typename NativeArrowTypes::ArrayType>(_arr)); + + } else if (_arr->type()->Equals(NativeArrowTypes::data_type())) { + return native_transform_numerical_array_impl( + std::static_pointer_cast< + typename NativeArrowTypes::ArrayType>(_arr)); + + } else { + return error("Expected numerical array, got " + _arr->type()->ToString() + + "."); + } +} + +} // namespace rfl::parsing::tabular + +#endif diff --git a/tests/capnproto/native_reference.cpp b/tests/capnproto/native_reference.cpp new file mode 100644 index 000000000..fd6122146 --- /dev/null +++ b/tests/capnproto/native_reference.cpp @@ -0,0 +1,41 @@ +#include "native_reference.hpp" + +#include +#include +#include +#include + +namespace test_capnproto_bridge { +std::vector reference_bytes(const capnp::ParsedSchema& _schema, + const Record& _record) { + capnp::MallocMessageBuilder message; + auto root = message.initRoot( + _schema.getAllNested()[0].asStruct()); + root.set("text", _record.text.c_str()); + root.set("count", _record.count); + root.set("ready", _record.ready); + auto values = + root.init("values", _record.values.size()).as(); + for (unsigned i = 0; i < values.size(); ++i) values.set(i, _record.values[i]); + kj::VectorOutputStream stream; + capnp::writePackedMessage(stream, message); + const auto bytes = stream.getArray(); + const auto begin = reinterpret_cast(bytes.begin()); + return {begin, begin + bytes.size()}; +} +Record reference_read(const capnp::ParsedSchema& _schema, + const std::vector& _bytes) { + kj::ArrayInputStream stream(kj::ArrayPtr( + reinterpret_cast(_bytes.data()), _bytes.size())); + capnp::PackedMessageReader message(stream); + auto root = message.getRoot( + _schema.getAllNested()[0].asStruct()); + Record result{root.get("text").as().cStr(), + root.get("count").as(), + root.get("ready").as(), + {}}; + for (auto value : root.get("values").as()) + result.values.push_back(value.as()); + return result; +} +} // namespace test_capnproto_bridge diff --git a/tests/capnproto/native_reference.hpp b/tests/capnproto/native_reference.hpp new file mode 100644 index 000000000..2b626fd24 --- /dev/null +++ b/tests/capnproto/native_reference.hpp @@ -0,0 +1,19 @@ +#ifndef RFL_TEST_CAPNPROTO_NATIVE_REFERENCE_HPP_ +#define RFL_TEST_CAPNPROTO_NATIVE_REFERENCE_HPP_ +#include +#include +#include +namespace capnp { +class ParsedSchema; +} +namespace test_capnproto_bridge { +struct Record { + std::string text; + int64_t count; + bool ready; + std::vector values; +}; +std::vector reference_bytes(const capnp::ParsedSchema&, const Record&); +Record reference_read(const capnp::ParsedSchema&, const std::vector&); +} // namespace test_capnproto_bridge +#endif diff --git a/tests/capnproto/test_native_constructor.cpp b/tests/capnproto/test_native_constructor.cpp new file mode 100644 index 000000000..d5f7a83c3 --- /dev/null +++ b/tests/capnproto/test_native_constructor.cpp @@ -0,0 +1,26 @@ +#include +#include + +#include +#include +#include + +namespace test_capnproto_native_constructor { +struct Record { + std::string text; + int64_t count; + static Record from_capnproto_obj(const auto& _var) { + const auto object = _var.val_.template as(); + return { + std::string(object.get("text").template as().cStr()) + "!", + object.get("count").template as()}; + } +}; +TEST(capnproto, native_constructor) { + const auto parsed = rfl::capnproto::read( + rfl::capnproto::write(Record{"native", -42})); + ASSERT_TRUE(parsed); + EXPECT_EQ(parsed->text, "native!"); + EXPECT_EQ(parsed->count, -42); +} +} // namespace test_capnproto_native_constructor diff --git a/tests/capnproto/test_native_interoperability.cpp b/tests/capnproto/test_native_interoperability.cpp new file mode 100644 index 000000000..dd328c9ce --- /dev/null +++ b/tests/capnproto/test_native_interoperability.cpp @@ -0,0 +1,36 @@ +#include + +#include +#include +#include + +#include "native_reference.hpp" + +namespace test_capnproto_bridge { +TEST(capnproto, native_interoperability) { + const Record expected{"module bridge 世界", + std::numeric_limits::min(), + true, + {0.5, -1.25, 0.0}}; + const auto schema = rfl::capnproto::to_schema(); + const auto bytes = rfl::capnproto::write(expected, schema); + EXPECT_EQ(bytes, reference_bytes(schema.value(), expected)); + const auto native = reference_read(schema.value(), bytes); + EXPECT_EQ(native.text, expected.text); + EXPECT_EQ(native.count, expected.count); + EXPECT_EQ(native.ready, expected.ready); + EXPECT_EQ(native.values, expected.values); + const auto parsed = rfl::capnproto::read( + reference_bytes(schema.value(), expected), schema); + ASSERT_TRUE(parsed); + EXPECT_EQ(parsed->text, expected.text); + EXPECT_EQ(parsed->count, expected.count); + EXPECT_EQ(parsed->values, expected.values); + + std::stringstream stream; + rfl::capnproto::write(expected, schema, stream); + const auto streamed = rfl::capnproto::read(stream, schema); + ASSERT_TRUE(streamed); + EXPECT_EQ(streamed->values, expected.values); +} +} // namespace test_capnproto_bridge diff --git a/tests/parquet/native_reference.cpp b/tests/parquet/native_reference.cpp new file mode 100644 index 000000000..585f86b4c --- /dev/null +++ b/tests/parquet/native_reference.cpp @@ -0,0 +1,85 @@ +#include "native_reference.hpp" + +#include +#include +#include +#include + +#include + +namespace test_parquet_bridge { +namespace { +void check(const arrow::Status& _status) { + if (!_status.ok()) throw std::runtime_error(_status.message()); +} +template +T unwrap(arrow::Result _value) { + if (!_value.ok()) throw std::runtime_error(_value.status().message()); + return std::move(_value).ValueOrDie(); +} +} // namespace +std::vector reference_bytes() { + arrow::UInt16Builder counts; + check(counts.Append(42)); + check(counts.Append(43)); + arrow::UInt8Builder nullable; + check(nullable.AppendNull()); + check(nullable.Append(17)); + arrow::FloatBuilder scores; + check(scores.Append(0.5)); + check(scores.Append(2.5)); + const auto time_type = arrow::timestamp(arrow::TimeUnit::NANO); + arrow::TimestampBuilder times(time_type, arrow::default_memory_pool()); + check(times.Append(1704067200000000000LL)); + check(times.Append(1704067201000000000LL)); + const auto names = + unwrap(arrow::MakeArrayFromScalar(arrow::StringScalar("native 世界"), 2)); + const auto blobs = unwrap(arrow::MakeArrayFromScalar( + arrow::BinaryScalar(std::string("\0\x7f\xff", 3)), 2)); + auto table = arrow::Table::Make( + arrow::schema({arrow::field("count", arrow::uint16()), + arrow::field("maybe", arrow::uint8()), + arrow::field("score", arrow::float32()), + arrow::field("when", time_type), + arrow::field("name", arrow::utf8()), + arrow::field("bytes", arrow::binary())}), + {unwrap(counts.Finish()), unwrap(nullable.Finish()), + unwrap(scores.Finish()), unwrap(times.Finish()), names, blobs}); + auto stream = unwrap(arrow::io::BufferOutputStream::Create()); + auto properties = + parquet::ArrowWriterProperties::Builder().store_schema()->build(); + check(parquet::arrow::WriteTable(*table, arrow::default_memory_pool(), stream, + 1, parquet::default_writer_properties(), + properties)); + auto buffer = unwrap(stream->Finish()); + return {reinterpret_cast(buffer->data()), + reinterpret_cast(buffer->data()) + buffer->size()}; +} +bool reference_check(const std::vector& _bytes) { + auto input = + std::make_shared(std::make_shared( + reinterpret_cast(_bytes.data()), _bytes.size())); + auto reader = + unwrap(parquet::arrow::OpenFile(input, arrow::default_memory_pool())); + std::shared_ptr table; + check(reader->ReadTable(&table)); + table = unwrap(table->CombineChunks()); + if (table->num_rows() != 2) return false; + const auto count = std::static_pointer_cast( + table->GetColumnByName("count")->chunk(0)); + const auto maybe = std::static_pointer_cast( + table->GetColumnByName("maybe")->chunk(0)); + const auto score = std::static_pointer_cast( + table->GetColumnByName("score")->chunk(0)); + const auto when = std::static_pointer_cast( + table->GetColumnByName("when")->chunk(0)); + const auto name = std::static_pointer_cast( + table->GetColumnByName("name")->chunk(0)); + const auto bytes = std::static_pointer_cast( + table->GetColumnByName("bytes")->chunk(0)); + return count->Value(1) == 43 && maybe->IsNull(0) && maybe->Value(1) == 17 && + score->Value(1) == 2.5 && when->Value(1) == 1704067201000LL && + name->Value(0) == "native 世界" && + bytes->Value(1) == std::string_view("\0\x7f\xff", 3); +} +} // namespace test_parquet_bridge diff --git a/tests/parquet/native_reference.hpp b/tests/parquet/native_reference.hpp new file mode 100644 index 000000000..c4d5b8906 --- /dev/null +++ b/tests/parquet/native_reference.hpp @@ -0,0 +1,8 @@ +#ifndef RFL_TEST_PARQUET_NATIVE_REFERENCE_HPP_ +#define RFL_TEST_PARQUET_NATIVE_REFERENCE_HPP_ +#include +namespace test_parquet_bridge { +std::vector reference_bytes(); +bool reference_check(const std::vector&); +} // namespace test_parquet_bridge +#endif diff --git a/tests/parquet/test_native_interoperability.cpp b/tests/parquet/test_native_interoperability.cpp new file mode 100644 index 000000000..42f5d0971 --- /dev/null +++ b/tests/parquet/test_native_interoperability.cpp @@ -0,0 +1,61 @@ +#include + +#include +#include +#include +#include +#include + +#include "native_reference.hpp" + +namespace test_parquet_bridge { +struct Record { + int32_t count; + std::optional maybe; + double score; + rfl::Timestamp<"%Y-%m-%d %H:%M:%S"> when; + std::string name; + rfl::Bytestring bytes; +}; +TEST(parquet, native_interoperability) { + const auto records = + rfl::parquet::read>(reference_bytes()); + ASSERT_TRUE(records) << records.error().what(); + ASSERT_EQ(records->size(), 2U); + EXPECT_EQ((*records)[0].count, 42); + EXPECT_FALSE((*records)[0].maybe); + EXPECT_EQ((*records)[1].maybe, 17); + EXPECT_EQ((*records)[1].score, 2.5); + EXPECT_EQ((*records)[1].when.to_time_t(), 1704067201); + EXPECT_EQ((*records)[0].name, "native 世界"); + const auto bytes = + rfl::parquet::write(*records, rfl::parquet::Settings{.chunksize = 1}); + EXPECT_TRUE(reference_check(bytes)); +} +} // namespace test_parquet_bridge + +namespace test_parquet_bridge { +TEST(parquet, chunked_nullable_bridge) { + std::vector expected; + for (int32_t i = 0; i < 513; ++i) { + expected.push_back( + Record{i - 256, i % 3 ? std::optional(i * 1000) : std::nullopt, + i * 0.25, rfl::Timestamp<"%Y-%m-%d %H:%M:%S">(1704067200 + i), + std::string(100, static_cast('a' + i % 26)), + rfl::Bytestring{std::byte{0}, std::byte{0xff}}}); + } + const auto bytes = + rfl::parquet::write(expected, rfl::parquet::Settings{.chunksize = 128}); + const auto actual = rfl::parquet::read>(bytes); + ASSERT_TRUE(actual) << actual.error().what(); + ASSERT_EQ(actual->size(), expected.size()); + for (size_t i = 0; i < expected.size(); ++i) { + EXPECT_EQ(actual->at(i).count, expected[i].count); + EXPECT_EQ(actual->at(i).maybe, expected[i].maybe); + EXPECT_EQ(actual->at(i).score, expected[i].score); + EXPECT_EQ(actual->at(i).when.to_time_t(), expected[i].when.to_time_t()); + EXPECT_EQ(actual->at(i).name, expected[i].name); + EXPECT_EQ(actual->at(i).bytes, expected[i].bytes); + } +} +} // namespace test_parquet_bridge From 0aa13318d46cc478be0f08604d7af82ffebacf30 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Sun, 18 Oct 2026 15:42:07 +0800 Subject: [PATCH 13/18] Propagate dependencies to standalone header checks --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd880e41a..9f2de497a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,7 +322,7 @@ if (REFLECTCPP_AVRO OR REFLECTCPP_CHECK_HEADERS) ) find_package(jansson CONFIG REQUIRED) if (REFLECTCPP_USE_VCPKG) - target_include_directories(reflectcpp SYSTEM PRIVATE "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") + target_include_directories(reflectcpp SYSTEM PUBLIC "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") if (WIN32) set(_AVRO_STATIC_LIB "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/avro${CMAKE_STATIC_LIBRARY_SUFFIX}") if(REFLECTCPP_BUILD_SHARED) @@ -515,7 +515,7 @@ if (REFLECTCPP_YAS OR REFLECTCPP_CHECK_HEADERS) src/reflectcpp_yas.cpp ) find_path(YAS_INCLUDE_DIRS "yas/abseil_types.hpp") - target_include_directories(reflectcpp PRIVATE ${YAS_INCLUDE_DIRS}) + target_include_directories(reflectcpp SYSTEM PUBLIC ${YAS_INCLUDE_DIRS}) endif () if (REFLECTCPP_CLI OR REFLECTCPP_CHECK_HEADERS) @@ -588,7 +588,9 @@ if(REFLECTCPP_CHECK_HEADERS) ) add_library(check_header_${HEADER_NAME} "${TEST_SOURCE_FILE}") - + # Compile each header with the same usage requirements as a consumer. + target_link_libraries(check_header_${HEADER_NAME} PRIVATE reflectcpp) + target_include_directories(check_header_${HEADER_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${ADDITIONAL_INCLUDE_DIRS} From f13600d61ad067ec790f22e1e46d214320e07f29 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Sun, 18 Oct 2026 15:42:07 +0800 Subject: [PATCH 14/18] Build documentation on forks without deploying Pages --- .github/workflows/mkdocs-gh-pages.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/mkdocs-gh-pages.yaml b/.github/workflows/mkdocs-gh-pages.yaml index 83db33335..bc5ff979e 100644 --- a/.github/workflows/mkdocs-gh-pages.yaml +++ b/.github/workflows/mkdocs-gh-pages.yaml @@ -27,17 +27,24 @@ jobs: version: 1.12.0 - name: Set git credentials + if: github.repository == 'getml/reflect-cpp' run: | git config --global user.name "${{ github.actor }}" git config --global user.email "${{ github.actor }}@users.noreply.github.com" - name: Fetch latest commit from gh-pages + if: github.repository == 'getml/reflect-cpp' run: | git fetch origin gh-pages --depth=1 - name: Deploy MkDocs documentation + if: github.repository == 'getml/reflect-cpp' run: hatch run default:mkdocs gh-deploy + - name: Build MkDocs documentation on forks + if: github.repository != 'getml/reflect-cpp' + run: hatch run default:mkdocs build + From cfbf624321c23d9340d0a255d994b4132e11077f Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Sun, 18 Oct 2026 16:10:32 +0800 Subject: [PATCH 15/18] Keep dependency build paths out of installed interfaces --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f2de497a..4e7c04cd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,7 +322,8 @@ if (REFLECTCPP_AVRO OR REFLECTCPP_CHECK_HEADERS) ) find_package(jansson CONFIG REQUIRED) if (REFLECTCPP_USE_VCPKG) - target_include_directories(reflectcpp SYSTEM PUBLIC "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include") + target_include_directories(reflectcpp SYSTEM PUBLIC + "$") if (WIN32) set(_AVRO_STATIC_LIB "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/avro${CMAKE_STATIC_LIBRARY_SUFFIX}") if(REFLECTCPP_BUILD_SHARED) @@ -515,7 +516,8 @@ if (REFLECTCPP_YAS OR REFLECTCPP_CHECK_HEADERS) src/reflectcpp_yas.cpp ) find_path(YAS_INCLUDE_DIRS "yas/abseil_types.hpp") - target_include_directories(reflectcpp SYSTEM PUBLIC ${YAS_INCLUDE_DIRS}) + target_include_directories(reflectcpp SYSTEM PUBLIC + "$") endif () if (REFLECTCPP_CLI OR REFLECTCPP_CHECK_HEADERS) From 6e16ed73b5972925cebf12256f6bc650d6423375 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Sun, 18 Oct 2026 16:52:10 +0800 Subject: [PATCH 16/18] Apply C-array brace-elision warning option to AppleClang --- tests/json_c_arrays_and_inheritance/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/json_c_arrays_and_inheritance/CMakeLists.txt b/tests/json_c_arrays_and_inheritance/CMakeLists.txt index 9513410ea..b1f2a957b 100644 --- a/tests/json_c_arrays_and_inheritance/CMakeLists.txt +++ b/tests/json_c_arrays_and_inheritance/CMakeLists.txt @@ -14,7 +14,7 @@ target_include_directories(reflect-cpp-json-c-arrays-and-inheritance-tests SYSTE target_link_libraries(reflect-cpp-json-c-arrays-and-inheritance-tests PRIVATE reflectcpp_tests_crt) # Reflection reconstructs nested C arrays using valid aggregate brace elision. target_compile_options(reflect-cpp-json-c-arrays-and-inheritance-tests PRIVATE - $<$:-Wno-missing-braces> + $<$:-Wno-missing-braces> ) add_custom_command(TARGET reflect-cpp-json-c-arrays-and-inheritance-tests POST_BUILD From 482d2febb4cda80eb96fc2ea41d63af9ccf608c2 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Sun, 18 Oct 2026 18:15:27 +0800 Subject: [PATCH 17/18] Use standard byte spans in binary format tests --- tests/cbor/test_read_byte_containers.cpp | 4 ++-- tests/ubjson/test_read_byte_containers.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/cbor/test_read_byte_containers.cpp b/tests/cbor/test_read_byte_containers.cpp index f66adcea8..7e0115a42 100644 --- a/tests/cbor/test_read_byte_containers.cpp +++ b/tests/cbor/test_read_byte_containers.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -36,8 +37,7 @@ TEST(cbor, test_read_from_byte_view) { std::transform(rfl_buffer.begin(), rfl_buffer.end(), my_buffer.begin(), [](char c) { return static_cast(c); }); - std::basic_string_view byte_view(my_buffer.data(), - rfl_buffer.size()); + std::span byte_view(my_buffer.data(), rfl_buffer.size()); auto result = rfl::cbor::read(byte_view); EXPECT_TRUE(result); diff --git a/tests/ubjson/test_read_byte_containers.cpp b/tests/ubjson/test_read_byte_containers.cpp index d2444b1fb..9afc8e4ad 100644 --- a/tests/ubjson/test_read_byte_containers.cpp +++ b/tests/ubjson/test_read_byte_containers.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -36,7 +37,7 @@ TEST(ubjson, test_read_from_byte_view) std::transform(rfl_buffer.begin(), rfl_buffer.end(), my_buffer.begin(), [](char c) { return static_cast(c); }); - std::basic_string_view byte_view(my_buffer.data(), rfl_buffer.size()); + std::span byte_view(my_buffer.data(), rfl_buffer.size()); auto result = rfl::ubjson::read(byte_view); EXPECT_TRUE(result); From 3699c2cec5588c8049e9ca1782b8b0291ebc9e25 Mon Sep 17 00:00:00 2001 From: Perdixky <3293789706@qq.com> Date: Mon, 19 Oct 2026 10:15:55 +0800 Subject: [PATCH 18/18] Require GCC 16 for modules and use native CTRE exports --- .github/workflows/linux.yaml | 10 +++++----- CMakeLists.txt | 4 ++-- modules/rfl.ctre.cppm | 12 ++++-------- scripts/ci/Containerfile | 2 +- scripts/ci/README.md | 37 +++++++++++++++++++++++++++++------- scripts/ci_matrix.py | 6 +++--- 6 files changed, 45 insertions(+), 26 deletions(-) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index bf09e8118..6542971df 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -38,12 +38,12 @@ jobs: compiler-version: 14 modules: "ON" # Keep the matrix below GitHub's 256-job limit: GCC 14 covers headers, - # while GCC 15 covers the minimum supported module compiler. + # while GCC 16 covers the minimum supported module compiler. - compiler: gcc - compiler-version: 15 + compiler-version: 16 modules: "OFF" - compiler: gcc - compiler-version: 16 + compiler-version: 15 - compiler: gcc compiler-version: 17 - compiler: gcc @@ -107,10 +107,10 @@ jobs: sudo apt update if [[ "${{ matrix.compiler-version }}" == 11 ]]; then sudo apt install -y ninja-build g++-11 - elif [[ "${{ matrix.compiler }}" == "gcc" && "${{ matrix.compiler-version }}" == 15 ]]; then + elif [[ "${{ matrix.compiler }}" == "gcc" && "${{ matrix.compiler-version }}" == 16 ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt update - sudo apt install -y ninja-build g++-15 + sudo apt install -y ninja-build g++-16 elif [[ "${{ matrix.compiler }}" == "llvm" && "${{ matrix.compiler-version }}" == 19 ]]; then sudo apt install -y ninja-build clang-19 clang-tools-19 else diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e7c04cd3..68c15d191 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,9 +189,9 @@ if(REFLECTCPP_BUILD_MODULES) if(NOT CMAKE_GENERATOR MATCHES "Ninja|Visual Studio") message(FATAL_ERROR "REFLECTCPP_BUILD_MODULES requires Ninja or Visual Studio") endif() - if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15) + if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16) OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19)) - message(FATAL_ERROR "REFLECTCPP_BUILD_MODULES requires GCC 15+ or Clang 19+; use headers with older compilers") + message(FATAL_ERROR "REFLECTCPP_BUILD_MODULES requires GCC 16+ or Clang 19+; use headers with older compilers") endif() else() # Keep ordinary header builds working with older compilers and generators. diff --git a/modules/rfl.ctre.cppm b/modules/rfl.ctre.cppm index 0196d25f9..5c0254fd2 100644 --- a/modules/rfl.ctre.cppm +++ b/modules/rfl.ctre.cppm @@ -4,19 +4,15 @@ module; export module rfl.ctre; -// GCC 15 loses CTRE's non-exported ADL overloads when instantiating an imported -// template. rfl imports this module privately, so these names stay out of rfl's API. -#if defined(__GNUC__) && __GNUC__ == 15 && !defined(__clang__) -export { -#endif +// Use CTRE's native module exports. rfl imports this dependency privately. +#define CTRE_IN_A_MODULE +#define CTLL_IN_A_MODULE +#define UNICODE_DB_IN_A_MODULE #if __has_include() #include #else #include "rfl/thirdparty/ctre.hpp" #endif -#if defined(__GNUC__) && __GNUC__ == 15 && !defined(__clang__) -} -#endif export namespace rfl::internal { template diff --git a/scripts/ci/Containerfile b/scripts/ci/Containerfile index ca1d27d29..c0e8ef473 100644 --- a/scripts/ci/Containerfile +++ b/scripts/ci/Containerfile @@ -6,7 +6,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ apt-get update && apt-get install -y --no-install-recommends \ ca-certificates curl git zip unzip tar pkg-config python3 python3-yaml \ python3-venv ninja-build build-essential \ - g++-11 g++-12 g++-13 g++-14 g++-15 \ + g++-11 g++-12 g++-13 g++-14 g++-15 g++-16 \ clang-16 clang-tools-16 clang-17 clang-tools-17 clang-18 clang-tools-18 \ clang-19 clang-tools-19 \ libgtest-dev libyaml-cpp-dev libtomlplusplus-dev libpugixml-dev \ diff --git a/scripts/ci/README.md b/scripts/ci/README.md index 147f2481d..f77b88cb1 100644 --- a/scripts/ci/README.md +++ b/scripts/ci/README.md @@ -21,17 +21,17 @@ podman build -f scripts/ci/Containerfile -t reflectcpp-ci . git submodule update --init --recursive ``` -The image provides GCC 11–15, Clang 16–19, their dependency scanners, Ninja, +The image provides GCC 11–16, Clang 16–19, their dependency scanners, Ninja, CMake 3.31.6, and several system dependencies. By default the runner uses the repository's pinned vcpkg submodule, like CI. The source tree and build cache -remain on the host. GCC 15 comes from the Ubuntu toolchain test PPA. +remain on the host. GCC 16 comes from the Ubuntu toolchain test PPA. First-time vcpkg dependency builds require network access. CI also pins CMake 3.31.6 for benchmarks: the pinned vcpkg benchmark port passes an unrecognized warning category that CMake 4.4 rejects during configuration. ```sh python3 scripts/ci_matrix.py --container reflectcpp-ci \ - --compiler gcc-15 --compiler llvm-19 --format JSON --cxx 20 --modules ON + --compiler gcc-16 --compiler llvm-19 --format JSON --cxx 20 --modules ON # Original header compatibility matrix, followed by module-capable jobs: python3 scripts/ci_matrix.py --container reflectcpp-ci @@ -76,10 +76,24 @@ guarantee that a compiler implements every module feature or can compile this library and its dependencies. In particular, `import std` has different requirements and is not used by these module interfaces. -This project's module builds require GCC 15 or Clang 19 or newer. GCC 14 -remains supported through headers: its CTRE module importer fails with -`Bad file data`. GCC 15 requires an ADL visibility workaround in the private -`rfl.ctre` dependency; CTRE is not re-exported by `rfl`. +This project's module builds require GCC 16 or Clang 19 or newer. GCC 15 and +older remain supported through headers. GCC 14's CTRE module importer fails with +`Bad file data`; GCC 15's native selective exports can reject valid regex matches +at runtime. The private `rfl.ctre` dependency uses CTRE's native `CTRE_IN_A_MODULE`, +`CTLL_IN_A_MODULE`, and `UNICODE_DB_IN_A_MODULE` export macros, with no GCC-specific +export branch. CTRE is not re-exported by `rfl`. + +The failure is in recursive `ctre::evaluate` overload lookup, not regex parsing: +an overload defined earlier calls `evaluate` with a dependent stack type, so +later overloads must be found by ADL. GCC 15.2 and 15.3 omit non-exported +module-linkage candidates from that instantiation context and select CTRE's +ellipsis fallback, which returns `not_matched`. A reduced module without CTRE +reproduces this at `-O0`; an earlier declaration or an explicit export restores +the intended overload. GCC 16 and Clang 19 pass the same reduced case. This +matches GCC [PR117658's ADL fix](https://gcc.gnu.org/pipermail/gcc-patches/2025-September/694072.html). +Exporting only the evaluator overloads in a temporary CTRE copy also fixes the +isolated matching tests. The supported GCC floor is now 16, so neither CTRE +patches nor the former full-header export workaround are needed. Clang 18 and older remain in the header-build compatibility matrix. Clang 18 module importers fail with PCH enabled, so that combination is no longer supported. Library and test @@ -87,6 +101,15 @@ PCH remain enabled by default; `-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON` can disab them explicitly. Module interface sources keep `SKIP_PRECOMPILE_HEADERS` because their global module fragments must precede declarations. +With native CTRE exports and PCH enabled, the Ubuntu toolchain PPA's GCC 16.0.1 +snapshot passed the C++20 JSON, CLI, CBOR, UBJSON, Cereal, CSV, Parquet and +Cap'n Proto module suites: 574 tests passed, one locale test was skipped, and +none failed. Focused GCC 16.2.1 importer checks also passed valid and invalid +custom regex and email cases in C++20 and C++23. + +The following debugging results include historical GCC 15 module configurations +using the former export workaround; those configurations are no longer supported. + With PCH enabled, GCC 15.2 (Ubuntu 24.04, C++20), GCC 15.3 (C++20 and C++23), and GCC 16.2.1 (C++20) passed the full JSON/CLI module suite: 342 tests passed and one locale test was skipped. diff --git a/scripts/ci_matrix.py b/scripts/ci_matrix.py index 9a9c45264..bb490bff5 100644 --- a/scripts/ci_matrix.py +++ b/scripts/ci_matrix.py @@ -33,7 +33,7 @@ def matrix_jobs(): def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('--list', action='store_true', help='print selected jobs without running them') - parser.add_argument('--compiler', action='append', help='filter, e.g. gcc-15 or llvm-19; repeatable') + parser.add_argument('--compiler', action='append', help='filter, e.g. gcc-16 or llvm-19; repeatable') parser.add_argument('--format', action='append', help='filter formats; repeatable') parser.add_argument('--cxx', type=int, choices=(20, 23), help='filter language standard') parser.add_argument('--modules', choices=('ON', 'OFF'), default='OFF') @@ -75,11 +75,11 @@ def main(): continue if args.cxx and job['cxx'] != args.cxx: continue - if args.modules == 'ON' and job['compiler-version'] < (15 if job['compiler'] == 'gcc' else 19): + if args.modules == 'ON' and job['compiler-version'] < (16 if job['compiler'] == 'gcc' else 19): continue selected.append((job, compiler)) if not selected: - parser.error('no matching jobs (module jobs require GCC 15+ or Clang 19+)') + parser.error('no matching jobs (module jobs require GCC 16+ or Clang 19+)') if args.list: for job, compiler in selected: print(f"{job['format']}-cxx{job['cxx']}-{compiler}-modules-{args.modules}")