16
16
* SPDX-License-Identifier: Apache-2.0
17
17
*/
18
18
/* *
19
- * \file fable/schema/array .hpp
19
+ * \file fable/schema/vector .hpp
20
20
* \see fable/schema/xmagic.hpp
21
21
* \see fable/schema.hpp
22
22
* \see fable/schema_test.cpp
@@ -37,21 +37,21 @@ namespace fable {
37
37
namespace schema {
38
38
39
39
template <typename T, typename P>
40
- class Array : public Base <Array <T, P>> {
40
+ class Vector : public Base <Vector <T, P>> {
41
41
public: // Types and Constructors
42
42
using Type = std::vector<T>;
43
43
using PrototypeSchema = std::remove_cv_t <std::remove_reference_t <P>>;
44
44
45
- Array (Type* ptr, std::string desc);
46
- Array (Type* ptr, PrototypeSchema prototype)
47
- : Base<Array <T, P>>(JsonType::array), prototype_(std::move(prototype)), ptr_(ptr) {}
48
- Array (Type* ptr, PrototypeSchema prototype, std::string desc)
49
- : Base<Array <T, P>>(JsonType::array, std::move(desc)), prototype_(std::move(prototype)), ptr_(ptr) {}
45
+ Vector (Type* ptr, std::string desc);
46
+ Vector (Type* ptr, PrototypeSchema prototype)
47
+ : Base<Vector <T, P>>(JsonType::array), prototype_(std::move(prototype)), ptr_(ptr) {}
48
+ Vector (Type* ptr, PrototypeSchema prototype, std::string desc)
49
+ : Base<Vector <T, P>>(JsonType::array, std::move(desc)), prototype_(std::move(prototype)), ptr_(ptr) {}
50
50
51
51
#if 0
52
52
// This is defined in: fable/schema/xmagic.hpp
53
- Array (Type* ptr, std::string desc)
54
- : Array (ptr, make_prototype<T>(), std::move(desc)) {}
53
+ Vector (Type* ptr, std::string desc)
54
+ : Vector (ptr, make_prototype<T>(), std::move(desc)) {}
55
55
#endif
56
56
57
57
public: // Specials
@@ -71,21 +71,21 @@ class Array : public Base<Array<T, P>> {
71
71
/* *
72
72
* Set whether deserialization should extend the underlying array.
73
73
*/
74
- Array <T, P> extend (bool value) && {
74
+ Vector <T, P> extend (bool value) && {
75
75
option_extend_ = value;
76
76
return std::move (*this );
77
77
}
78
78
79
79
size_t min_items () const { return min_items_; }
80
80
void set_min_items (size_t value) { min_items_ = value; }
81
- Array <T, P> min_items (size_t value) && {
81
+ Vector <T, P> min_items (size_t value) && {
82
82
min_items_ = value;
83
83
return std::move (*this );
84
84
}
85
85
86
86
size_t max_items () const { return max_items_; }
87
87
void set_max_items (size_t value) { max_items_ = value; }
88
- Array <T, P> max_items (size_t value) && {
88
+ Vector <T, P> max_items (size_t value) && {
89
89
max_items_ = value;
90
90
return std::move (*this );
91
91
}
@@ -174,8 +174,8 @@ class Array : public Base<Array<T, P>> {
174
174
};
175
175
176
176
template <typename T, typename P, typename S>
177
- Array <T, P> make_schema (std::vector<T>* ptr, P&& prototype, S&& desc) {
178
- return Array <T, P>(ptr, std::forward<P>(prototype), std::forward<S>(desc));
177
+ Vector <T, P> make_schema (std::vector<T>* ptr, P&& prototype, S&& desc) {
178
+ return Vector <T, P>(ptr, std::forward<P>(prototype), std::forward<S>(desc));
179
179
}
180
180
181
181
} // namespace schema
0 commit comments