mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-11-27 05:16:18 +08:00
Cleanup includes (#519)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
Checks: |
|
||||
-misc-unused-using-decls
|
||||
-misc-include-cleaner
|
||||
-modernize-use-using
|
||||
-readability-duplicate-include
|
||||
-readability-redundant-preprocessor
|
||||
HeaderFilterRegex: \./.+\\.(h|hpp)$
|
||||
WarningsAsErrors: false
|
||||
+22
-2
@@ -1,5 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.23)
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
option(REFLECTCPP_BUILD_SHARED "Build shared library" ${BUILD_SHARED_LIBS})
|
||||
option(REFLECTCPP_INSTALL "Install reflect cpp" OFF)
|
||||
|
||||
@@ -154,9 +156,27 @@ endif()
|
||||
add_library(reflectcpp::reflectcpp ALIAS reflectcpp)
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(reflectcpp PRIVATE $<$<CONFIG:Debug>:-Wall>)
|
||||
target_compile_options(reflectcpp PRIVATE
|
||||
$<$<CONFIG:Debug>:
|
||||
-Wall
|
||||
>
|
||||
$<$<CONFIG:Release>:
|
||||
-DNDEBUG
|
||||
>
|
||||
)
|
||||
else()
|
||||
target_compile_options(reflectcpp PRIVATE $<$<CONFIG:Debug>:-Wall -Wextra>)
|
||||
target_compile_options(reflectcpp PRIVATE
|
||||
$<$<CONFIG:Debug>:
|
||||
-Wall -Wextra -Wpedantic -Wshadow -Wconversion
|
||||
#-Wnull-dereference -Wold-style-cast
|
||||
#-g3 -fno-omit-frame-pointer
|
||||
#-fsanitize=address,undefined
|
||||
#-fno-sanitize-recover=undefined
|
||||
>
|
||||
$<$<CONFIG:Release>:
|
||||
-DNDEBUG
|
||||
>
|
||||
)
|
||||
endif()
|
||||
|
||||
if(REFLECTCPP_USE_STD_EXPECTED)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#include <benchmark/benchmark.h>
|
||||
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <rfl/avro.hpp>
|
||||
#include <rfl/bson.hpp>
|
||||
#include <rfl/capnproto.hpp>
|
||||
@@ -13,7 +10,6 @@
|
||||
#include <rfl/toml.hpp>
|
||||
#include <rfl/ubjson.hpp>
|
||||
#include <rfl/yaml.hpp>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
namespace canada_read {
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#include <benchmark/benchmark.h>
|
||||
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <rfl/avro.hpp>
|
||||
#include <rfl/bson.hpp>
|
||||
#include <rfl/capnproto.hpp>
|
||||
@@ -13,7 +10,6 @@
|
||||
#include <rfl/toml.hpp>
|
||||
#include <rfl/ubjson.hpp>
|
||||
#include <rfl/yaml.hpp>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
namespace canada_write {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include <benchmark/benchmark.h>
|
||||
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <rfl/avro.hpp>
|
||||
#include <rfl/bson.hpp>
|
||||
@@ -14,7 +12,6 @@
|
||||
#include <rfl/ubjson.hpp>
|
||||
#include <rfl/xml.hpp>
|
||||
#include <rfl/yaml.hpp>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
namespace licenses_read {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#include <benchmark/benchmark.h>
|
||||
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <rfl/avro.hpp>
|
||||
#include <rfl/bson.hpp>
|
||||
@@ -14,7 +12,6 @@
|
||||
#include <rfl/ubjson.hpp>
|
||||
#include <rfl/xml.hpp>
|
||||
#include <rfl/yaml.hpp>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
namespace licenses_write {
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#include <benchmark/benchmark.h>
|
||||
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <rfl/avro.hpp>
|
||||
#include <rfl/bson.hpp>
|
||||
#include <rfl/capnproto.hpp>
|
||||
@@ -14,7 +11,6 @@
|
||||
#include <rfl/ubjson.hpp>
|
||||
#include <rfl/xml.hpp>
|
||||
#include <rfl/yaml.hpp>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
namespace person_read {
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#include <benchmark/benchmark.h>
|
||||
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <rfl/avro.hpp>
|
||||
#include <rfl/bson.hpp>
|
||||
#include <rfl/capnproto.hpp>
|
||||
@@ -14,7 +11,6 @@
|
||||
#include <rfl/ubjson.hpp>
|
||||
#include <rfl/xml.hpp>
|
||||
#include <rfl/yaml.hpp>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
namespace person_write {
|
||||
|
||||
@@ -2,12 +2,9 @@
|
||||
#include <rapidjson/document.h>
|
||||
#include <simdjson.h>
|
||||
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <optional>
|
||||
#include <rfl/json.hpp>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
namespace canada {
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
#include <rapidjson/document.h>
|
||||
#include <simdjson.h>
|
||||
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <optional>
|
||||
#include <rfl/json.hpp>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
namespace licenses {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <optional>
|
||||
#include <rfl/json.hpp>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
+1
-2
@@ -2,7 +2,6 @@
|
||||
#define RFL_BOX_HPP_
|
||||
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
|
||||
#include "Result.hpp"
|
||||
|
||||
@@ -146,7 +145,7 @@ namespace std {
|
||||
template <class T>
|
||||
struct hash<rfl::Box<T>> {
|
||||
size_t operator()(const rfl::Box<T>& _b) const {
|
||||
return hash<unique_ptr<T>>()(_b.ptr());
|
||||
return std::hash<std::unique_ptr<T>>{}(_b.ptr());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#ifndef RFL_FIELD_HPP_
|
||||
#define RFL_FIELD_HPP_
|
||||
|
||||
#include <algorithm>
|
||||
#include <string_view>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
@@ -11,7 +9,6 @@
|
||||
#include "default.hpp"
|
||||
#include "internal/Array.hpp"
|
||||
#include "internal/StringLiteral.hpp"
|
||||
#include "internal/to_std_array.hpp"
|
||||
#include "internal/wrap_in_rfl_array_t.hpp"
|
||||
|
||||
namespace rfl {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
+1
-2
@@ -129,11 +129,10 @@ inline std::basic_ostream<CharT, Traits>& operator<<(
|
||||
} // namespace rfl
|
||||
|
||||
namespace std {
|
||||
|
||||
template <class T>
|
||||
struct hash<rfl::Ref<T>> {
|
||||
size_t operator()(const rfl::Ref<T>& _r) const {
|
||||
return hash<shared_ptr<T>>()(_r.ptr());
|
||||
return std::hash<std::shared_ptr<T>>{}(_r.ptr());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -5,12 +5,9 @@
|
||||
#include <expected>
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <new>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
#ifndef RFL_TUPLE_HPP_
|
||||
#define RFL_TUPLE_HPP_
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <bit>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#ifndef RFL_VALIDATOR_HPP_
|
||||
#define RFL_VALIDATOR_HPP_
|
||||
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
@@ -110,17 +111,7 @@ struct Validator {
|
||||
template <class T, class V, class... Vs>
|
||||
inline auto operator<=>(const Validator<T, V, Vs...>& _v1,
|
||||
const Validator<T, V, Vs...>& _v2) {
|
||||
#if __cpp_lib_three_way_comparison >= 201907L
|
||||
return _v1.value() <=> _v2.value();
|
||||
#else
|
||||
if (_v1.value() < _v2.value()) {
|
||||
return std::strong_ordering::less;
|
||||
} else if (_v1.value() > _v2.value()) {
|
||||
return std::strong_ordering::greater;
|
||||
} else {
|
||||
return std::strong_ordering::equal;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class T, class V, class... Vs>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "../Generic.hpp"
|
||||
#include "../Tuple.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../parsing/Parser.hpp"
|
||||
//#include "../parsing/Parser.hpp"
|
||||
#include "Reader.hpp"
|
||||
#include "Writer.hpp"
|
||||
|
||||
@@ -82,15 +82,15 @@ struct Parser<avro::Reader, avro::Writer,
|
||||
}
|
||||
|
||||
template <class P>
|
||||
static void write(const W& _w,
|
||||
static void write(const W& /*_w*/,
|
||||
const internal::Skip<T, _skip_serialization,
|
||||
_skip_deserialization>& _skip,
|
||||
const P& _parent) noexcept {
|
||||
_skip_deserialization>& /*_skip*/,
|
||||
const P& /*_parent*/) noexcept {
|
||||
static_assert(always_false_v<P>, "rfl::Skip is unsupported in Avro.");
|
||||
}
|
||||
|
||||
template <class U>
|
||||
static schema::Type to_schema(U* _definitions) {
|
||||
static schema::Type to_schema(U* /*_definitions*/) {
|
||||
static_assert(always_false_v<U>, "rfl::Skip is unsupported in Avro.");
|
||||
return schema::Type{};
|
||||
}
|
||||
|
||||
+36
-10
@@ -8,7 +8,6 @@
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "../Bytestring.hpp"
|
||||
#include "../Result.hpp"
|
||||
@@ -91,9 +90,12 @@ struct Reader {
|
||||
if (type != AVRO_BOOLEAN) {
|
||||
return rfl::error("Could not cast to boolean.");
|
||||
}
|
||||
int result = 0;
|
||||
avro_value_get_boolean(_var.val_, &result);
|
||||
return (result != 0);
|
||||
int result_value = 0;
|
||||
int result = avro_value_get_boolean(_var.val_, &result_value);
|
||||
if (result != 0) {
|
||||
return error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}
|
||||
return (result_value != 0);
|
||||
|
||||
} else if constexpr (std::is_floating_point<std::remove_cvref_t<T>>()) {
|
||||
if (type == AVRO_DOUBLE) {
|
||||
@@ -188,10 +190,18 @@ struct Reader {
|
||||
std::optional<Error> read_array(const ArrayReader& _array_reader,
|
||||
const InputArrayType& _arr) const noexcept {
|
||||
size_t size = 0;
|
||||
avro_value_get_size(_arr.val_, &size);
|
||||
int res = avro_value_get_size(_arr.val_, &size);
|
||||
if(res)
|
||||
{
|
||||
return Error(std::string(__FUNCTION__) + " error(" + std::to_string(res) + "): " + avro_strerror());
|
||||
}
|
||||
for (size_t ix = 0; ix < size; ++ix) {
|
||||
avro_value_t element;
|
||||
avro_value_get_by_index(_arr.val_, ix, &element, nullptr);
|
||||
res = avro_value_get_by_index(_arr.val_, ix, &element, nullptr);
|
||||
if(res)
|
||||
{
|
||||
return Error(std::string(__FUNCTION__) + " error(" + std::to_string(res) + "): " + avro_strerror());
|
||||
}
|
||||
const auto err = _array_reader.read(InputVarType{&element});
|
||||
if (err) {
|
||||
return err;
|
||||
@@ -204,11 +214,19 @@ struct Reader {
|
||||
std::optional<Error> read_map(const MapReader& _map_reader,
|
||||
const InputMapType& _map) const noexcept {
|
||||
size_t size = 0;
|
||||
avro_value_get_size(_map.val_, &size);
|
||||
int res = avro_value_get_size(_map.val_, &size);
|
||||
if(res!=0)
|
||||
{
|
||||
return Error(std::string(__FUNCTION__) + " error("+ std::to_string(res)+"): " + avro_strerror());
|
||||
}
|
||||
for (size_t ix = 0; ix < size; ++ix) {
|
||||
avro_value_t element;
|
||||
const char* key = nullptr;
|
||||
avro_value_get_by_index(_map.val_, ix, &element, &key);
|
||||
res = avro_value_get_by_index(_map.val_, ix, &element, &key);
|
||||
if(res!=0)
|
||||
{
|
||||
return Error(std::string(__FUNCTION__) + " error("+ std::to_string(res)+"): " + avro_strerror());
|
||||
}
|
||||
_map_reader.read(std::string_view(key), InputVarType{&element});
|
||||
}
|
||||
return std::nullopt;
|
||||
@@ -218,10 +236,18 @@ struct Reader {
|
||||
std::optional<Error> read_object(const ObjectReader& _object_reader,
|
||||
const InputObjectType& _obj) const noexcept {
|
||||
size_t size = 0;
|
||||
avro_value_get_size(_obj.val_, &size);
|
||||
int res = avro_value_get_size(_obj.val_, &size);
|
||||
if(res!=0)
|
||||
{
|
||||
return Error(std::string(__FUNCTION__) + " error("+ std::to_string(res)+"): " + avro_strerror());
|
||||
}
|
||||
for (size_t ix = 0; ix < size; ++ix) {
|
||||
avro_value_t element;
|
||||
avro_value_get_by_index(_obj.val_, ix, &element, nullptr);
|
||||
res = avro_value_get_by_index(_obj.val_, ix, &element, nullptr);
|
||||
if(res!=0)
|
||||
{
|
||||
return Error(std::string(__FUNCTION__) + " error("+ std::to_string(res)+"): " + avro_strerror());
|
||||
}
|
||||
_object_reader.read(static_cast<int>(ix), InputVarType{&element});
|
||||
}
|
||||
return std::nullopt;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "../Box.hpp"
|
||||
#include "../Result.hpp"
|
||||
//#include "../Box.hpp"
|
||||
//#include "../Result.hpp"
|
||||
|
||||
namespace rfl::avro {
|
||||
|
||||
|
||||
+91
-56
@@ -1,24 +1,17 @@
|
||||
#ifndef RFL_AVRO_WRITER_HPP_
|
||||
#define RFL_AVRO_WRITER_HPP_
|
||||
|
||||
#include <avro.h>
|
||||
|
||||
#include <bit>
|
||||
#include <cstdint>
|
||||
#include <exception>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "../Box.hpp"
|
||||
#include <avro.h>
|
||||
|
||||
//#include "../Box.hpp"
|
||||
#include "../Bytestring.hpp"
|
||||
#include "../Ref.hpp"
|
||||
#include "../Result.hpp"
|
||||
//#include "../Ref.hpp"
|
||||
//#include "../Result.hpp"
|
||||
#include "../Vectorstring.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../internal/is_literal.hpp"
|
||||
@@ -63,94 +56,100 @@ class Writer {
|
||||
|
||||
OutputObjectType object_as_root(const size_t _size) const noexcept;
|
||||
|
||||
OutputVarType null_as_root() const noexcept;
|
||||
OutputVarType null_as_root() const;
|
||||
|
||||
OutputUnionType union_as_root() const noexcept;
|
||||
|
||||
template <class T>
|
||||
OutputVarType value_as_root(const T& _var) const noexcept {
|
||||
OutputVarType value_as_root(const T& _var) const {
|
||||
set_value(_var, root_);
|
||||
return OutputVarType{*root_};
|
||||
}
|
||||
|
||||
OutputArrayType add_array_to_array(const size_t _size,
|
||||
OutputArrayType* _parent) const noexcept;
|
||||
OutputArrayType* _parent) const;
|
||||
|
||||
OutputArrayType add_array_to_map(const std::string_view& _name,
|
||||
const size_t _size,
|
||||
OutputMapType* _parent) const noexcept;
|
||||
OutputMapType* _parent) const;
|
||||
|
||||
OutputArrayType add_array_to_object(const std::string_view& _name,
|
||||
const size_t _size,
|
||||
OutputObjectType* _parent) const noexcept;
|
||||
OutputObjectType* _parent) const;
|
||||
|
||||
OutputArrayType add_array_to_union(const size_t _index, const size_t _size,
|
||||
OutputUnionType* _parent) const noexcept;
|
||||
OutputUnionType* _parent) const;
|
||||
|
||||
OutputMapType add_map_to_array(const size_t _size,
|
||||
OutputArrayType* _parent) const noexcept;
|
||||
OutputArrayType* _parent) const;
|
||||
|
||||
OutputMapType add_map_to_map(const std::string_view& _name,
|
||||
const size_t _size,
|
||||
OutputMapType* _parent) const noexcept;
|
||||
OutputMapType* _parent) const;
|
||||
|
||||
OutputMapType add_map_to_object(const std::string_view& _name,
|
||||
const size_t _size,
|
||||
OutputObjectType* _parent) const noexcept;
|
||||
OutputObjectType* _parent) const;
|
||||
|
||||
OutputMapType add_map_to_union(const size_t _index, const size_t _size,
|
||||
OutputUnionType* _parent) const noexcept;
|
||||
OutputUnionType* _parent) const;
|
||||
|
||||
OutputObjectType add_object_to_array(const size_t _size,
|
||||
OutputArrayType* _parent) const noexcept;
|
||||
OutputArrayType* _parent) const;
|
||||
|
||||
OutputObjectType add_object_to_map(const std::string_view& _name,
|
||||
const size_t _size,
|
||||
OutputMapType* _parent) const noexcept;
|
||||
OutputMapType* _parent) const;
|
||||
|
||||
OutputObjectType add_object_to_object(
|
||||
const std::string_view& _name, const size_t _size,
|
||||
OutputObjectType* _parent) const noexcept;
|
||||
OutputObjectType* _parent) const;
|
||||
|
||||
OutputObjectType add_object_to_union(const size_t _index, const size_t _size,
|
||||
OutputUnionType* _parent) const noexcept;
|
||||
OutputUnionType* _parent) const;
|
||||
|
||||
OutputUnionType add_union_to_array(OutputArrayType* _parent) const noexcept;
|
||||
OutputUnionType add_union_to_array(OutputArrayType* _parent) const;
|
||||
|
||||
OutputUnionType add_union_to_map(const std::string_view& _name,
|
||||
OutputMapType* _parent) const noexcept;
|
||||
OutputMapType* _parent) const;
|
||||
|
||||
OutputUnionType add_union_to_object(const std::string_view& _name,
|
||||
OutputObjectType* _parent) const noexcept;
|
||||
OutputObjectType* _parent) const;
|
||||
|
||||
OutputUnionType add_union_to_union(const size_t _index,
|
||||
OutputUnionType* _parent) const noexcept;
|
||||
OutputUnionType* _parent) const;
|
||||
|
||||
OutputVarType add_null_to_array(OutputArrayType* _parent) const noexcept;
|
||||
OutputVarType add_null_to_array(OutputArrayType* _parent) const;
|
||||
|
||||
OutputVarType add_null_to_map(const std::string_view& _name,
|
||||
OutputMapType* _parent) const noexcept;
|
||||
OutputMapType* _parent) const;
|
||||
|
||||
OutputVarType add_null_to_object(const std::string_view& _name,
|
||||
OutputObjectType* _parent) const noexcept;
|
||||
OutputObjectType* _parent) const;
|
||||
|
||||
OutputVarType add_null_to_union(const size_t _index,
|
||||
OutputUnionType* _parent) const noexcept;
|
||||
OutputUnionType* _parent) const;
|
||||
|
||||
template <class T>
|
||||
OutputVarType add_value_to_array(const T& _var,
|
||||
OutputArrayType* _parent) const noexcept {
|
||||
OutputArrayType* _parent) const {
|
||||
avro_value_t new_value;
|
||||
avro_value_append(&_parent->val_, &new_value, nullptr);
|
||||
int result = avro_value_append(&_parent->val_, &new_value, nullptr);
|
||||
if (result != 0) {
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}
|
||||
set_value(_var, &new_value);
|
||||
return OutputVarType{new_value};
|
||||
}
|
||||
|
||||
template <class T>
|
||||
OutputVarType add_value_to_map(const std::string_view& _name, const T& _var,
|
||||
OutputMapType* _parent) const noexcept {
|
||||
OutputMapType* _parent) const {
|
||||
avro_value_t new_value;
|
||||
avro_value_add(&_parent->val_, _name.data(), &new_value, nullptr, nullptr);
|
||||
int result = avro_value_add(&_parent->val_, _name.data(), &new_value, nullptr, nullptr);
|
||||
if (result != 0) {
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}
|
||||
set_value(_var, &new_value);
|
||||
return OutputVarType{new_value};
|
||||
}
|
||||
@@ -158,53 +157,89 @@ class Writer {
|
||||
template <class T>
|
||||
OutputVarType add_value_to_object(const std::string_view& _name,
|
||||
const T& _var,
|
||||
OutputObjectType* _parent) const noexcept {
|
||||
OutputObjectType* _parent) const {
|
||||
avro_value_t new_value;
|
||||
avro_value_get_by_name(&_parent->val_, _name.data(), &new_value, nullptr);
|
||||
int result = avro_value_get_by_name(&_parent->val_, _name.data(), &new_value, nullptr);
|
||||
if (result != 0) {
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}
|
||||
set_value(_var, &new_value);
|
||||
return OutputVarType{new_value};
|
||||
}
|
||||
|
||||
template <class T>
|
||||
OutputVarType add_value_to_union(const size_t _index, const T& _var,
|
||||
OutputUnionType* _parent) const noexcept {
|
||||
OutputUnionType* _parent) const {
|
||||
if (_index > static_cast<size_t>(INT_MAX)) {
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " index error");
|
||||
}
|
||||
avro_value_t new_value;
|
||||
avro_value_set_branch(&_parent->val_, static_cast<int>(_index), &new_value);
|
||||
int result = avro_value_set_branch(&_parent->val_, static_cast<int>(_index), &new_value);
|
||||
if (result != 0) {
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}
|
||||
set_value(_var, &new_value);
|
||||
return OutputVarType{new_value};
|
||||
}
|
||||
|
||||
void end_array(OutputArrayType* _arr) const noexcept {}
|
||||
void end_array(OutputArrayType* /*_arr*/) const noexcept {}
|
||||
|
||||
void end_map(OutputMapType* _obj) const noexcept {}
|
||||
void end_map(OutputMapType* /*_obj*/) const noexcept {}
|
||||
|
||||
void end_object(OutputObjectType* _obj) const noexcept {}
|
||||
void end_object(OutputObjectType* /*_obj*/) const noexcept {}
|
||||
|
||||
private:
|
||||
template <class T>
|
||||
void set_value(const T& _var, avro_value_t* _val) const noexcept {
|
||||
void set_value(const T& _var, avro_value_t* _val) const {
|
||||
if constexpr (std::is_same<std::remove_cvref_t<T>, std::string>()) {
|
||||
avro_value_set_string_len(_val, _var.c_str(), _var.size() + 1);
|
||||
|
||||
int result = avro_value_set_string_len(_val, _var.c_str(), _var.size() + 1);
|
||||
if (result != 0) {
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}
|
||||
} else if constexpr (std::is_same<std::remove_cvref_t<T>,
|
||||
rfl::Bytestring>() ||
|
||||
std::is_same<std::remove_cvref_t<T>,
|
||||
rfl::Vectorstring>()) {
|
||||
auto var = _var;
|
||||
avro_value_set_bytes(_val, var.data(), var.size());
|
||||
|
||||
if (!var.data()) {
|
||||
return;
|
||||
}
|
||||
int result = avro_value_set_bytes(_val, var.data(), var.size());
|
||||
if (result != 0) {
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}
|
||||
} else if constexpr (std::is_same<std::remove_cvref_t<T>, bool>()) {
|
||||
avro_value_set_boolean(_val, _var);
|
||||
|
||||
int result = avro_value_set_boolean(_val, _var);
|
||||
if (result != 0) {
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}
|
||||
} else if constexpr (std::is_floating_point<std::remove_cvref_t<T>>()) {
|
||||
/*int result = avro_value_set_double(_val, static_cast<double>(_var));
|
||||
if (result != 0) {
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}*/
|
||||
avro_value_set_double(_val, static_cast<double>(_var));
|
||||
|
||||
} else if constexpr (std::is_integral<std::remove_cvref_t<T>>()) {
|
||||
/*int result = avro_value_set_long(_val, static_cast<std::int64_t>(_var));
|
||||
if (result != 0) {
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}*/
|
||||
avro_value_set_long(_val, static_cast<std::int64_t>(_var));
|
||||
|
||||
} else if constexpr (internal::is_literal_v<T>) {
|
||||
avro_value_set_enum(_val, static_cast<int>(_var.value()));
|
||||
|
||||
int result = avro_value_set_enum(_val, static_cast<int>(_var.value()));
|
||||
if (result != 0) {
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}
|
||||
} else if constexpr (internal::is_validator_v<T>) {
|
||||
using ValueType = std::remove_cvref_t<typename T::ReflectionType>;
|
||||
const auto val = _var.value();
|
||||
set_value<ValueType>(val, _val);
|
||||
} else if constexpr (std::is_same<std::remove_cvref_t<T>, rfl::Timestamp<"%Y-%m-%d">>()) {
|
||||
const auto str = _var.to_string();
|
||||
set_value<std::string>(str, _val);
|
||||
} else if constexpr (std::is_same<std::remove_cvref_t<T>, rfl::Email>()) {
|
||||
const auto& str = static_cast<const std::string&>(_var);
|
||||
set_value<std::string>(str, _val);
|
||||
} else {
|
||||
static_assert(rfl::always_false_v<T>, "Unsupported type.");
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef RFL_AVRO_LOAD_HPP_
|
||||
#define RFL_AVRO_LOAD_HPP_
|
||||
|
||||
#include "../Processors.hpp"
|
||||
//#include "../Processors.hpp"
|
||||
#include "../Result.hpp"
|
||||
#include "../io/load_bytes.hpp"
|
||||
#include "read.hpp"
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include <avro.h>
|
||||
|
||||
#include <bit>
|
||||
#include <istream>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
@@ -37,9 +36,14 @@ Result<internal::wrap_in_rfl_array_t<T>> read(
|
||||
avro_reader_t avro_reader =
|
||||
avro_reader_memory(internal::ptr_cast<const char*>(_bytes), _size);
|
||||
avro_value_t root;
|
||||
avro_generic_value_new(_schema.iface(), &root);
|
||||
auto err = avro_value_read(avro_reader, &root);
|
||||
if (err) {
|
||||
int res = avro_generic_value_new(_schema.iface(), &root);
|
||||
if (res != 0) {
|
||||
avro_value_decref(&root);
|
||||
avro_reader_free(avro_reader);
|
||||
return error(std::string("Could not read root value: ") + avro_strerror());
|
||||
}
|
||||
res = avro_value_read(avro_reader, &root);
|
||||
if (res) {
|
||||
avro_value_decref(&root);
|
||||
avro_reader_free(avro_reader);
|
||||
return error(std::string("Could not read root value: ") + avro_strerror());
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
#define RFL_AVRO_SCHEMA_TYPE_HPP_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "../../Literal.hpp"
|
||||
#include "../../Object.hpp"
|
||||
//#include "../../Object.hpp"
|
||||
#include "../../Ref.hpp"
|
||||
#include "../../Rename.hpp"
|
||||
#include "../../Variant.hpp"
|
||||
@@ -16,69 +15,69 @@ namespace rfl::avro::schema {
|
||||
|
||||
struct Type {
|
||||
struct Null {
|
||||
Literal<"null"> type;
|
||||
Literal<"null"> type{};
|
||||
};
|
||||
|
||||
struct Boolean {
|
||||
Literal<"boolean"> type;
|
||||
Literal<"boolean"> type{};
|
||||
};
|
||||
|
||||
struct Int {
|
||||
Literal<"int"> type;
|
||||
Literal<"int"> type{};
|
||||
};
|
||||
|
||||
struct Long {
|
||||
Literal<"long"> type;
|
||||
Literal<"long"> type{};
|
||||
};
|
||||
|
||||
struct Float {
|
||||
Literal<"float"> type;
|
||||
Literal<"float"> type{};
|
||||
};
|
||||
|
||||
struct Double {
|
||||
Literal<"float"> type;
|
||||
Literal<"float"> type{};
|
||||
};
|
||||
|
||||
struct Bytes {
|
||||
Literal<"bytes"> type;
|
||||
Literal<"bytes"> type{};
|
||||
};
|
||||
|
||||
struct String {
|
||||
Literal<"string"> type;
|
||||
Literal<"string"> type{};
|
||||
};
|
||||
|
||||
struct RecordField {
|
||||
std::string name;
|
||||
rfl::Ref<Type> type;
|
||||
std::string name{};
|
||||
rfl::Ref<Type> type{};
|
||||
};
|
||||
|
||||
struct Record {
|
||||
Literal<"record"> type;
|
||||
std::string name;
|
||||
std::vector<RecordField> fields;
|
||||
std::optional<std::string> doc;
|
||||
Literal<"record"> type{};
|
||||
std::string name{};
|
||||
std::vector<RecordField> fields{};
|
||||
std::optional<std::string> doc{};
|
||||
};
|
||||
|
||||
struct Enum {
|
||||
Literal<"enum"> type;
|
||||
std::string name;
|
||||
std::vector<std::string> symbols;
|
||||
Literal<"enum"> type{};
|
||||
std::string name{};
|
||||
std::vector<std::string> symbols{};
|
||||
};
|
||||
|
||||
struct Array {
|
||||
Literal<"array"> type;
|
||||
rfl::Ref<Type> items;
|
||||
Rename<"default", std::vector<std::string>> default_;
|
||||
Literal<"array"> type{};
|
||||
rfl::Ref<Type> items{};
|
||||
Rename<"default", std::vector<std::string>> default_{};
|
||||
};
|
||||
|
||||
struct Map {
|
||||
Literal<"map"> type;
|
||||
rfl::Ref<Type> values;
|
||||
Rename<"default", std::map<std::string, std::string>> default_;
|
||||
Literal<"map"> type{};
|
||||
rfl::Ref<Type> values{};
|
||||
Rename<"default", std::map<std::string, std::string>> default_{};
|
||||
};
|
||||
|
||||
struct Reference {
|
||||
std::string type;
|
||||
std::string type{};
|
||||
};
|
||||
|
||||
using ReflectionType =
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
#ifndef RFL_AVRO_TOSCHEMA_HPP_
|
||||
#define RFL_AVRO_TOSCHEMA_HPP_
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
#include "../Literal.hpp"
|
||||
//#include "../Literal.hpp"
|
||||
#include "../Processors.hpp"
|
||||
#include "../Variant.hpp"
|
||||
#include "../json.hpp"
|
||||
#include "../parsing/schema/Type.hpp"
|
||||
#include "../parsing/schema/ValidationType.hpp"
|
||||
//#include "../Variant.hpp"
|
||||
//#include "../json.hpp"
|
||||
//#include "../parsing/schema/Type.hpp"
|
||||
//#include "../parsing/schema/ValidationType.hpp"
|
||||
#include "../parsing/schema/make.hpp"
|
||||
#include "Reader.hpp"
|
||||
#include "Schema.hpp"
|
||||
#include "Writer.hpp"
|
||||
#include "schema/Type.hpp"
|
||||
//#include "schema/Type.hpp"
|
||||
|
||||
namespace rfl::avro {
|
||||
|
||||
|
||||
+15
-10
@@ -3,17 +3,12 @@
|
||||
|
||||
#include <avro.h>
|
||||
|
||||
#include <bit>
|
||||
#include <cstdint>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../parsing/Parent.hpp"
|
||||
#include "Parser.hpp"
|
||||
#include "Schema.hpp"
|
||||
//#include "Schema.hpp"
|
||||
#include "Writer.hpp"
|
||||
#include "to_schema.hpp"
|
||||
|
||||
@@ -21,22 +16,32 @@ namespace rfl::avro {
|
||||
|
||||
/// Returns AVRO bytes.
|
||||
template <class... Ps>
|
||||
std::vector<char> write(const auto& _obj, const auto& _schema) noexcept {
|
||||
std::vector<char> write(const auto& _obj, const auto& _schema) {
|
||||
using T = std::remove_cvref_t<decltype(_obj)>;
|
||||
using U = typename std::remove_cvref_t<decltype(_schema)>::Type;
|
||||
using ParentType = parsing::Parent<Writer>;
|
||||
static_assert(std::is_same<T, U>(),
|
||||
"The schema must be compatible with the type to write.");
|
||||
avro_value_t root;
|
||||
avro_generic_value_new(_schema.iface(), &root);
|
||||
int result = avro_generic_value_new(_schema.iface(), &root);
|
||||
if (result != 0) {
|
||||
avro_value_decref(&root);
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}
|
||||
const auto writer = Writer(&root);
|
||||
Parser<T, Processors<Ps...>>::write(writer, _obj,
|
||||
typename ParentType::Root{});
|
||||
size_t size = 0;
|
||||
avro_value_sizeof(&root, &size);
|
||||
result = avro_value_sizeof(&root, &size);
|
||||
if (result != 0) {
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}
|
||||
std::vector<char> buffer(size);
|
||||
avro_writer_t avro_writer = avro_writer_memory(buffer.data(), buffer.size());
|
||||
avro_value_write(avro_writer, &root);
|
||||
result = avro_value_write(avro_writer, &root);
|
||||
if (result != 0) {
|
||||
throw std::runtime_error(std::string(__FUNCTION__) + " error("+ std::to_string(result)+"): " + avro_strerror());
|
||||
}
|
||||
avro_value_decref(&root);
|
||||
avro_writer_free(avro_writer);
|
||||
return buffer;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <bson/bson.h>
|
||||
|
||||
#include "../parsing/Parser.hpp"
|
||||
//#include "../parsing/Parser.hpp"
|
||||
#include "Reader.hpp"
|
||||
#include "Writer.hpp"
|
||||
|
||||
|
||||
@@ -3,27 +3,18 @@
|
||||
|
||||
#include <bson/bson.h>
|
||||
|
||||
#include <array>
|
||||
#include <concepts>
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "../Box.hpp"
|
||||
#include "../Bytestring.hpp"
|
||||
//#include "../Box.hpp"
|
||||
//#include "../Bytestring.hpp"
|
||||
#include "../Result.hpp"
|
||||
#include "../Vectorstring.hpp"
|
||||
//#include "../Vectorstring.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../internal/ptr_cast.hpp"
|
||||
//#include "../internal/ptr_cast.hpp"
|
||||
|
||||
namespace rfl {
|
||||
namespace bson {
|
||||
|
||||
@@ -4,10 +4,6 @@
|
||||
#include <bson/bson.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
@@ -17,7 +13,7 @@
|
||||
#include "../Box.hpp"
|
||||
#include "../Bytestring.hpp"
|
||||
#include "../Ref.hpp"
|
||||
#include "../Result.hpp"
|
||||
//#include "../Result.hpp"
|
||||
#include "../Vectorstring.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../internal/ptr_cast.hpp"
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <bson/bson.h>
|
||||
|
||||
#include <istream>
|
||||
#include <string>
|
||||
|
||||
#include "../Processors.hpp"
|
||||
#include "../concepts.hpp"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RFL_BSON_SAVE_HPP_
|
||||
#define RFL_BSON_SAVE_HPP_
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "../Result.hpp"
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
#include <bson/bson.h>
|
||||
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "../Processors.hpp"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#ifndef RFL_CAPNPROTO_PARSER_HPP_
|
||||
#define RFL_CAPNPROTO_PARSER_HPP_
|
||||
|
||||
#include "../Generic.hpp"
|
||||
//#include "../Generic.hpp"
|
||||
#include "../Tuple.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../parsing/Parser.hpp"
|
||||
//#include "../parsing/Parser.hpp"
|
||||
#include "Reader.hpp"
|
||||
#include "Writer.hpp"
|
||||
|
||||
@@ -91,16 +91,16 @@ struct Parser<capnproto::Reader, capnproto::Writer,
|
||||
}
|
||||
|
||||
template <class P>
|
||||
static void write(const W& _w,
|
||||
static void write(const W& /*_w*/,
|
||||
const internal::Skip<T, _skip_serialization,
|
||||
_skip_deserialization>& _skip,
|
||||
const P& _parent) noexcept {
|
||||
_skip_deserialization>& /*_skip*/,
|
||||
const P& /*_parent*/) noexcept {
|
||||
static_assert(always_false_v<P>,
|
||||
"rfl::Skip is unsupported in Cap'n Proto.");
|
||||
}
|
||||
|
||||
template <class U>
|
||||
static schema::Type to_schema(U* _definitions) {
|
||||
static schema::Type to_schema(U* /*_definitions*/) {
|
||||
static_assert(always_false_v<U>,
|
||||
"rfl::Skip is unsupported in Cap'n Proto.");
|
||||
return schema::Type{};
|
||||
|
||||
@@ -3,12 +3,9 @@
|
||||
|
||||
#include <capnp/dynamic.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "../Bytestring.hpp"
|
||||
#include "../Result.hpp"
|
||||
|
||||
@@ -3,11 +3,10 @@
|
||||
|
||||
#include <capnp/schema-parser.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "../Box.hpp"
|
||||
#include "../Result.hpp"
|
||||
//#include "../Box.hpp"
|
||||
//#include "../Result.hpp"
|
||||
|
||||
namespace rfl::capnproto {
|
||||
|
||||
|
||||
@@ -4,26 +4,20 @@
|
||||
#include <capnp/dynamic.h>
|
||||
#include <kj/array.h>
|
||||
|
||||
#include <bit>
|
||||
#include <cstdint>
|
||||
#include <exception>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "../Box.hpp"
|
||||
//#include "../Box.hpp"
|
||||
#include "../Bytestring.hpp"
|
||||
#include "../Ref.hpp"
|
||||
#include "../Result.hpp"
|
||||
//#include "../Ref.hpp"
|
||||
//#include "../Result.hpp"
|
||||
#include "../Vectorstring.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../internal/is_literal.hpp"
|
||||
#include "../internal/ptr_cast.hpp"
|
||||
//#include "../internal/ptr_cast.hpp"
|
||||
|
||||
namespace rfl::capnproto {
|
||||
|
||||
@@ -62,14 +56,14 @@ class Writer {
|
||||
~Writer();
|
||||
|
||||
template <class T>
|
||||
OutputArrayType array_as_root(const T _size) const noexcept {
|
||||
OutputArrayType array_as_root(const T /*_size*/) const noexcept {
|
||||
static_assert(always_false_v<T>,
|
||||
"In Cap'n Proto, root values must always be structs.");
|
||||
throw std::runtime_error("Unsupported.");
|
||||
}
|
||||
|
||||
template <class T>
|
||||
OutputMapType map_as_root(const T _size) const noexcept {
|
||||
OutputMapType map_as_root(const T /*_size*/) const noexcept {
|
||||
static_assert(always_false_v<T>,
|
||||
"In Cap'n Proto, root values must always be structs.");
|
||||
throw std::runtime_error("Unsupported.");
|
||||
@@ -92,7 +86,7 @@ class Writer {
|
||||
}
|
||||
|
||||
template <class T>
|
||||
OutputVarType value_as_root(const T& _var) const noexcept {
|
||||
OutputVarType value_as_root(const T& /*_var*/) const noexcept {
|
||||
static_assert(always_false_v<T>,
|
||||
"In Cap'n Proto, root values must always be structs.");
|
||||
throw std::runtime_error("Unsupported.");
|
||||
@@ -261,11 +255,11 @@ class Writer {
|
||||
return OutputVarType{};
|
||||
}
|
||||
|
||||
void end_array(OutputArrayType* _arr) const noexcept {}
|
||||
void end_array(OutputArrayType* /*_arr*/) const noexcept {}
|
||||
|
||||
void end_map(OutputMapType* _obj) const noexcept {}
|
||||
void end_map(OutputMapType* /*_obj*/) const noexcept {}
|
||||
|
||||
void end_object(OutputObjectType* _obj) const noexcept {}
|
||||
void end_object(OutputObjectType* /*_obj*/) const noexcept {}
|
||||
|
||||
private:
|
||||
capnp::DynamicStruct::Builder* root_;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef RFL_CAPNPROTO_LOAD_HPP_
|
||||
#define RFL_CAPNPROTO_LOAD_HPP_
|
||||
|
||||
#include "../Processors.hpp"
|
||||
//#include "../Processors.hpp"
|
||||
#include "../Result.hpp"
|
||||
#include "../io/load_bytes.hpp"
|
||||
#include "read.hpp"
|
||||
|
||||
@@ -5,16 +5,14 @@
|
||||
#include <capnp/serialize-packed.h>
|
||||
#include <kj/io.h>
|
||||
|
||||
#include <bit>
|
||||
#include <istream>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
#include "../Processors.hpp"
|
||||
#include "../SnakeCaseToCamelCase.hpp"
|
||||
#include "../concepts.hpp"
|
||||
#include "../internal/ptr_cast.hpp"
|
||||
#include "../internal/strings/strings.hpp"
|
||||
//#include "../internal/ptr_cast.hpp"
|
||||
//#include "../internal/strings/strings.hpp"
|
||||
#include "../internal/wrap_in_rfl_array_t.hpp"
|
||||
#include "Parser.hpp"
|
||||
#include "Reader.hpp"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef RFL_CAPNPROTO_SAVE_HPP_
|
||||
#define RFL_CAPNPROTO_SAVE_HPP_
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -2,15 +2,12 @@
|
||||
#define RFL_CAPNPROTO_SCHEMA_TYPE_HPP_
|
||||
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "../../Literal.hpp"
|
||||
#include "../../Object.hpp"
|
||||
//#include "../../Literal.hpp"
|
||||
//#include "../../Object.hpp"
|
||||
#include "../../Ref.hpp"
|
||||
#include "../../Rename.hpp"
|
||||
//#include "../../Rename.hpp"
|
||||
#include "../../Variant.hpp"
|
||||
|
||||
namespace rfl::capnproto::schema {
|
||||
@@ -45,30 +42,30 @@ struct Type {
|
||||
struct Text {};
|
||||
|
||||
struct Enum {
|
||||
std::string name;
|
||||
std::vector<std::string> fields;
|
||||
std::string name{};
|
||||
std::vector<std::string> fields{};
|
||||
};
|
||||
|
||||
struct List {
|
||||
rfl::Ref<Type> type;
|
||||
rfl::Ref<Type> type{};
|
||||
};
|
||||
|
||||
struct Map {
|
||||
rfl::Ref<Type> type;
|
||||
rfl::Ref<Type> type{};
|
||||
};
|
||||
|
||||
struct Reference {
|
||||
std::string type_name;
|
||||
std::string type_name{};
|
||||
};
|
||||
|
||||
struct Struct {
|
||||
std::string name;
|
||||
std::vector<std::pair<std::string, Type>> fields;
|
||||
std::string name{};
|
||||
std::vector<std::pair<std::string, Type>> fields{};
|
||||
};
|
||||
|
||||
struct Union {
|
||||
std::string name;
|
||||
std::vector<std::pair<std::string, Type>> fields;
|
||||
std::string name{};
|
||||
std::vector<std::pair<std::string, Type>> fields{};
|
||||
};
|
||||
|
||||
using ReflectionType =
|
||||
|
||||
@@ -1,22 +1,21 @@
|
||||
#ifndef RFL_CAPNPROTO_TOSCHEMA_HPP_
|
||||
#define RFL_CAPNPROTO_TOSCHEMA_HPP_
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
|
||||
#include "../Literal.hpp"
|
||||
#include "../Processors.hpp"
|
||||
//#include "../Literal.hpp"
|
||||
//#include "../Processors.hpp"
|
||||
#include "../Result.hpp"
|
||||
#include "../SnakeCaseToCamelCase.hpp"
|
||||
#include "../Variant.hpp"
|
||||
#include "../json.hpp"
|
||||
#include "../parsing/schema/Type.hpp"
|
||||
#include "../parsing/schema/ValidationType.hpp"
|
||||
//#include "../SnakeCaseToCamelCase.hpp"
|
||||
//#include "../Variant.hpp"
|
||||
//#include "../json.hpp"
|
||||
//#include "../parsing/schema/Type.hpp"
|
||||
//#include "../parsing/schema/ValidationType.hpp"
|
||||
#include "../parsing/schema/make.hpp"
|
||||
#include "Schema.hpp"
|
||||
#include "Writer.hpp"
|
||||
#include "schema/Type.hpp"
|
||||
#include "Reader.hpp"
|
||||
//#include "schema/Type.hpp"
|
||||
|
||||
namespace rfl::capnproto {
|
||||
|
||||
|
||||
@@ -8,20 +8,15 @@
|
||||
#include <capnp/serialize-packed.h>
|
||||
#include <kj/io.h>
|
||||
|
||||
#include <bit>
|
||||
#include <cstdint>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../SnakeCaseToCamelCase.hpp"
|
||||
#include "../internal/ptr_cast.hpp"
|
||||
#include "../internal/strings/strings.hpp"
|
||||
//#include "../internal/strings/strings.hpp"
|
||||
#include "../parsing/Parent.hpp"
|
||||
#include "Parser.hpp"
|
||||
#include "Schema.hpp"
|
||||
//#include "Schema.hpp"
|
||||
#include "Writer.hpp"
|
||||
#include "get_root_name.hpp"
|
||||
#include "to_schema.hpp"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef RFL_CBOR_PARSER_HPP_
|
||||
#define RFL_CBOR_PARSER_HPP_
|
||||
|
||||
#include "../Tuple.hpp"
|
||||
#include "../parsing/Parser.hpp"
|
||||
//#include "../Tuple.hpp"
|
||||
//#include "../parsing/Parser.hpp"
|
||||
#include "Reader.hpp"
|
||||
#include "Writer.hpp"
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <exception>
|
||||
#include <jsoncons/json.hpp>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -1,22 +1,15 @@
|
||||
#ifndef RFL_CBOR_WRITER_HPP_
|
||||
#define RFL_CBOR_WRITER_HPP_
|
||||
|
||||
#include <bit>
|
||||
#include <exception>
|
||||
#include <jsoncons_ext/cbor/cbor_encoder.hpp>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <variant>
|
||||
#include <vector>
|
||||
|
||||
#include "../Box.hpp"
|
||||
//#include "../Box.hpp"
|
||||
#include "../Bytestring.hpp"
|
||||
#include "../Ref.hpp"
|
||||
#include "../Result.hpp"
|
||||
//#include "../Ref.hpp"
|
||||
//#include "../Result.hpp"
|
||||
#include "../Vectorstring.hpp"
|
||||
#include "../always_false.hpp"
|
||||
|
||||
@@ -67,14 +60,14 @@ class Writer {
|
||||
|
||||
template <class T>
|
||||
OutputVarType add_value_to_array(const T& _var,
|
||||
OutputArrayType* _parent) const noexcept {
|
||||
OutputArrayType* /*_parent*/) const noexcept {
|
||||
return new_value(_var);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
OutputVarType add_value_to_object(const std::string_view& _name,
|
||||
const T& _var,
|
||||
OutputObjectType* _parent) const noexcept {
|
||||
OutputObjectType* /*_parent*/) const noexcept {
|
||||
encoder_->key(_name);
|
||||
return new_value(_var);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef RFL_CBOR_LOAD_HPP_
|
||||
#define RFL_CBOR_LOAD_HPP_
|
||||
|
||||
#include "../Processors.hpp"
|
||||
//#include "../Processors.hpp"
|
||||
#include "../Result.hpp"
|
||||
#include "../io/load_bytes.hpp"
|
||||
#include "read.hpp"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef RFL_CBOR_READ_HPP_
|
||||
#define RFL_CBOR_READ_HPP_
|
||||
|
||||
#include <bit>
|
||||
#include <istream>
|
||||
#include <jsoncons/json.hpp>
|
||||
#include <jsoncons_ext/cbor/decode_cbor.hpp>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RFL_CBOR_SAVE_HPP_
|
||||
#define RFL_CBOR_SAVE_HPP_
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "../Result.hpp"
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
#include <cstdint>
|
||||
#include <jsoncons_ext/cbor/cbor_encoder.hpp>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "../internal/ptr_cast.hpp"
|
||||
#include "../parsing/Parent.hpp"
|
||||
|
||||
@@ -5,13 +5,12 @@
|
||||
#include <arrow/io/api.h>
|
||||
|
||||
#include <istream>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include "../Processors.hpp"
|
||||
//#include "../Processors.hpp"
|
||||
#include "../Result.hpp"
|
||||
#include "../concepts.hpp"
|
||||
//#include "../concepts.hpp"
|
||||
#include "../internal/wrap_in_rfl_array_t.hpp"
|
||||
#include "../parsing/tabular/ArrowReader.hpp"
|
||||
#include "Settings.hpp"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RFL_CSV_SAVE_HPP_
|
||||
#define RFL_CSV_SAVE_HPP_
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "../Result.hpp"
|
||||
|
||||
@@ -5,16 +5,13 @@
|
||||
#include <arrow/csv/writer.h>
|
||||
#include <arrow/io/api.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
#include "../Processors.hpp"
|
||||
#include "../Ref.hpp"
|
||||
//#include "../Processors.hpp"
|
||||
//#include "../Ref.hpp"
|
||||
#include "../parsing/tabular/ArrowWriter.hpp"
|
||||
#include "Settings.hpp"
|
||||
|
||||
|
||||
@@ -5,19 +5,15 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "../Bytestring.hpp"
|
||||
//#include "../Bytestring.hpp"
|
||||
#include "../Result.hpp"
|
||||
#include "../Vectorstring.hpp"
|
||||
//#include "../Vectorstring.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "../internal/ptr_cast.hpp"
|
||||
//#include "../internal/ptr_cast.hpp"
|
||||
|
||||
namespace rfl {
|
||||
namespace flexbuf {
|
||||
|
||||
@@ -4,20 +4,13 @@
|
||||
#include <flatbuffers/flexbuffers.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "../Bytestring.hpp"
|
||||
#include "../Ref.hpp"
|
||||
#include "../Result.hpp"
|
||||
//#include "../Ref.hpp"
|
||||
//#include "../Result.hpp"
|
||||
#include "../Vectorstring.hpp"
|
||||
#include "../always_false.hpp"
|
||||
|
||||
@@ -70,14 +63,14 @@ struct Writer {
|
||||
|
||||
template <class T>
|
||||
OutputVarType add_value_to_array(const T& _var,
|
||||
OutputArrayType* _parent) const noexcept {
|
||||
OutputArrayType* /*_parent*/) const noexcept {
|
||||
return insert_value(_var);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
OutputVarType add_value_to_object(const std::string_view& _name,
|
||||
const T& _var,
|
||||
OutputObjectType* _parent) const noexcept {
|
||||
OutputObjectType* /*_parent*/) const noexcept {
|
||||
return insert_value(_name, _var);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#include <vector>
|
||||
|
||||
#include "../Processors.hpp"
|
||||
#include "../Result.hpp"
|
||||
//#include "../Result.hpp"
|
||||
#include "../concepts.hpp"
|
||||
#include "../internal/ptr_cast.hpp"
|
||||
//#include "../internal/ptr_cast.hpp"
|
||||
#include "Parser.hpp"
|
||||
|
||||
namespace rfl {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RFL_FLEXBUF_SAVE_HPP_
|
||||
#define RFL_FLEXBUF_SAVE_HPP_
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include "../Result.hpp"
|
||||
|
||||
@@ -3,13 +3,11 @@
|
||||
|
||||
#include <flatbuffers/flexbuffers.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
#include "../Processors.hpp"
|
||||
#include "../Ref.hpp"
|
||||
//#include "../Ref.hpp"
|
||||
#include "../internal/ptr_cast.hpp"
|
||||
#include "../parsing/Parent.hpp"
|
||||
#include "Parser.hpp"
|
||||
|
||||
@@ -2,14 +2,9 @@
|
||||
#define GENERIC_READER_HPP_
|
||||
|
||||
#include <cstddef>
|
||||
#include <exception>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "../Generic.hpp"
|
||||
#include "../Result.hpp"
|
||||
@@ -97,7 +92,7 @@ struct Reader {
|
||||
|
||||
template <class T>
|
||||
rfl::Result<T> use_custom_constructor(
|
||||
const InputVarType _var) const noexcept {
|
||||
const InputVarType /*_var*/) const noexcept {
|
||||
return error("Not supported for generic types");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
#ifndef GENERIC_READ_HPP_
|
||||
#define GENERIC_READ_HPP_
|
||||
|
||||
#include <istream>
|
||||
#include <vector>
|
||||
|
||||
#include "../Generic.hpp"
|
||||
#include "../Processors.hpp"
|
||||
#include "../Result.hpp"
|
||||
#include "Parser.hpp"
|
||||
|
||||
namespace rfl {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_ARRAY_HPP_
|
||||
#define RFL_INTERNAL_ARRAY_HPP_
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
#include "to_std_array.hpp"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_FIELD_TUPLE_T_HPP_
|
||||
#define RFL_INTERNAL_FIELD_TUPLE_T_HPP_
|
||||
|
||||
#include <functional>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
|
||||
#include "copy_to_field_tuple.hpp"
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_GETTER_HPP_
|
||||
#define RFL_INTERNAL_GETTER_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <variant>
|
||||
|
||||
#include "../Tuple.hpp"
|
||||
#include "StringLiteral.hpp"
|
||||
#include "find_index.hpp"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_HASVALIDATION_HPP_
|
||||
#define RFL_INTERNAL_HASVALIDATION_HPP_
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include "../Result.hpp"
|
||||
|
||||
namespace rfl {
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_ALLFIELDS_HPP_
|
||||
#define RFL_INTERNAL_ALLFIELDS_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../Tuple.hpp"
|
||||
#include "is_field.hpp"
|
||||
|
||||
|
||||
@@ -3,13 +3,11 @@
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <iostream>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../Tuple.hpp"
|
||||
#include "../always_false.hpp"
|
||||
#include "is_named_tuple.hpp"
|
||||
//#include "is_named_tuple.hpp" //Not here
|
||||
#include "num_fields.hpp"
|
||||
|
||||
namespace rfl::internal {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_COPY_FLATTENED_TUPLE_TO_NAMED_TUPLE_HPP_
|
||||
#define RFL_INTERNAL_COPY_FLATTENED_TUPLE_TO_NAMED_TUPLE_HPP_
|
||||
|
||||
#include <functional>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
#ifndef RFL_INTERNAL_ENUMS_NAMES_HPP_
|
||||
#define RFL_INTERNAL_ENUMS_NAMES_HPP_
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../../Literal.hpp"
|
||||
#include "../../config.hpp"
|
||||
#include "../../define_literal.hpp"
|
||||
//#include "../../config.hpp"
|
||||
//#include "../../define_literal.hpp"
|
||||
#include "../../make_named_tuple.hpp"
|
||||
#include "../../thirdparty/enchantum/enchantum.hpp"
|
||||
//#include "../../thirdparty/enchantum/enchantum.hpp"
|
||||
#include "../StringLiteral.hpp"
|
||||
|
||||
namespace rfl::internal::enums {
|
||||
|
||||
@@ -28,12 +28,11 @@
|
||||
#define ENCHANTUM_MAX_RANGE RFL_ENUM_RANGE_MAX
|
||||
|
||||
#include <concepts>
|
||||
#include <limits>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../../thirdparty/enchantum/enchantum.hpp"// NOLINT(unused-includes)
|
||||
|
||||
#include "../../Literal.hpp"
|
||||
#include "../../thirdparty/enchantum/enchantum.hpp"
|
||||
#include "Names.hpp"
|
||||
#include "range_defined.hpp"
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_ENUMS_RANGE_DEFINED_HPP_
|
||||
#define RFL_INTERNAL_ENUMS_RANGE_DEFINED_HPP_
|
||||
|
||||
#include <concepts>
|
||||
|
||||
#include "../../config.hpp"
|
||||
|
||||
namespace rfl::internal::enums {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_FIELD_TUPLE_T_HPP_
|
||||
#define RFL_INTERNAL_FIELD_TUPLE_T_HPP_
|
||||
|
||||
#include <functional>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
|
||||
#include "copy_to_field_tuple.hpp"
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#ifndef RFL_INTERNAL_FIELD_TYPE_HPP_
|
||||
#define RFL_INTERNAL_FIELD_TYPE_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <variant>
|
||||
|
||||
#include "../NamedTuple.hpp"
|
||||
//#include "../NamedTuple.hpp"
|
||||
#include "../TaggedUnion.hpp"
|
||||
#include "../Tuple.hpp"
|
||||
#include "../named_tuple_t.hpp"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RFL_FIND_INDEX_HPP_
|
||||
#define RFL_FIND_INDEX_HPP_
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include "StringLiteral.hpp"
|
||||
|
||||
namespace rfl {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_FLATTENED_PTR_TUPLE_T_HPP_
|
||||
#define RFL_INTERNAL_FLATTENED_PTR_TUPLE_T_HPP_
|
||||
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
|
||||
#include "to_flattened_ptr_tuple.hpp"
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
#ifndef RFL_INTERNAL_FLATTENED_TUPLE_T_HPP_
|
||||
#define RFL_INTERNAL_FLATTENED_TUPLE_T_HPP_
|
||||
|
||||
#include <functional>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
|
||||
#include "flattened_ptr_tuple_t.hpp"
|
||||
#include "remove_ptrs_tup.hpp"
|
||||
#include "../to_named_tuple.hpp"
|
||||
//#include "../to_named_tuple.hpp"
|
||||
|
||||
namespace rfl {
|
||||
namespace internal {
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
#define RFL_INTERNAL_GET_ITH_FIELD_FROM_FAKE_OBJECT_HPP_
|
||||
|
||||
#include <cstddef>
|
||||
#include <iostream>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../always_false.hpp"
|
||||
#include "get_fake_object.hpp"
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define RFL_INTERNAL_GETMETAFIELDS_HPP_
|
||||
|
||||
#include <array>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
#include "../MetaField.hpp"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include "../parsing/Parser.hpp"
|
||||
//#include "../parsing/Parser.hpp"
|
||||
|
||||
namespace rfl::internal {
|
||||
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
#ifndef RFL_INTERNAL_HASFIELDS_HPP_
|
||||
#define RFL_INTERNAL_HASFIELDS_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../Tuple.hpp"
|
||||
#include "all_fields.hpp"
|
||||
//#include "all_fields.hpp"
|
||||
#include "is_field.hpp"
|
||||
#include "is_flatten_field.hpp"
|
||||
#include "ptr_tuple_t.hpp"
|
||||
#include "is_named_tuple.hpp"
|
||||
|
||||
|
||||
namespace rfl {
|
||||
namespace internal {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_HASFLATTENFIELDS_HPP_
|
||||
#define RFL_INTERNAL_HASFLATTENFIELDS_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_HASREFLECTOR_HPP_
|
||||
#define RFL_INTERNAL_HASREFLECTOR_HPP_
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace rfl {
|
||||
template <typename T>
|
||||
struct Reflector;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define RFL_HASTAGV_HPP_
|
||||
|
||||
#include <cstdint>
|
||||
#include <utility>
|
||||
|
||||
namespace rfl {
|
||||
namespace internal {
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#ifndef RFL_INTERNAL_ISADDTAGSTOVARIANTS_HPP_
|
||||
#define RFL_INTERNAL_ISADDTAGSTOVARIANTS_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../AddTagsToVariants.hpp"
|
||||
//#include "../AddTagsToVariants.hpp"
|
||||
|
||||
namespace rfl ::internal {
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#ifndef RFL_INTERNAL_ISALLOWRAWPTRS_HPP_
|
||||
#define RFL_INTERNAL_ISALLOWRAWPTRS_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../AllowRawPtrs.hpp"
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#ifndef RFL_INTERNAL_ISARRAY_HPP_
|
||||
#define RFL_INTERNAL_ISARRAY_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "Array.hpp"
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
#ifndef RFL_INTERNAL_ISATTRIBUTE_HPP_
|
||||
#define RFL_INTERNAL_ISATTRIBUTE_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../Attribute.hpp"
|
||||
#include "../Field.hpp"
|
||||
//#include "../Field.hpp"
|
||||
#include "remove_rename.hpp"
|
||||
|
||||
namespace rfl {
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#ifndef RFL_INTERNAL_ISDEFAULTIFMISSING_HPP_
|
||||
#define RFL_INTERNAL_ISDEFAULTIFMISSING_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../DefaultIfMissing.hpp"
|
||||
//#include "../DefaultIfMissing.hpp"
|
||||
|
||||
namespace rfl {
|
||||
namespace internal {
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#ifndef RFL_INTERNAL_ISDESCRIPTION_HPP_
|
||||
#define RFL_INTERNAL_ISDESCRIPTION_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../Description.hpp"
|
||||
#include "StringLiteral.hpp"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_ISEMPTY_HPP_
|
||||
#define RFL_INTERNAL_ISEMPTY_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
|
||||
#include "../Tuple.hpp"
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#ifndef RFL_INTERNAL_ISFIELD_HPP_
|
||||
#define RFL_INTERNAL_ISFIELD_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../Field.hpp"
|
||||
#include "StringLiteral.hpp"
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#ifndef RFL_INTERNAL_ISFLATTENFIELD_HPP_
|
||||
#define RFL_INTERNAL_ISFLATTENFIELD_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../Flatten.hpp"
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#ifndef RFL_INTERNAL_ISNOEXTRAFIELDS_HPP_
|
||||
#define RFL_INTERNAL_ISNOEXTRAFIELDS_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../NoExtraFields.hpp"
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#ifndef RFL_INTERNAL_ISNOFIELDNAMES_HPP_
|
||||
#define RFL_INTERNAL_ISNOFIELDNAMES_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../NoFieldNames.hpp"
|
||||
//#include "../NoFieldNames.hpp"
|
||||
|
||||
namespace rfl {
|
||||
namespace internal {
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#ifndef RFL_INTERNAL_ISNOOPTIONALS_HPP_
|
||||
#define RFL_INTERNAL_ISNOOPTIONALS_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../NoOptionals.hpp"
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#ifndef RFL_INTERNAL_ISRENAME_HPP_
|
||||
#define RFL_INTERNAL_ISRENAME_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../Rename.hpp"
|
||||
#include "StringLiteral.hpp"
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#ifndef RFL_INTERNAL_ISUNDERLYINGENUMS_HPP_
|
||||
#define RFL_INTERNAL_ISUNDERLYINGENUMS_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
#include "../UnderlyingEnums.hpp"
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_MOVE_AND_FLATTEN_FIELD_TUPLE_HPP_
|
||||
#define RFL_INTERNAL_MOVE_AND_FLATTEN_FIELD_TUPLE_HPP_
|
||||
|
||||
#include <tuple>
|
||||
|
||||
#include "../Tuple.hpp"
|
||||
#include "../tuple_cat.hpp"
|
||||
#include "is_flatten_field.hpp"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef RFL_INTERNAL_MOVE_FIELD_TUPLE_TO_NAMED_TUPLE_HPP_
|
||||
#define RFL_INTERNAL_MOVE_FIELD_TUPLE_TO_NAMED_TUPLE_HPP_
|
||||
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
|
||||
#include "../Field.hpp"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef RFL_MOVE_FROM_NAMED_TUPLE_HPP_
|
||||
#define RFL_MOVE_FROM_NAMED_TUPLE_HPP_
|
||||
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
|
||||
#include "../Tuple.hpp"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef RFL_MOVE_FROM_TUPLE_HPP_
|
||||
#define RFL_MOVE_FROM_TUPLE_HPP_
|
||||
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
|
||||
#include "../Tuple.hpp"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user