1 /* This file was generated by upbc (the upb compiler) from the input
2 * file:
3 *
4 * envoy/type/matcher/v3/path.proto
5 *
6 * Do not edit -- your changes will be discarded when the file is
7 * regenerated. */
8
9 #ifndef ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_
10 #define ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_
11
12 #include "upb/msg.h"
13 #include "upb/decode.h"
14 #include "upb/decode_fast.h"
15 #include "upb/encode.h"
16
17 #include "upb/port_def.inc"
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 struct envoy_type_matcher_v3_PathMatcher;
24 typedef struct envoy_type_matcher_v3_PathMatcher envoy_type_matcher_v3_PathMatcher;
25 extern const upb_msglayout envoy_type_matcher_v3_PathMatcher_msginit;
26 struct envoy_type_matcher_v3_StringMatcher;
27 extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
28
29
30 /* envoy.type.matcher.v3.PathMatcher */
31
envoy_type_matcher_v3_PathMatcher_new(upb_arena * arena)32 UPB_INLINE envoy_type_matcher_v3_PathMatcher *envoy_type_matcher_v3_PathMatcher_new(upb_arena *arena) {
33 return (envoy_type_matcher_v3_PathMatcher *)_upb_msg_new(&envoy_type_matcher_v3_PathMatcher_msginit, arena);
34 }
envoy_type_matcher_v3_PathMatcher_parse(const char * buf,size_t size,upb_arena * arena)35 UPB_INLINE envoy_type_matcher_v3_PathMatcher *envoy_type_matcher_v3_PathMatcher_parse(const char *buf, size_t size,
36 upb_arena *arena) {
37 envoy_type_matcher_v3_PathMatcher *ret = envoy_type_matcher_v3_PathMatcher_new(arena);
38 return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msginit, arena)) ? ret : NULL;
39 }
envoy_type_matcher_v3_PathMatcher_parse_ex(const char * buf,size_t size,upb_arena * arena,int options)40 UPB_INLINE envoy_type_matcher_v3_PathMatcher *envoy_type_matcher_v3_PathMatcher_parse_ex(const char *buf, size_t size,
41 upb_arena *arena, int options) {
42 envoy_type_matcher_v3_PathMatcher *ret = envoy_type_matcher_v3_PathMatcher_new(arena);
43 return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_PathMatcher_msginit, arena, options))
44 ? ret : NULL;
45 }
envoy_type_matcher_v3_PathMatcher_serialize(const envoy_type_matcher_v3_PathMatcher * msg,upb_arena * arena,size_t * len)46 UPB_INLINE char *envoy_type_matcher_v3_PathMatcher_serialize(const envoy_type_matcher_v3_PathMatcher *msg, upb_arena *arena, size_t *len) {
47 return upb_encode(msg, &envoy_type_matcher_v3_PathMatcher_msginit, arena, len);
48 }
49
50 typedef enum {
51 envoy_type_matcher_v3_PathMatcher_rule_path = 1,
52 envoy_type_matcher_v3_PathMatcher_rule_NOT_SET = 0
53 } envoy_type_matcher_v3_PathMatcher_rule_oneofcases;
envoy_type_matcher_v3_PathMatcher_rule_case(const envoy_type_matcher_v3_PathMatcher * msg)54 UPB_INLINE envoy_type_matcher_v3_PathMatcher_rule_oneofcases envoy_type_matcher_v3_PathMatcher_rule_case(const envoy_type_matcher_v3_PathMatcher* msg) { return (envoy_type_matcher_v3_PathMatcher_rule_oneofcases)*UPB_PTR_AT(msg, UPB_SIZE(4, 8), int32_t); }
55
envoy_type_matcher_v3_PathMatcher_has_path(const envoy_type_matcher_v3_PathMatcher * msg)56 UPB_INLINE bool envoy_type_matcher_v3_PathMatcher_has_path(const envoy_type_matcher_v3_PathMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(4, 8)) == 1; }
envoy_type_matcher_v3_PathMatcher_path(const envoy_type_matcher_v3_PathMatcher * msg)57 UPB_INLINE const struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_PathMatcher_path(const envoy_type_matcher_v3_PathMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), UPB_SIZE(4, 8), 1, NULL); }
58
envoy_type_matcher_v3_PathMatcher_set_path(envoy_type_matcher_v3_PathMatcher * msg,struct envoy_type_matcher_v3_StringMatcher * value)59 UPB_INLINE void envoy_type_matcher_v3_PathMatcher_set_path(envoy_type_matcher_v3_PathMatcher *msg, struct envoy_type_matcher_v3_StringMatcher* value) {
60 UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_StringMatcher*, UPB_SIZE(0, 0), value, UPB_SIZE(4, 8), 1);
61 }
envoy_type_matcher_v3_PathMatcher_mutable_path(envoy_type_matcher_v3_PathMatcher * msg,upb_arena * arena)62 UPB_INLINE struct envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_PathMatcher_mutable_path(envoy_type_matcher_v3_PathMatcher *msg, upb_arena *arena) {
63 struct envoy_type_matcher_v3_StringMatcher* sub = (struct envoy_type_matcher_v3_StringMatcher*)envoy_type_matcher_v3_PathMatcher_path(msg);
64 if (sub == NULL) {
65 sub = (struct envoy_type_matcher_v3_StringMatcher*)_upb_msg_new(&envoy_type_matcher_v3_StringMatcher_msginit, arena);
66 if (!sub) return NULL;
67 envoy_type_matcher_v3_PathMatcher_set_path(msg, sub);
68 }
69 return sub;
70 }
71
72 #ifdef __cplusplus
73 } /* extern "C" */
74 #endif
75
76 #include "upb/port_undef.inc"
77
78 #endif /* ENVOY_TYPE_MATCHER_V3_PATH_PROTO_UPB_H_ */
79