Skip to content

Commit 685fb1a

Browse files
Update capnproto, xml, yaml
1 parent a2f20c9 commit 685fb1a

6 files changed

Lines changed: 163 additions & 166 deletions

File tree

include/rfl/capnproto/Writer.hpp

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
#include <string_view>
1111
#include <type_traits>
1212

13-
//#include "../Box.hpp"
13+
// #include "../Box.hpp"
1414
#include "../Bytestring.hpp"
15-
//#include "../Ref.hpp"
16-
//#include "../Result.hpp"
15+
// #include "../Ref.hpp"
16+
// #include "../Result.hpp"
1717
#include "../Vectorstring.hpp"
1818
#include "../always_false.hpp"
1919
#include "../internal/is_literal.hpp"
20-
//#include "../internal/ptr_cast.hpp"
20+
// #include "../internal/ptr_cast.hpp"
2121
#include "../common.hpp"
2222

2323
namespace rfl::capnproto {
@@ -57,109 +57,109 @@ class RFL_API Writer {
5757
~Writer();
5858

5959
template <class T>
60-
OutputArrayType array_as_root(const T /*_size*/) const noexcept {
60+
OutputArrayType array_as_root(const T /*_size*/) const {
6161
static_assert(always_false_v<T>,
6262
"In Cap'n Proto, root values must always be structs.");
6363
throw std::runtime_error("Unsupported.");
6464
}
6565

6666
template <class T>
67-
OutputMapType map_as_root(const T /*_size*/) const noexcept {
67+
OutputMapType map_as_root(const T /*_size*/) const {
6868
static_assert(always_false_v<T>,
6969
"In Cap'n Proto, root values must always be structs.");
7070
throw std::runtime_error("Unsupported.");
7171
}
7272

73-
Writer::OutputObjectType object_as_root(const size_t _size) const noexcept;
73+
Writer::OutputObjectType object_as_root(const size_t _size) const;
7474

7575
template <class T = int>
76-
OutputVarType null_as_root() const noexcept {
76+
OutputVarType null_as_root() const {
7777
static_assert(always_false_v<T>,
7878
"In Cap'n Proto, root values must always be structs.");
7979
throw std::runtime_error("Unsupported.");
8080
}
8181

8282
template <class T = int>
83-
OutputUnionType union_as_root() const noexcept {
83+
OutputUnionType union_as_root() const {
8484
static_assert(always_false_v<T>,
8585
"In Cap'n Proto, root values must always be structs.");
8686
throw std::runtime_error("Unsupported.");
8787
}
8888

8989
template <class T>
90-
OutputVarType value_as_root(const T& /*_var*/) const noexcept {
90+
OutputVarType value_as_root(const T& /*_var*/) const {
9191
static_assert(always_false_v<T>,
9292
"In Cap'n Proto, root values must always be structs.");
9393
throw std::runtime_error("Unsupported.");
9494
}
9595

9696
OutputArrayType add_array_to_array(const size_t _size,
97-
OutputArrayType* _parent) const noexcept;
97+
OutputArrayType* _parent) const;
9898

9999
OutputArrayType add_array_to_map(const std::string_view& _name,
100100
const size_t _size,
101-
OutputMapType* _parent) const noexcept;
101+
OutputMapType* _parent) const;
102102

103103
OutputArrayType add_array_to_object(const std::string_view& _name,
104104
const size_t _size,
105-
OutputObjectType* _parent) const noexcept;
105+
OutputObjectType* _parent) const;
106106

107107
OutputArrayType add_array_to_union(const size_t _index, const size_t _size,
108-
OutputUnionType* _parent) const noexcept;
108+
OutputUnionType* _parent) const;
109109

110110
OutputMapType add_map_to_array(const size_t _size,
111-
OutputArrayType* _parent) const noexcept;
111+
OutputArrayType* _parent) const;
112112

113113
OutputMapType add_map_to_map(const std::string_view& _name,
114114
const size_t _size,
115-
OutputMapType* _parent) const noexcept;
115+
OutputMapType* _parent) const;
116116

117117
OutputMapType add_map_to_object(const std::string_view& _name,
118118
const size_t _size,
119-
OutputObjectType* _parent) const noexcept;
119+
OutputObjectType* _parent) const;
120120

121121
OutputMapType add_map_to_union(const size_t _index, const size_t _size,
122-
OutputUnionType* _parent) const noexcept;
122+
OutputUnionType* _parent) const;
123123

124124
OutputObjectType add_object_to_array(const size_t _size,
125-
OutputArrayType* _parent) const noexcept;
125+
OutputArrayType* _parent) const;
126126

127127
OutputObjectType add_object_to_map(const std::string_view& _name,
128128
const size_t _size,
129-
OutputMapType* _parent) const noexcept;
129+
OutputMapType* _parent) const;
130130

131-
OutputObjectType add_object_to_object(
132-
const std::string_view& _name, const size_t _size,
133-
OutputObjectType* _parent) const noexcept;
131+
OutputObjectType add_object_to_object(const std::string_view& _name,
132+
const size_t _size,
133+
OutputObjectType* _parent) const;
134134

135135
OutputObjectType add_object_to_union(const size_t _index, const size_t _size,
136-
OutputUnionType* _parent) const noexcept;
136+
OutputUnionType* _parent) const;
137137

138-
OutputUnionType add_union_to_array(OutputArrayType* _parent) const noexcept;
138+
OutputUnionType add_union_to_array(OutputArrayType* _parent) const;
139139

140140
OutputUnionType add_union_to_map(const std::string_view& _name,
141-
OutputMapType* _parent) const noexcept;
141+
OutputMapType* _parent) const;
142142

143143
OutputUnionType add_union_to_object(const std::string_view& _name,
144-
OutputObjectType* _parent) const noexcept;
144+
OutputObjectType* _parent) const;
145145

146146
OutputUnionType add_union_to_union(const size_t _index,
147-
OutputUnionType* _parent) const noexcept;
147+
OutputUnionType* _parent) const;
148148

149-
OutputVarType add_null_to_array(OutputArrayType* _parent) const noexcept;
149+
OutputVarType add_null_to_array(OutputArrayType* _parent) const;
150150

151151
OutputVarType add_null_to_map(const std::string_view& _name,
152-
OutputMapType* _parent) const noexcept;
152+
OutputMapType* _parent) const;
153153

154154
OutputVarType add_null_to_object(const std::string_view& _name,
155-
OutputObjectType* _parent) const noexcept;
155+
OutputObjectType* _parent) const;
156156

157157
OutputVarType add_null_to_union(const size_t _index,
158-
OutputUnionType* _parent) const noexcept;
158+
OutputUnionType* _parent) const;
159159

160160
template <class T>
161161
OutputVarType add_value_to_array(const T& _var,
162-
OutputArrayType* _parent) const noexcept {
162+
OutputArrayType* _parent) const {
163163
if constexpr (std::is_same<std::remove_cvref_t<T>, std::string>()) {
164164
_parent->val_.set(_parent->ix_++, _var.c_str());
165165

@@ -189,7 +189,7 @@ class RFL_API Writer {
189189

190190
template <class T>
191191
OutputVarType add_value_to_map(const std::string_view& _name, const T& _var,
192-
OutputMapType* _parent) const noexcept {
192+
OutputMapType* _parent) const {
193193
auto entries =
194194
OutputArrayType{_parent->val_.get("entries").as<capnp::DynamicList>()};
195195
auto new_entry = add_object_to_array(2, &entries);
@@ -200,7 +200,7 @@ class RFL_API Writer {
200200
template <class T>
201201
OutputVarType add_value_to_object(const std::string_view& _name,
202202
const T& _var,
203-
OutputObjectType* _parent) const noexcept {
203+
OutputObjectType* _parent) const {
204204
if constexpr (std::is_same<std::remove_cvref_t<T>, std::string>()) {
205205
_parent->val_.set(_name.data(), _var.c_str());
206206

@@ -228,7 +228,7 @@ class RFL_API Writer {
228228

229229
template <class T>
230230
OutputVarType add_value_to_union(const size_t _index, const T& _var,
231-
OutputUnionType* _parent) const noexcept {
231+
OutputUnionType* _parent) const {
232232
const auto field = _parent->val_.getSchema().getFields()[_index];
233233

234234
if constexpr (std::is_same<std::remove_cvref_t<T>, std::string>()) {
@@ -256,11 +256,11 @@ class RFL_API Writer {
256256
return OutputVarType{};
257257
}
258258

259-
void end_array(OutputArrayType* /*_arr*/) const noexcept {}
259+
void end_array(OutputArrayType* /*_arr*/) const {}
260260

261-
void end_map(OutputMapType* /*_obj*/) const noexcept {}
261+
void end_map(OutputMapType* /*_obj*/) const {}
262262

263-
void end_object(OutputObjectType* /*_obj*/) const noexcept {}
263+
void end_object(OutputObjectType* /*_obj*/) const {}
264264

265265
private:
266266
capnp::DynamicStruct::Builder* root_;

include/rfl/xml/Writer.hpp

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,60 +40,60 @@ struct RFL_API Writer {
4040

4141
~Writer();
4242

43-
OutputArrayType array_as_root(const size_t _size) const noexcept;
43+
OutputArrayType array_as_root(const size_t _size) const;
4444

45-
OutputObjectType object_as_root(const size_t _size) const noexcept;
45+
OutputObjectType object_as_root(const size_t _size) const;
4646

47-
OutputVarType null_as_root() const noexcept;
47+
OutputVarType null_as_root() const;
4848

4949
template <class T>
50-
OutputVarType value_as_root(const T& _var) const noexcept {
50+
OutputVarType value_as_root(const T& _var) const {
5151
const auto str = to_string(_var);
5252
return value_as_root_impl(str);
5353
}
5454

5555
OutputArrayType add_array_to_array(const size_t _size,
56-
OutputArrayType* _parent) const noexcept;
56+
OutputArrayType* _parent) const;
5757

5858
OutputArrayType add_array_to_object(const std::string_view& _name,
5959
const size_t _size,
60-
OutputObjectType* _parent) const noexcept;
60+
OutputObjectType* _parent) const;
6161

6262
OutputObjectType add_object_to_array(const size_t _size,
63-
OutputArrayType* _parent) const noexcept;
63+
OutputArrayType* _parent) const;
6464

65-
OutputObjectType add_object_to_object(
66-
const std::string_view& _name, const size_t _size,
67-
OutputObjectType* _parent) const noexcept;
65+
OutputObjectType add_object_to_object(const std::string_view& _name,
66+
const size_t _size,
67+
OutputObjectType* _parent) const;
6868

6969
template <class T>
7070
OutputVarType add_value_to_array(const T& _var,
71-
OutputArrayType* _parent) const noexcept {
71+
OutputArrayType* _parent) const {
7272
const auto str = to_string(_var);
7373
return add_value_to_array_impl(str, _parent);
7474
}
7575

7676
template <class T>
77-
OutputVarType add_value_to_object(
78-
const std::string_view& _name, const T& _var, OutputObjectType* _parent,
79-
const bool _is_attribute = false) const noexcept {
77+
OutputVarType add_value_to_object(const std::string_view& _name,
78+
const T& _var, OutputObjectType* _parent,
79+
const bool _is_attribute = false) const {
8080
const auto str = to_string(_var);
8181
return add_value_to_object_impl(_name, str, _parent, _is_attribute);
8282
}
8383

84-
OutputVarType add_null_to_array(OutputArrayType* _parent) const noexcept;
84+
OutputVarType add_null_to_array(OutputArrayType* _parent) const;
8585

86-
OutputVarType add_null_to_object(
87-
const std::string_view& _name, OutputObjectType* _parent,
88-
const bool _is_attribute = false) const noexcept;
86+
OutputVarType add_null_to_object(const std::string_view& _name,
87+
OutputObjectType* _parent,
88+
const bool _is_attribute = false) const;
8989

90-
void end_array(OutputArrayType* _arr) const noexcept;
90+
void end_array(OutputArrayType* _arr) const;
9191

92-
void end_object(OutputObjectType* _obj) const noexcept;
92+
void end_object(OutputObjectType* _obj) const;
9393

9494
private:
9595
template <class T>
96-
std::string to_string(const T& _val) const noexcept {
96+
std::string to_string(const T& _val) const {
9797
if constexpr (std::is_same<std::remove_cvref_t<T>, std::string>()) {
9898
return _val;
9999
} else if constexpr (std::is_same<std::remove_cvref_t<T>, bool>()) {
@@ -106,15 +106,14 @@ struct RFL_API Writer {
106106
}
107107
}
108108

109-
OutputVarType value_as_root_impl(const std::string& _str) const noexcept;
109+
OutputVarType value_as_root_impl(const std::string& _str) const;
110110

111-
OutputVarType add_value_to_array_impl(
112-
const std::string& _str, OutputArrayType* _parent) const noexcept;
111+
OutputVarType add_value_to_array_impl(const std::string& _str,
112+
OutputArrayType* _parent) const;
113113

114114
OutputVarType add_value_to_object_impl(
115115
const std::string_view& _name, const std::string& _str,
116-
OutputObjectType* _parent,
117-
const bool _is_attribute = false) const noexcept;
116+
OutputObjectType* _parent, const bool _is_attribute = false) const;
118117

119118
public:
120119
Ref<pugi::xml_node> root_;

0 commit comments

Comments
 (0)