Skip to content

Commit cb14177

Browse files
Fixed no_field_names
1 parent baa8f01 commit cb14177

7 files changed

Lines changed: 18 additions & 10 deletions

File tree

include/rfl/toml/read.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <toml++/toml.hpp>
88

99
#include "../Processors.hpp"
10+
#include "../internal/no_field_names_v.hpp"
1011
#include "../internal/wrap_in_rfl_array_t.hpp"
1112
#include "Parser.hpp"
1213
#include "Reader.hpp"
@@ -20,7 +21,7 @@ template <class T, class... Ps>
2021
auto read(InputVarType _var) {
2122
const auto r = Reader();
2223
using ProcessorsType = Processors<Ps...>;
23-
static_assert(!ProcessorsType::no_field_names_,
24+
static_assert(!internal::no_field_names_v<ProcessorsType>,
2425
"The NoFieldNames processor is not supported for BSON, XML, "
2526
"TOML, or YAML.");
2627
return Parser<T, ProcessorsType>::read(r, _var);

include/rfl/toml/write.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <type_traits>
99

1010
#include "../Processors.hpp"
11+
#include "../internal/no_field_names_v.hpp"
1112
#include "../parsing/Parent.hpp"
1213
#include "Parser.hpp"
1314

@@ -21,7 +22,7 @@ std::ostream& write(const auto& _obj, std::ostream& _stream) {
2122
::toml::table root;
2223
auto w = Writer(&root);
2324
using ProcessorsType = Processors<Ps...>;
24-
static_assert(!ProcessorsType::no_field_names_,
25+
static_assert(!internal::no_field_names_v<ProcessorsType>,
2526
"The NoFieldNames processor is not supported for BSON, XML, "
2627
"TOML, or YAML.");
2728
Parser<T, ProcessorsType>::write(w, _obj, typename ParentType::Root{});
@@ -38,7 +39,7 @@ std::string write(const auto& _obj) {
3839
::toml::table root;
3940
auto w = Writer(&root);
4041
using ProcessorsType = Processors<Ps...>;
41-
static_assert(!ProcessorsType::no_field_names_,
42+
static_assert(!internal::no_field_names_v<ProcessorsType>,
4243
"The NoFieldNames processor is not supported for BSON, XML, "
4344
"TOML, or YAML.");
4445
Parser<T, ProcessorsType>::write(w, _obj, typename ParentType::Root{});

include/rfl/ubjson/Parser.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define RFL_UBJSON_PARSER_HPP_
33

44
#include "../Tuple.hpp"
5+
#include "../internal/no_field_names_v.hpp"
56
#include "../parsing/Parser.hpp"
67
#include "Reader.hpp"
78
#include "Writer.hpp"
@@ -20,8 +21,8 @@ struct Parser<ubjson::Reader, ubjson::Writer, NamedTuple<FieldTypes...>,
2021
ubjson::Reader, ubjson::Writer,
2122
/*_ignore_empty_containers=*/false,
2223
/*_all_required=*/true,
23-
/*_no_field_names=*/ProcessorsType::no_field_names_, ProcessorsType,
24-
FieldTypes...> {};
24+
/*_no_field_names=*/internal::no_field_names_v<ProcessorsType>,
25+
ProcessorsType, FieldTypes...> {};
2526

2627
template <class ProcessorsType, class... Ts>
2728
requires AreReaderAndWriter<ubjson::Reader, ubjson::Writer, rfl::Tuple<Ts...>>

include/rfl/xml/read.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "../Processors.hpp"
1010
#include "../internal/get_type_name.hpp"
11+
#include "../internal/no_field_names_v.hpp"
1112
#include "../internal/remove_namespaces.hpp"
1213
#include "Parser.hpp"
1314
#include "Reader.hpp"
@@ -21,7 +22,7 @@ template <class T, class... Ps>
2122
auto read(const InputVarType& _var) {
2223
const auto r = Reader();
2324
using ProcessorsType = Processors<Ps...>;
24-
static_assert(!ProcessorsType::no_field_names_,
25+
static_assert(!internal::no_field_names_v<ProcessorsType>,
2526
"The NoFieldNames processor is not supported for BSON, XML, "
2627
"TOML, or YAML.");
2728
return Parser<T, ProcessorsType>::read(r, _var);

include/rfl/xml/write.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "../Processors.hpp"
1111
#include "../internal/StringLiteral.hpp"
1212
#include "../internal/get_type_name.hpp"
13+
#include "../internal/no_field_names_v.hpp"
1314
#include "../internal/remove_namespaces.hpp"
1415
#include "../parsing/Parent.hpp"
1516
#include "Parser.hpp"
@@ -53,7 +54,7 @@ std::ostream& write(const auto& _obj, std::ostream& _stream,
5354
auto w = Writer(doc, root_name.str());
5455

5556
using ProcessorsType = Processors<Ps...>;
56-
static_assert(!ProcessorsType::no_field_names_,
57+
static_assert(!internal::no_field_names_v<ProcessorsType>,
5758
"The NoFieldNames processor is not supported for BSON, XML, "
5859
"TOML, or YAML.");
5960
Parser<T, ProcessorsType>::write(w, _obj, typename ParentType::Root{});

include/rfl/yaml/read.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
#include <string_view>
99

1010
#include "../Processors.hpp"
11+
#include "../internal/no_field_names_v.hpp"
1112
#include "../internal/wrap_in_rfl_array_t.hpp"
1213
#include "Parser.hpp"
1314
#include "Reader.hpp"
15+
1416
namespace rfl {
1517
namespace yaml {
1618

@@ -21,7 +23,7 @@ template <class T, class... Ps>
2123
auto read(const InputVarType& _var) {
2224
const auto r = Reader();
2325
using ProcessorsType = Processors<Ps...>;
24-
static_assert(!ProcessorsType::no_field_names_,
26+
static_assert(!internal::no_field_names_v<ProcessorsType>,
2527
"The NoFieldNames processor is not supported for BSON, XML, "
2628
"TOML, or YAML.");
2729
return Parser<T, ProcessorsType>::read(r, _var);

include/rfl/yaml/write.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <type_traits>
1010

1111
#include "../Processors.hpp"
12+
#include "../internal/no_field_names_v.hpp"
1213
#include "../parsing/Parent.hpp"
1314
#include "Parser.hpp"
1415

@@ -23,7 +24,7 @@ std::ostream& write(const auto& _obj, std::ostream& _stream) {
2324
const auto out = Ref<YAML::Emitter>::make();
2425
auto w = Writer(out);
2526
using ProcessorsType = Processors<Ps...>;
26-
static_assert(!ProcessorsType::no_field_names_,
27+
static_assert(!internal::no_field_names_v<ProcessorsType>,
2728
"The NoFieldNames processor is not supported for BSON, XML, "
2829
"TOML, or YAML.");
2930
Parser<T, ProcessorsType>::write(w, _obj, typename ParentType::Root{});
@@ -39,7 +40,7 @@ std::string write(const auto& _obj) {
3940
const auto out = Ref<YAML::Emitter>::make();
4041
auto w = Writer(out);
4142
using ProcessorsType = Processors<Ps...>;
42-
static_assert(!ProcessorsType::no_field_names_,
43+
static_assert(!internal::no_field_names_v<ProcessorsType>,
4344
"The NoFieldNames processor is not supported for BSON, XML, "
4445
"TOML, or YAML.");
4546
Parser<T, ProcessorsType>::write(w, _obj, typename ParentType::Root{});

0 commit comments

Comments
 (0)