1 /* This file was generated by upbc (the upb compiler) from the input
4 * envoy/type/matcher/v3/struct.proto
6 * Do not edit -- your changes will be discarded when the file is
9 #ifndef ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_
10 #define ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_
12 #include "upb/msg_internal.h"
13 #include "upb/decode.h"
14 #include "upb/decode_fast.h"
15 #include "upb/encode.h"
17 #include "upb/port_def.inc"
23 struct envoy_type_matcher_v3_StructMatcher;
24 struct envoy_type_matcher_v3_StructMatcher_PathSegment;
25 typedef struct envoy_type_matcher_v3_StructMatcher envoy_type_matcher_v3_StructMatcher;
26 typedef struct envoy_type_matcher_v3_StructMatcher_PathSegment envoy_type_matcher_v3_StructMatcher_PathSegment;
27 extern const upb_msglayout envoy_type_matcher_v3_StructMatcher_msginit;
28 extern const upb_msglayout envoy_type_matcher_v3_StructMatcher_PathSegment_msginit;
29 struct envoy_type_matcher_v3_ValueMatcher;
30 extern const upb_msglayout envoy_type_matcher_v3_ValueMatcher_msginit;
33 /* envoy.type.matcher.v3.StructMatcher */
35 UPB_INLINE envoy_type_matcher_v3_StructMatcher *envoy_type_matcher_v3_StructMatcher_new(upb_arena *arena) {
36 return (envoy_type_matcher_v3_StructMatcher *)_upb_msg_new(&envoy_type_matcher_v3_StructMatcher_msginit, arena);
38 UPB_INLINE envoy_type_matcher_v3_StructMatcher *envoy_type_matcher_v3_StructMatcher_parse(const char *buf, size_t size,
40 envoy_type_matcher_v3_StructMatcher *ret = envoy_type_matcher_v3_StructMatcher_new(arena);
41 if (!ret) return NULL;
42 if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, arena)) return NULL;
45 UPB_INLINE envoy_type_matcher_v3_StructMatcher *envoy_type_matcher_v3_StructMatcher_parse_ex(const char *buf, size_t size,
46 const upb_extreg *extreg, int options,
48 envoy_type_matcher_v3_StructMatcher *ret = envoy_type_matcher_v3_StructMatcher_new(arena);
49 if (!ret) return NULL;
50 if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_msginit, extreg, options, arena)) {
55 UPB_INLINE char *envoy_type_matcher_v3_StructMatcher_serialize(const envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena, size_t *len) {
56 return upb_encode(msg, &envoy_type_matcher_v3_StructMatcher_msginit, arena, len);
59 UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_path(const envoy_type_matcher_v3_StructMatcher *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(8, 16)); }
60 UPB_INLINE const envoy_type_matcher_v3_StructMatcher_PathSegment* const* envoy_type_matcher_v3_StructMatcher_path(const envoy_type_matcher_v3_StructMatcher *msg, size_t *len) { return (const envoy_type_matcher_v3_StructMatcher_PathSegment* const*)_upb_array_accessor(msg, UPB_SIZE(8, 16), len); }
61 UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_has_value(const envoy_type_matcher_v3_StructMatcher *msg) { return _upb_hasbit(msg, 1); }
62 UPB_INLINE const struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_StructMatcher_value(const envoy_type_matcher_v3_StructMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(4, 8), const struct envoy_type_matcher_v3_ValueMatcher*); }
64 UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment** envoy_type_matcher_v3_StructMatcher_mutable_path(envoy_type_matcher_v3_StructMatcher *msg, size_t *len) {
65 return (envoy_type_matcher_v3_StructMatcher_PathSegment**)_upb_array_mutable_accessor(msg, UPB_SIZE(8, 16), len);
67 UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment** envoy_type_matcher_v3_StructMatcher_resize_path(envoy_type_matcher_v3_StructMatcher *msg, size_t len, upb_arena *arena) {
68 return (envoy_type_matcher_v3_StructMatcher_PathSegment**)_upb_array_resize_accessor2(msg, UPB_SIZE(8, 16), len, UPB_SIZE(2, 3), arena);
70 UPB_INLINE struct envoy_type_matcher_v3_StructMatcher_PathSegment* envoy_type_matcher_v3_StructMatcher_add_path(envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena) {
71 struct envoy_type_matcher_v3_StructMatcher_PathSegment* sub = (struct envoy_type_matcher_v3_StructMatcher_PathSegment*)_upb_msg_new(&envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena);
72 bool ok = _upb_array_append_accessor2(
73 msg, UPB_SIZE(8, 16), UPB_SIZE(2, 3), &sub, arena);
77 UPB_INLINE void envoy_type_matcher_v3_StructMatcher_set_value(envoy_type_matcher_v3_StructMatcher *msg, struct envoy_type_matcher_v3_ValueMatcher* value) {
79 *UPB_PTR_AT(msg, UPB_SIZE(4, 8), struct envoy_type_matcher_v3_ValueMatcher*) = value;
81 UPB_INLINE struct envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_StructMatcher_mutable_value(envoy_type_matcher_v3_StructMatcher *msg, upb_arena *arena) {
82 struct envoy_type_matcher_v3_ValueMatcher* sub = (struct envoy_type_matcher_v3_ValueMatcher*)envoy_type_matcher_v3_StructMatcher_value(msg);
84 sub = (struct envoy_type_matcher_v3_ValueMatcher*)_upb_msg_new(&envoy_type_matcher_v3_ValueMatcher_msginit, arena);
85 if (!sub) return NULL;
86 envoy_type_matcher_v3_StructMatcher_set_value(msg, sub);
91 /* envoy.type.matcher.v3.StructMatcher.PathSegment */
93 UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment *envoy_type_matcher_v3_StructMatcher_PathSegment_new(upb_arena *arena) {
94 return (envoy_type_matcher_v3_StructMatcher_PathSegment *)_upb_msg_new(&envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena);
96 UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment *envoy_type_matcher_v3_StructMatcher_PathSegment_parse(const char *buf, size_t size,
98 envoy_type_matcher_v3_StructMatcher_PathSegment *ret = envoy_type_matcher_v3_StructMatcher_PathSegment_new(arena);
99 if (!ret) return NULL;
100 if (!upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena)) return NULL;
103 UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment *envoy_type_matcher_v3_StructMatcher_PathSegment_parse_ex(const char *buf, size_t size,
104 const upb_extreg *extreg, int options,
106 envoy_type_matcher_v3_StructMatcher_PathSegment *ret = envoy_type_matcher_v3_StructMatcher_PathSegment_new(arena);
107 if (!ret) return NULL;
108 if (!_upb_decode(buf, size, ret, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, extreg, options, arena)) {
113 UPB_INLINE char *envoy_type_matcher_v3_StructMatcher_PathSegment_serialize(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg, upb_arena *arena, size_t *len) {
114 return upb_encode(msg, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, arena, len);
118 envoy_type_matcher_v3_StructMatcher_PathSegment_segment_key = 1,
119 envoy_type_matcher_v3_StructMatcher_PathSegment_segment_NOT_SET = 0
120 } envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases;
121 UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases envoy_type_matcher_v3_StructMatcher_PathSegment_segment_case(const envoy_type_matcher_v3_StructMatcher_PathSegment* msg) { return (envoy_type_matcher_v3_StructMatcher_PathSegment_segment_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(8, 16), int32_t); }
123 UPB_INLINE bool envoy_type_matcher_v3_StructMatcher_PathSegment_has_key(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg) { return _upb_getoneofcase(msg, UPB_SIZE(8, 16)) == 1; }
124 UPB_INLINE upb_strview envoy_type_matcher_v3_StructMatcher_PathSegment_key(const envoy_type_matcher_v3_StructMatcher_PathSegment *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), UPB_SIZE(8, 16), 1, upb_strview_make("", strlen(""))); }
126 UPB_INLINE void envoy_type_matcher_v3_StructMatcher_PathSegment_set_key(envoy_type_matcher_v3_StructMatcher_PathSegment *msg, upb_strview value) {
127 UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
134 #include "upb/port_undef.inc"
136 #endif /* ENVOY_TYPE_MATCHER_V3_STRUCT_PROTO_UPB_H_ */