Mercurial > hg > sv-dependency-builds
comparison osx/include/capnp/compat/json.capnp.h @ 62:0994c39f1e94
Cap'n Proto v0.6 + build for OSX
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Mon, 22 May 2017 10:01:37 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
61:d101c4099725 | 62:0994c39f1e94 |
---|---|
1 // Generated by Cap'n Proto compiler, DO NOT EDIT | |
2 // source: json.capnp | |
3 | |
4 #ifndef CAPNP_INCLUDED_8ef99297a43a5e34_ | |
5 #define CAPNP_INCLUDED_8ef99297a43a5e34_ | |
6 | |
7 #include <capnp/generated-header-support.h> | |
8 #if !CAPNP_LITE | |
9 #include <capnp/capability.h> | |
10 #endif // !CAPNP_LITE | |
11 | |
12 #if CAPNP_VERSION != 6000 | |
13 #error "Version mismatch between generated code and library headers. You must use the same version of the Cap'n Proto compiler and library." | |
14 #endif | |
15 | |
16 | |
17 namespace capnp { | |
18 namespace schemas { | |
19 | |
20 CAPNP_DECLARE_SCHEMA(8825ffaa852cda72); | |
21 CAPNP_DECLARE_SCHEMA(c27855d853a937cc); | |
22 CAPNP_DECLARE_SCHEMA(9bbf84153dd4bb60); | |
23 | |
24 } // namespace schemas | |
25 } // namespace capnp | |
26 | |
27 namespace capnp { | |
28 | |
29 struct JsonValue { | |
30 JsonValue() = delete; | |
31 | |
32 class Reader; | |
33 class Builder; | |
34 class Pipeline; | |
35 enum Which: uint16_t { | |
36 NULL_, | |
37 BOOLEAN, | |
38 NUMBER, | |
39 STRING, | |
40 ARRAY, | |
41 OBJECT, | |
42 CALL, | |
43 }; | |
44 struct Field; | |
45 struct Call; | |
46 | |
47 struct _capnpPrivate { | |
48 CAPNP_DECLARE_STRUCT_HEADER(8825ffaa852cda72, 2, 1) | |
49 #if !CAPNP_LITE | |
50 static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } | |
51 #endif // !CAPNP_LITE | |
52 }; | |
53 }; | |
54 | |
55 struct JsonValue::Field { | |
56 Field() = delete; | |
57 | |
58 class Reader; | |
59 class Builder; | |
60 class Pipeline; | |
61 | |
62 struct _capnpPrivate { | |
63 CAPNP_DECLARE_STRUCT_HEADER(c27855d853a937cc, 0, 2) | |
64 #if !CAPNP_LITE | |
65 static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } | |
66 #endif // !CAPNP_LITE | |
67 }; | |
68 }; | |
69 | |
70 struct JsonValue::Call { | |
71 Call() = delete; | |
72 | |
73 class Reader; | |
74 class Builder; | |
75 class Pipeline; | |
76 | |
77 struct _capnpPrivate { | |
78 CAPNP_DECLARE_STRUCT_HEADER(9bbf84153dd4bb60, 0, 2) | |
79 #if !CAPNP_LITE | |
80 static constexpr ::capnp::_::RawBrandedSchema const* brand() { return &schema->defaultBrand; } | |
81 #endif // !CAPNP_LITE | |
82 }; | |
83 }; | |
84 | |
85 // ======================================================================================= | |
86 | |
87 class JsonValue::Reader { | |
88 public: | |
89 typedef JsonValue Reads; | |
90 | |
91 Reader() = default; | |
92 inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} | |
93 | |
94 inline ::capnp::MessageSize totalSize() const { | |
95 return _reader.totalSize().asPublic(); | |
96 } | |
97 | |
98 #if !CAPNP_LITE | |
99 inline ::kj::StringTree toString() const { | |
100 return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); | |
101 } | |
102 #endif // !CAPNP_LITE | |
103 | |
104 inline Which which() const; | |
105 inline bool isNull() const; | |
106 inline ::capnp::Void getNull() const; | |
107 | |
108 inline bool isBoolean() const; | |
109 inline bool getBoolean() const; | |
110 | |
111 inline bool isNumber() const; | |
112 inline double getNumber() const; | |
113 | |
114 inline bool isString() const; | |
115 inline bool hasString() const; | |
116 inline ::capnp::Text::Reader getString() const; | |
117 | |
118 inline bool isArray() const; | |
119 inline bool hasArray() const; | |
120 inline ::capnp::List< ::capnp::JsonValue>::Reader getArray() const; | |
121 | |
122 inline bool isObject() const; | |
123 inline bool hasObject() const; | |
124 inline ::capnp::List< ::capnp::JsonValue::Field>::Reader getObject() const; | |
125 | |
126 inline bool isCall() const; | |
127 inline bool hasCall() const; | |
128 inline ::capnp::JsonValue::Call::Reader getCall() const; | |
129 | |
130 private: | |
131 ::capnp::_::StructReader _reader; | |
132 template <typename, ::capnp::Kind> | |
133 friend struct ::capnp::ToDynamic_; | |
134 template <typename, ::capnp::Kind> | |
135 friend struct ::capnp::_::PointerHelpers; | |
136 template <typename, ::capnp::Kind> | |
137 friend struct ::capnp::List; | |
138 friend class ::capnp::MessageBuilder; | |
139 friend class ::capnp::Orphanage; | |
140 }; | |
141 | |
142 class JsonValue::Builder { | |
143 public: | |
144 typedef JsonValue Builds; | |
145 | |
146 Builder() = delete; // Deleted to discourage incorrect usage. | |
147 // You can explicitly initialize to nullptr instead. | |
148 inline Builder(decltype(nullptr)) {} | |
149 inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} | |
150 inline operator Reader() const { return Reader(_builder.asReader()); } | |
151 inline Reader asReader() const { return *this; } | |
152 | |
153 inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } | |
154 #if !CAPNP_LITE | |
155 inline ::kj::StringTree toString() const { return asReader().toString(); } | |
156 #endif // !CAPNP_LITE | |
157 | |
158 inline Which which(); | |
159 inline bool isNull(); | |
160 inline ::capnp::Void getNull(); | |
161 inline void setNull( ::capnp::Void value = ::capnp::VOID); | |
162 | |
163 inline bool isBoolean(); | |
164 inline bool getBoolean(); | |
165 inline void setBoolean(bool value); | |
166 | |
167 inline bool isNumber(); | |
168 inline double getNumber(); | |
169 inline void setNumber(double value); | |
170 | |
171 inline bool isString(); | |
172 inline bool hasString(); | |
173 inline ::capnp::Text::Builder getString(); | |
174 inline void setString( ::capnp::Text::Reader value); | |
175 inline ::capnp::Text::Builder initString(unsigned int size); | |
176 inline void adoptString(::capnp::Orphan< ::capnp::Text>&& value); | |
177 inline ::capnp::Orphan< ::capnp::Text> disownString(); | |
178 | |
179 inline bool isArray(); | |
180 inline bool hasArray(); | |
181 inline ::capnp::List< ::capnp::JsonValue>::Builder getArray(); | |
182 inline void setArray( ::capnp::List< ::capnp::JsonValue>::Reader value); | |
183 inline ::capnp::List< ::capnp::JsonValue>::Builder initArray(unsigned int size); | |
184 inline void adoptArray(::capnp::Orphan< ::capnp::List< ::capnp::JsonValue>>&& value); | |
185 inline ::capnp::Orphan< ::capnp::List< ::capnp::JsonValue>> disownArray(); | |
186 | |
187 inline bool isObject(); | |
188 inline bool hasObject(); | |
189 inline ::capnp::List< ::capnp::JsonValue::Field>::Builder getObject(); | |
190 inline void setObject( ::capnp::List< ::capnp::JsonValue::Field>::Reader value); | |
191 inline ::capnp::List< ::capnp::JsonValue::Field>::Builder initObject(unsigned int size); | |
192 inline void adoptObject(::capnp::Orphan< ::capnp::List< ::capnp::JsonValue::Field>>&& value); | |
193 inline ::capnp::Orphan< ::capnp::List< ::capnp::JsonValue::Field>> disownObject(); | |
194 | |
195 inline bool isCall(); | |
196 inline bool hasCall(); | |
197 inline ::capnp::JsonValue::Call::Builder getCall(); | |
198 inline void setCall( ::capnp::JsonValue::Call::Reader value); | |
199 inline ::capnp::JsonValue::Call::Builder initCall(); | |
200 inline void adoptCall(::capnp::Orphan< ::capnp::JsonValue::Call>&& value); | |
201 inline ::capnp::Orphan< ::capnp::JsonValue::Call> disownCall(); | |
202 | |
203 private: | |
204 ::capnp::_::StructBuilder _builder; | |
205 template <typename, ::capnp::Kind> | |
206 friend struct ::capnp::ToDynamic_; | |
207 friend class ::capnp::Orphanage; | |
208 template <typename, ::capnp::Kind> | |
209 friend struct ::capnp::_::PointerHelpers; | |
210 }; | |
211 | |
212 #if !CAPNP_LITE | |
213 class JsonValue::Pipeline { | |
214 public: | |
215 typedef JsonValue Pipelines; | |
216 | |
217 inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} | |
218 inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) | |
219 : _typeless(kj::mv(typeless)) {} | |
220 | |
221 private: | |
222 ::capnp::AnyPointer::Pipeline _typeless; | |
223 friend class ::capnp::PipelineHook; | |
224 template <typename, ::capnp::Kind> | |
225 friend struct ::capnp::ToDynamic_; | |
226 }; | |
227 #endif // !CAPNP_LITE | |
228 | |
229 class JsonValue::Field::Reader { | |
230 public: | |
231 typedef Field Reads; | |
232 | |
233 Reader() = default; | |
234 inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} | |
235 | |
236 inline ::capnp::MessageSize totalSize() const { | |
237 return _reader.totalSize().asPublic(); | |
238 } | |
239 | |
240 #if !CAPNP_LITE | |
241 inline ::kj::StringTree toString() const { | |
242 return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); | |
243 } | |
244 #endif // !CAPNP_LITE | |
245 | |
246 inline bool hasName() const; | |
247 inline ::capnp::Text::Reader getName() const; | |
248 | |
249 inline bool hasValue() const; | |
250 inline ::capnp::JsonValue::Reader getValue() const; | |
251 | |
252 private: | |
253 ::capnp::_::StructReader _reader; | |
254 template <typename, ::capnp::Kind> | |
255 friend struct ::capnp::ToDynamic_; | |
256 template <typename, ::capnp::Kind> | |
257 friend struct ::capnp::_::PointerHelpers; | |
258 template <typename, ::capnp::Kind> | |
259 friend struct ::capnp::List; | |
260 friend class ::capnp::MessageBuilder; | |
261 friend class ::capnp::Orphanage; | |
262 }; | |
263 | |
264 class JsonValue::Field::Builder { | |
265 public: | |
266 typedef Field Builds; | |
267 | |
268 Builder() = delete; // Deleted to discourage incorrect usage. | |
269 // You can explicitly initialize to nullptr instead. | |
270 inline Builder(decltype(nullptr)) {} | |
271 inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} | |
272 inline operator Reader() const { return Reader(_builder.asReader()); } | |
273 inline Reader asReader() const { return *this; } | |
274 | |
275 inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } | |
276 #if !CAPNP_LITE | |
277 inline ::kj::StringTree toString() const { return asReader().toString(); } | |
278 #endif // !CAPNP_LITE | |
279 | |
280 inline bool hasName(); | |
281 inline ::capnp::Text::Builder getName(); | |
282 inline void setName( ::capnp::Text::Reader value); | |
283 inline ::capnp::Text::Builder initName(unsigned int size); | |
284 inline void adoptName(::capnp::Orphan< ::capnp::Text>&& value); | |
285 inline ::capnp::Orphan< ::capnp::Text> disownName(); | |
286 | |
287 inline bool hasValue(); | |
288 inline ::capnp::JsonValue::Builder getValue(); | |
289 inline void setValue( ::capnp::JsonValue::Reader value); | |
290 inline ::capnp::JsonValue::Builder initValue(); | |
291 inline void adoptValue(::capnp::Orphan< ::capnp::JsonValue>&& value); | |
292 inline ::capnp::Orphan< ::capnp::JsonValue> disownValue(); | |
293 | |
294 private: | |
295 ::capnp::_::StructBuilder _builder; | |
296 template <typename, ::capnp::Kind> | |
297 friend struct ::capnp::ToDynamic_; | |
298 friend class ::capnp::Orphanage; | |
299 template <typename, ::capnp::Kind> | |
300 friend struct ::capnp::_::PointerHelpers; | |
301 }; | |
302 | |
303 #if !CAPNP_LITE | |
304 class JsonValue::Field::Pipeline { | |
305 public: | |
306 typedef Field Pipelines; | |
307 | |
308 inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} | |
309 inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) | |
310 : _typeless(kj::mv(typeless)) {} | |
311 | |
312 inline ::capnp::JsonValue::Pipeline getValue(); | |
313 private: | |
314 ::capnp::AnyPointer::Pipeline _typeless; | |
315 friend class ::capnp::PipelineHook; | |
316 template <typename, ::capnp::Kind> | |
317 friend struct ::capnp::ToDynamic_; | |
318 }; | |
319 #endif // !CAPNP_LITE | |
320 | |
321 class JsonValue::Call::Reader { | |
322 public: | |
323 typedef Call Reads; | |
324 | |
325 Reader() = default; | |
326 inline explicit Reader(::capnp::_::StructReader base): _reader(base) {} | |
327 | |
328 inline ::capnp::MessageSize totalSize() const { | |
329 return _reader.totalSize().asPublic(); | |
330 } | |
331 | |
332 #if !CAPNP_LITE | |
333 inline ::kj::StringTree toString() const { | |
334 return ::capnp::_::structString(_reader, *_capnpPrivate::brand()); | |
335 } | |
336 #endif // !CAPNP_LITE | |
337 | |
338 inline bool hasFunction() const; | |
339 inline ::capnp::Text::Reader getFunction() const; | |
340 | |
341 inline bool hasParams() const; | |
342 inline ::capnp::List< ::capnp::JsonValue>::Reader getParams() const; | |
343 | |
344 private: | |
345 ::capnp::_::StructReader _reader; | |
346 template <typename, ::capnp::Kind> | |
347 friend struct ::capnp::ToDynamic_; | |
348 template <typename, ::capnp::Kind> | |
349 friend struct ::capnp::_::PointerHelpers; | |
350 template <typename, ::capnp::Kind> | |
351 friend struct ::capnp::List; | |
352 friend class ::capnp::MessageBuilder; | |
353 friend class ::capnp::Orphanage; | |
354 }; | |
355 | |
356 class JsonValue::Call::Builder { | |
357 public: | |
358 typedef Call Builds; | |
359 | |
360 Builder() = delete; // Deleted to discourage incorrect usage. | |
361 // You can explicitly initialize to nullptr instead. | |
362 inline Builder(decltype(nullptr)) {} | |
363 inline explicit Builder(::capnp::_::StructBuilder base): _builder(base) {} | |
364 inline operator Reader() const { return Reader(_builder.asReader()); } | |
365 inline Reader asReader() const { return *this; } | |
366 | |
367 inline ::capnp::MessageSize totalSize() const { return asReader().totalSize(); } | |
368 #if !CAPNP_LITE | |
369 inline ::kj::StringTree toString() const { return asReader().toString(); } | |
370 #endif // !CAPNP_LITE | |
371 | |
372 inline bool hasFunction(); | |
373 inline ::capnp::Text::Builder getFunction(); | |
374 inline void setFunction( ::capnp::Text::Reader value); | |
375 inline ::capnp::Text::Builder initFunction(unsigned int size); | |
376 inline void adoptFunction(::capnp::Orphan< ::capnp::Text>&& value); | |
377 inline ::capnp::Orphan< ::capnp::Text> disownFunction(); | |
378 | |
379 inline bool hasParams(); | |
380 inline ::capnp::List< ::capnp::JsonValue>::Builder getParams(); | |
381 inline void setParams( ::capnp::List< ::capnp::JsonValue>::Reader value); | |
382 inline ::capnp::List< ::capnp::JsonValue>::Builder initParams(unsigned int size); | |
383 inline void adoptParams(::capnp::Orphan< ::capnp::List< ::capnp::JsonValue>>&& value); | |
384 inline ::capnp::Orphan< ::capnp::List< ::capnp::JsonValue>> disownParams(); | |
385 | |
386 private: | |
387 ::capnp::_::StructBuilder _builder; | |
388 template <typename, ::capnp::Kind> | |
389 friend struct ::capnp::ToDynamic_; | |
390 friend class ::capnp::Orphanage; | |
391 template <typename, ::capnp::Kind> | |
392 friend struct ::capnp::_::PointerHelpers; | |
393 }; | |
394 | |
395 #if !CAPNP_LITE | |
396 class JsonValue::Call::Pipeline { | |
397 public: | |
398 typedef Call Pipelines; | |
399 | |
400 inline Pipeline(decltype(nullptr)): _typeless(nullptr) {} | |
401 inline explicit Pipeline(::capnp::AnyPointer::Pipeline&& typeless) | |
402 : _typeless(kj::mv(typeless)) {} | |
403 | |
404 private: | |
405 ::capnp::AnyPointer::Pipeline _typeless; | |
406 friend class ::capnp::PipelineHook; | |
407 template <typename, ::capnp::Kind> | |
408 friend struct ::capnp::ToDynamic_; | |
409 }; | |
410 #endif // !CAPNP_LITE | |
411 | |
412 // ======================================================================================= | |
413 | |
414 inline ::capnp::JsonValue::Which JsonValue::Reader::which() const { | |
415 return _reader.getDataField<Which>( | |
416 ::capnp::bounded<0>() * ::capnp::ELEMENTS); | |
417 } | |
418 inline ::capnp::JsonValue::Which JsonValue::Builder::which() { | |
419 return _builder.getDataField<Which>( | |
420 ::capnp::bounded<0>() * ::capnp::ELEMENTS); | |
421 } | |
422 | |
423 inline bool JsonValue::Reader::isNull() const { | |
424 return which() == JsonValue::NULL_; | |
425 } | |
426 inline bool JsonValue::Builder::isNull() { | |
427 return which() == JsonValue::NULL_; | |
428 } | |
429 inline ::capnp::Void JsonValue::Reader::getNull() const { | |
430 KJ_IREQUIRE((which() == JsonValue::NULL_), | |
431 "Must check which() before get()ing a union member."); | |
432 return _reader.getDataField< ::capnp::Void>( | |
433 ::capnp::bounded<0>() * ::capnp::ELEMENTS); | |
434 } | |
435 | |
436 inline ::capnp::Void JsonValue::Builder::getNull() { | |
437 KJ_IREQUIRE((which() == JsonValue::NULL_), | |
438 "Must check which() before get()ing a union member."); | |
439 return _builder.getDataField< ::capnp::Void>( | |
440 ::capnp::bounded<0>() * ::capnp::ELEMENTS); | |
441 } | |
442 inline void JsonValue::Builder::setNull( ::capnp::Void value) { | |
443 _builder.setDataField<JsonValue::Which>( | |
444 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::NULL_); | |
445 _builder.setDataField< ::capnp::Void>( | |
446 ::capnp::bounded<0>() * ::capnp::ELEMENTS, value); | |
447 } | |
448 | |
449 inline bool JsonValue::Reader::isBoolean() const { | |
450 return which() == JsonValue::BOOLEAN; | |
451 } | |
452 inline bool JsonValue::Builder::isBoolean() { | |
453 return which() == JsonValue::BOOLEAN; | |
454 } | |
455 inline bool JsonValue::Reader::getBoolean() const { | |
456 KJ_IREQUIRE((which() == JsonValue::BOOLEAN), | |
457 "Must check which() before get()ing a union member."); | |
458 return _reader.getDataField<bool>( | |
459 ::capnp::bounded<16>() * ::capnp::ELEMENTS); | |
460 } | |
461 | |
462 inline bool JsonValue::Builder::getBoolean() { | |
463 KJ_IREQUIRE((which() == JsonValue::BOOLEAN), | |
464 "Must check which() before get()ing a union member."); | |
465 return _builder.getDataField<bool>( | |
466 ::capnp::bounded<16>() * ::capnp::ELEMENTS); | |
467 } | |
468 inline void JsonValue::Builder::setBoolean(bool value) { | |
469 _builder.setDataField<JsonValue::Which>( | |
470 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::BOOLEAN); | |
471 _builder.setDataField<bool>( | |
472 ::capnp::bounded<16>() * ::capnp::ELEMENTS, value); | |
473 } | |
474 | |
475 inline bool JsonValue::Reader::isNumber() const { | |
476 return which() == JsonValue::NUMBER; | |
477 } | |
478 inline bool JsonValue::Builder::isNumber() { | |
479 return which() == JsonValue::NUMBER; | |
480 } | |
481 inline double JsonValue::Reader::getNumber() const { | |
482 KJ_IREQUIRE((which() == JsonValue::NUMBER), | |
483 "Must check which() before get()ing a union member."); | |
484 return _reader.getDataField<double>( | |
485 ::capnp::bounded<1>() * ::capnp::ELEMENTS); | |
486 } | |
487 | |
488 inline double JsonValue::Builder::getNumber() { | |
489 KJ_IREQUIRE((which() == JsonValue::NUMBER), | |
490 "Must check which() before get()ing a union member."); | |
491 return _builder.getDataField<double>( | |
492 ::capnp::bounded<1>() * ::capnp::ELEMENTS); | |
493 } | |
494 inline void JsonValue::Builder::setNumber(double value) { | |
495 _builder.setDataField<JsonValue::Which>( | |
496 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::NUMBER); | |
497 _builder.setDataField<double>( | |
498 ::capnp::bounded<1>() * ::capnp::ELEMENTS, value); | |
499 } | |
500 | |
501 inline bool JsonValue::Reader::isString() const { | |
502 return which() == JsonValue::STRING; | |
503 } | |
504 inline bool JsonValue::Builder::isString() { | |
505 return which() == JsonValue::STRING; | |
506 } | |
507 inline bool JsonValue::Reader::hasString() const { | |
508 if (which() != JsonValue::STRING) return false; | |
509 return !_reader.getPointerField( | |
510 ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); | |
511 } | |
512 inline bool JsonValue::Builder::hasString() { | |
513 if (which() != JsonValue::STRING) return false; | |
514 return !_builder.getPointerField( | |
515 ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); | |
516 } | |
517 inline ::capnp::Text::Reader JsonValue::Reader::getString() const { | |
518 KJ_IREQUIRE((which() == JsonValue::STRING), | |
519 "Must check which() before get()ing a union member."); | |
520 return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( | |
521 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
522 } | |
523 inline ::capnp::Text::Builder JsonValue::Builder::getString() { | |
524 KJ_IREQUIRE((which() == JsonValue::STRING), | |
525 "Must check which() before get()ing a union member."); | |
526 return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( | |
527 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
528 } | |
529 inline void JsonValue::Builder::setString( ::capnp::Text::Reader value) { | |
530 _builder.setDataField<JsonValue::Which>( | |
531 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::STRING); | |
532 ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( | |
533 ::capnp::bounded<0>() * ::capnp::POINTERS), value); | |
534 } | |
535 inline ::capnp::Text::Builder JsonValue::Builder::initString(unsigned int size) { | |
536 _builder.setDataField<JsonValue::Which>( | |
537 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::STRING); | |
538 return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( | |
539 ::capnp::bounded<0>() * ::capnp::POINTERS), size); | |
540 } | |
541 inline void JsonValue::Builder::adoptString( | |
542 ::capnp::Orphan< ::capnp::Text>&& value) { | |
543 _builder.setDataField<JsonValue::Which>( | |
544 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::STRING); | |
545 ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( | |
546 ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); | |
547 } | |
548 inline ::capnp::Orphan< ::capnp::Text> JsonValue::Builder::disownString() { | |
549 KJ_IREQUIRE((which() == JsonValue::STRING), | |
550 "Must check which() before get()ing a union member."); | |
551 return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( | |
552 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
553 } | |
554 | |
555 inline bool JsonValue::Reader::isArray() const { | |
556 return which() == JsonValue::ARRAY; | |
557 } | |
558 inline bool JsonValue::Builder::isArray() { | |
559 return which() == JsonValue::ARRAY; | |
560 } | |
561 inline bool JsonValue::Reader::hasArray() const { | |
562 if (which() != JsonValue::ARRAY) return false; | |
563 return !_reader.getPointerField( | |
564 ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); | |
565 } | |
566 inline bool JsonValue::Builder::hasArray() { | |
567 if (which() != JsonValue::ARRAY) return false; | |
568 return !_builder.getPointerField( | |
569 ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); | |
570 } | |
571 inline ::capnp::List< ::capnp::JsonValue>::Reader JsonValue::Reader::getArray() const { | |
572 KJ_IREQUIRE((which() == JsonValue::ARRAY), | |
573 "Must check which() before get()ing a union member."); | |
574 return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue>>::get(_reader.getPointerField( | |
575 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
576 } | |
577 inline ::capnp::List< ::capnp::JsonValue>::Builder JsonValue::Builder::getArray() { | |
578 KJ_IREQUIRE((which() == JsonValue::ARRAY), | |
579 "Must check which() before get()ing a union member."); | |
580 return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue>>::get(_builder.getPointerField( | |
581 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
582 } | |
583 inline void JsonValue::Builder::setArray( ::capnp::List< ::capnp::JsonValue>::Reader value) { | |
584 _builder.setDataField<JsonValue::Which>( | |
585 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::ARRAY); | |
586 ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue>>::set(_builder.getPointerField( | |
587 ::capnp::bounded<0>() * ::capnp::POINTERS), value); | |
588 } | |
589 inline ::capnp::List< ::capnp::JsonValue>::Builder JsonValue::Builder::initArray(unsigned int size) { | |
590 _builder.setDataField<JsonValue::Which>( | |
591 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::ARRAY); | |
592 return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue>>::init(_builder.getPointerField( | |
593 ::capnp::bounded<0>() * ::capnp::POINTERS), size); | |
594 } | |
595 inline void JsonValue::Builder::adoptArray( | |
596 ::capnp::Orphan< ::capnp::List< ::capnp::JsonValue>>&& value) { | |
597 _builder.setDataField<JsonValue::Which>( | |
598 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::ARRAY); | |
599 ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue>>::adopt(_builder.getPointerField( | |
600 ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); | |
601 } | |
602 inline ::capnp::Orphan< ::capnp::List< ::capnp::JsonValue>> JsonValue::Builder::disownArray() { | |
603 KJ_IREQUIRE((which() == JsonValue::ARRAY), | |
604 "Must check which() before get()ing a union member."); | |
605 return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue>>::disown(_builder.getPointerField( | |
606 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
607 } | |
608 | |
609 inline bool JsonValue::Reader::isObject() const { | |
610 return which() == JsonValue::OBJECT; | |
611 } | |
612 inline bool JsonValue::Builder::isObject() { | |
613 return which() == JsonValue::OBJECT; | |
614 } | |
615 inline bool JsonValue::Reader::hasObject() const { | |
616 if (which() != JsonValue::OBJECT) return false; | |
617 return !_reader.getPointerField( | |
618 ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); | |
619 } | |
620 inline bool JsonValue::Builder::hasObject() { | |
621 if (which() != JsonValue::OBJECT) return false; | |
622 return !_builder.getPointerField( | |
623 ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); | |
624 } | |
625 inline ::capnp::List< ::capnp::JsonValue::Field>::Reader JsonValue::Reader::getObject() const { | |
626 KJ_IREQUIRE((which() == JsonValue::OBJECT), | |
627 "Must check which() before get()ing a union member."); | |
628 return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue::Field>>::get(_reader.getPointerField( | |
629 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
630 } | |
631 inline ::capnp::List< ::capnp::JsonValue::Field>::Builder JsonValue::Builder::getObject() { | |
632 KJ_IREQUIRE((which() == JsonValue::OBJECT), | |
633 "Must check which() before get()ing a union member."); | |
634 return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue::Field>>::get(_builder.getPointerField( | |
635 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
636 } | |
637 inline void JsonValue::Builder::setObject( ::capnp::List< ::capnp::JsonValue::Field>::Reader value) { | |
638 _builder.setDataField<JsonValue::Which>( | |
639 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::OBJECT); | |
640 ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue::Field>>::set(_builder.getPointerField( | |
641 ::capnp::bounded<0>() * ::capnp::POINTERS), value); | |
642 } | |
643 inline ::capnp::List< ::capnp::JsonValue::Field>::Builder JsonValue::Builder::initObject(unsigned int size) { | |
644 _builder.setDataField<JsonValue::Which>( | |
645 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::OBJECT); | |
646 return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue::Field>>::init(_builder.getPointerField( | |
647 ::capnp::bounded<0>() * ::capnp::POINTERS), size); | |
648 } | |
649 inline void JsonValue::Builder::adoptObject( | |
650 ::capnp::Orphan< ::capnp::List< ::capnp::JsonValue::Field>>&& value) { | |
651 _builder.setDataField<JsonValue::Which>( | |
652 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::OBJECT); | |
653 ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue::Field>>::adopt(_builder.getPointerField( | |
654 ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); | |
655 } | |
656 inline ::capnp::Orphan< ::capnp::List< ::capnp::JsonValue::Field>> JsonValue::Builder::disownObject() { | |
657 KJ_IREQUIRE((which() == JsonValue::OBJECT), | |
658 "Must check which() before get()ing a union member."); | |
659 return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue::Field>>::disown(_builder.getPointerField( | |
660 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
661 } | |
662 | |
663 inline bool JsonValue::Reader::isCall() const { | |
664 return which() == JsonValue::CALL; | |
665 } | |
666 inline bool JsonValue::Builder::isCall() { | |
667 return which() == JsonValue::CALL; | |
668 } | |
669 inline bool JsonValue::Reader::hasCall() const { | |
670 if (which() != JsonValue::CALL) return false; | |
671 return !_reader.getPointerField( | |
672 ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); | |
673 } | |
674 inline bool JsonValue::Builder::hasCall() { | |
675 if (which() != JsonValue::CALL) return false; | |
676 return !_builder.getPointerField( | |
677 ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); | |
678 } | |
679 inline ::capnp::JsonValue::Call::Reader JsonValue::Reader::getCall() const { | |
680 KJ_IREQUIRE((which() == JsonValue::CALL), | |
681 "Must check which() before get()ing a union member."); | |
682 return ::capnp::_::PointerHelpers< ::capnp::JsonValue::Call>::get(_reader.getPointerField( | |
683 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
684 } | |
685 inline ::capnp::JsonValue::Call::Builder JsonValue::Builder::getCall() { | |
686 KJ_IREQUIRE((which() == JsonValue::CALL), | |
687 "Must check which() before get()ing a union member."); | |
688 return ::capnp::_::PointerHelpers< ::capnp::JsonValue::Call>::get(_builder.getPointerField( | |
689 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
690 } | |
691 inline void JsonValue::Builder::setCall( ::capnp::JsonValue::Call::Reader value) { | |
692 _builder.setDataField<JsonValue::Which>( | |
693 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::CALL); | |
694 ::capnp::_::PointerHelpers< ::capnp::JsonValue::Call>::set(_builder.getPointerField( | |
695 ::capnp::bounded<0>() * ::capnp::POINTERS), value); | |
696 } | |
697 inline ::capnp::JsonValue::Call::Builder JsonValue::Builder::initCall() { | |
698 _builder.setDataField<JsonValue::Which>( | |
699 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::CALL); | |
700 return ::capnp::_::PointerHelpers< ::capnp::JsonValue::Call>::init(_builder.getPointerField( | |
701 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
702 } | |
703 inline void JsonValue::Builder::adoptCall( | |
704 ::capnp::Orphan< ::capnp::JsonValue::Call>&& value) { | |
705 _builder.setDataField<JsonValue::Which>( | |
706 ::capnp::bounded<0>() * ::capnp::ELEMENTS, JsonValue::CALL); | |
707 ::capnp::_::PointerHelpers< ::capnp::JsonValue::Call>::adopt(_builder.getPointerField( | |
708 ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); | |
709 } | |
710 inline ::capnp::Orphan< ::capnp::JsonValue::Call> JsonValue::Builder::disownCall() { | |
711 KJ_IREQUIRE((which() == JsonValue::CALL), | |
712 "Must check which() before get()ing a union member."); | |
713 return ::capnp::_::PointerHelpers< ::capnp::JsonValue::Call>::disown(_builder.getPointerField( | |
714 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
715 } | |
716 | |
717 inline bool JsonValue::Field::Reader::hasName() const { | |
718 return !_reader.getPointerField( | |
719 ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); | |
720 } | |
721 inline bool JsonValue::Field::Builder::hasName() { | |
722 return !_builder.getPointerField( | |
723 ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); | |
724 } | |
725 inline ::capnp::Text::Reader JsonValue::Field::Reader::getName() const { | |
726 return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( | |
727 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
728 } | |
729 inline ::capnp::Text::Builder JsonValue::Field::Builder::getName() { | |
730 return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( | |
731 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
732 } | |
733 inline void JsonValue::Field::Builder::setName( ::capnp::Text::Reader value) { | |
734 ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( | |
735 ::capnp::bounded<0>() * ::capnp::POINTERS), value); | |
736 } | |
737 inline ::capnp::Text::Builder JsonValue::Field::Builder::initName(unsigned int size) { | |
738 return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( | |
739 ::capnp::bounded<0>() * ::capnp::POINTERS), size); | |
740 } | |
741 inline void JsonValue::Field::Builder::adoptName( | |
742 ::capnp::Orphan< ::capnp::Text>&& value) { | |
743 ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( | |
744 ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); | |
745 } | |
746 inline ::capnp::Orphan< ::capnp::Text> JsonValue::Field::Builder::disownName() { | |
747 return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( | |
748 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
749 } | |
750 | |
751 inline bool JsonValue::Field::Reader::hasValue() const { | |
752 return !_reader.getPointerField( | |
753 ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); | |
754 } | |
755 inline bool JsonValue::Field::Builder::hasValue() { | |
756 return !_builder.getPointerField( | |
757 ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); | |
758 } | |
759 inline ::capnp::JsonValue::Reader JsonValue::Field::Reader::getValue() const { | |
760 return ::capnp::_::PointerHelpers< ::capnp::JsonValue>::get(_reader.getPointerField( | |
761 ::capnp::bounded<1>() * ::capnp::POINTERS)); | |
762 } | |
763 inline ::capnp::JsonValue::Builder JsonValue::Field::Builder::getValue() { | |
764 return ::capnp::_::PointerHelpers< ::capnp::JsonValue>::get(_builder.getPointerField( | |
765 ::capnp::bounded<1>() * ::capnp::POINTERS)); | |
766 } | |
767 #if !CAPNP_LITE | |
768 inline ::capnp::JsonValue::Pipeline JsonValue::Field::Pipeline::getValue() { | |
769 return ::capnp::JsonValue::Pipeline(_typeless.getPointerField(1)); | |
770 } | |
771 #endif // !CAPNP_LITE | |
772 inline void JsonValue::Field::Builder::setValue( ::capnp::JsonValue::Reader value) { | |
773 ::capnp::_::PointerHelpers< ::capnp::JsonValue>::set(_builder.getPointerField( | |
774 ::capnp::bounded<1>() * ::capnp::POINTERS), value); | |
775 } | |
776 inline ::capnp::JsonValue::Builder JsonValue::Field::Builder::initValue() { | |
777 return ::capnp::_::PointerHelpers< ::capnp::JsonValue>::init(_builder.getPointerField( | |
778 ::capnp::bounded<1>() * ::capnp::POINTERS)); | |
779 } | |
780 inline void JsonValue::Field::Builder::adoptValue( | |
781 ::capnp::Orphan< ::capnp::JsonValue>&& value) { | |
782 ::capnp::_::PointerHelpers< ::capnp::JsonValue>::adopt(_builder.getPointerField( | |
783 ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); | |
784 } | |
785 inline ::capnp::Orphan< ::capnp::JsonValue> JsonValue::Field::Builder::disownValue() { | |
786 return ::capnp::_::PointerHelpers< ::capnp::JsonValue>::disown(_builder.getPointerField( | |
787 ::capnp::bounded<1>() * ::capnp::POINTERS)); | |
788 } | |
789 | |
790 inline bool JsonValue::Call::Reader::hasFunction() const { | |
791 return !_reader.getPointerField( | |
792 ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); | |
793 } | |
794 inline bool JsonValue::Call::Builder::hasFunction() { | |
795 return !_builder.getPointerField( | |
796 ::capnp::bounded<0>() * ::capnp::POINTERS).isNull(); | |
797 } | |
798 inline ::capnp::Text::Reader JsonValue::Call::Reader::getFunction() const { | |
799 return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_reader.getPointerField( | |
800 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
801 } | |
802 inline ::capnp::Text::Builder JsonValue::Call::Builder::getFunction() { | |
803 return ::capnp::_::PointerHelpers< ::capnp::Text>::get(_builder.getPointerField( | |
804 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
805 } | |
806 inline void JsonValue::Call::Builder::setFunction( ::capnp::Text::Reader value) { | |
807 ::capnp::_::PointerHelpers< ::capnp::Text>::set(_builder.getPointerField( | |
808 ::capnp::bounded<0>() * ::capnp::POINTERS), value); | |
809 } | |
810 inline ::capnp::Text::Builder JsonValue::Call::Builder::initFunction(unsigned int size) { | |
811 return ::capnp::_::PointerHelpers< ::capnp::Text>::init(_builder.getPointerField( | |
812 ::capnp::bounded<0>() * ::capnp::POINTERS), size); | |
813 } | |
814 inline void JsonValue::Call::Builder::adoptFunction( | |
815 ::capnp::Orphan< ::capnp::Text>&& value) { | |
816 ::capnp::_::PointerHelpers< ::capnp::Text>::adopt(_builder.getPointerField( | |
817 ::capnp::bounded<0>() * ::capnp::POINTERS), kj::mv(value)); | |
818 } | |
819 inline ::capnp::Orphan< ::capnp::Text> JsonValue::Call::Builder::disownFunction() { | |
820 return ::capnp::_::PointerHelpers< ::capnp::Text>::disown(_builder.getPointerField( | |
821 ::capnp::bounded<0>() * ::capnp::POINTERS)); | |
822 } | |
823 | |
824 inline bool JsonValue::Call::Reader::hasParams() const { | |
825 return !_reader.getPointerField( | |
826 ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); | |
827 } | |
828 inline bool JsonValue::Call::Builder::hasParams() { | |
829 return !_builder.getPointerField( | |
830 ::capnp::bounded<1>() * ::capnp::POINTERS).isNull(); | |
831 } | |
832 inline ::capnp::List< ::capnp::JsonValue>::Reader JsonValue::Call::Reader::getParams() const { | |
833 return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue>>::get(_reader.getPointerField( | |
834 ::capnp::bounded<1>() * ::capnp::POINTERS)); | |
835 } | |
836 inline ::capnp::List< ::capnp::JsonValue>::Builder JsonValue::Call::Builder::getParams() { | |
837 return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue>>::get(_builder.getPointerField( | |
838 ::capnp::bounded<1>() * ::capnp::POINTERS)); | |
839 } | |
840 inline void JsonValue::Call::Builder::setParams( ::capnp::List< ::capnp::JsonValue>::Reader value) { | |
841 ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue>>::set(_builder.getPointerField( | |
842 ::capnp::bounded<1>() * ::capnp::POINTERS), value); | |
843 } | |
844 inline ::capnp::List< ::capnp::JsonValue>::Builder JsonValue::Call::Builder::initParams(unsigned int size) { | |
845 return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue>>::init(_builder.getPointerField( | |
846 ::capnp::bounded<1>() * ::capnp::POINTERS), size); | |
847 } | |
848 inline void JsonValue::Call::Builder::adoptParams( | |
849 ::capnp::Orphan< ::capnp::List< ::capnp::JsonValue>>&& value) { | |
850 ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue>>::adopt(_builder.getPointerField( | |
851 ::capnp::bounded<1>() * ::capnp::POINTERS), kj::mv(value)); | |
852 } | |
853 inline ::capnp::Orphan< ::capnp::List< ::capnp::JsonValue>> JsonValue::Call::Builder::disownParams() { | |
854 return ::capnp::_::PointerHelpers< ::capnp::List< ::capnp::JsonValue>>::disown(_builder.getPointerField( | |
855 ::capnp::bounded<1>() * ::capnp::POINTERS)); | |
856 } | |
857 | |
858 } // namespace | |
859 | |
860 #endif // CAPNP_INCLUDED_8ef99297a43a5e34_ |