GRPC Core  18.0.0
string.upb.h
Go to the documentation of this file.
1 /* This file was generated by upbc (the upb compiler) from the input
2  * file:
3  *
4  * envoy/type/matcher/v3/string.proto
5  *
6  * Do not edit -- your changes will be discarded when the file is
7  * regenerated. */
8 
9 #ifndef ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_
10 #define ENVOY_TYPE_MATCHER_V3_STRING_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 
27 extern const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit;
28 extern const upb_msglayout envoy_type_matcher_v3_ListStringMatcher_msginit;
30 extern const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit;
31 
32 
33 /* envoy.type.matcher.v3.StringMatcher */
34 
37 }
39  upb_arena *arena) {
41  return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msginit, arena)) ? ret : NULL;
42 }
44  upb_arena *arena, int options) {
46  return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_StringMatcher_msginit, arena, options))
47  ? ret : NULL;
48 }
49 UPB_INLINE char *envoy_type_matcher_v3_StringMatcher_serialize(const envoy_type_matcher_v3_StringMatcher *msg, upb_arena *arena, size_t *len) {
50  return upb_encode(msg, &envoy_type_matcher_v3_StringMatcher_msginit, arena, len);
51 }
52 
53 typedef enum {
62 
63 UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_exact(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 1; }
64 UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_exact(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 1, upb_strview_make("", strlen(""))); }
65 UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_prefix(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 2; }
66 UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_prefix(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 2, upb_strview_make("", strlen(""))); }
67 UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_suffix(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 3; }
68 UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_suffix(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 3, upb_strview_make("", strlen(""))); }
69 UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_safe_regex(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 5; }
70 UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_StringMatcher_safe_regex(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, const struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 5, NULL); }
71 UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_ignore_case(const envoy_type_matcher_v3_StringMatcher *msg) { return *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool); }
72 UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_contains(const envoy_type_matcher_v3_StringMatcher *msg) { return _upb_getoneofcase(msg, UPB_SIZE(12, 24)) == 7; }
73 UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_contains(const envoy_type_matcher_v3_StringMatcher *msg) { return UPB_READ_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), UPB_SIZE(12, 24), 7, upb_strview_make("", strlen(""))); }
74 
76  UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 1);
77 }
79  UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 2);
80 }
82  UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 3);
83 }
85  UPB_WRITE_ONEOF(msg, struct envoy_type_matcher_v3_RegexMatcher*, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 5);
86 }
89  if (sub == NULL) {
91  if (!sub) return NULL;
93  }
94  return sub;
95 }
97  *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = value;
98 }
100  UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(4, 8), value, UPB_SIZE(12, 24), 7);
101 }
102 
103 /* envoy.type.matcher.v3.ListStringMatcher */
104 
107 }
109  upb_arena *arena) {
111  return (ret && upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msginit, arena)) ? ret : NULL;
112 }
114  upb_arena *arena, int options) {
116  return (ret && _upb_decode(buf, size, ret, &envoy_type_matcher_v3_ListStringMatcher_msginit, arena, options))
117  ? ret : NULL;
118 }
120  return upb_encode(msg, &envoy_type_matcher_v3_ListStringMatcher_msginit, arena, len);
121 }
122 
123 UPB_INLINE bool envoy_type_matcher_v3_ListStringMatcher_has_patterns(const envoy_type_matcher_v3_ListStringMatcher *msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); }
124 UPB_INLINE const envoy_type_matcher_v3_StringMatcher* const* envoy_type_matcher_v3_ListStringMatcher_patterns(const envoy_type_matcher_v3_ListStringMatcher *msg, size_t *len) { return (const envoy_type_matcher_v3_StringMatcher* const*)_upb_array_accessor(msg, UPB_SIZE(0, 0), len); }
125 
127  return (envoy_type_matcher_v3_StringMatcher**)_upb_array_mutable_accessor(msg, UPB_SIZE(0, 0), len);
128 }
130  return (envoy_type_matcher_v3_StringMatcher**)_upb_array_resize_accessor2(msg, UPB_SIZE(0, 0), len, UPB_SIZE(2, 3), arena);
131 }
134  bool ok = _upb_array_append_accessor2(
135  msg, UPB_SIZE(0, 0), UPB_SIZE(2, 3), &sub, arena);
136  if (!ok) return NULL;
137  return sub;
138 }
139 
140 #ifdef __cplusplus
141 } /* extern "C" */
142 #endif
143 
144 #include "upb/port_undef.inc"
145 
146 #endif /* ENVOY_TYPE_MATCHER_V3_STRING_PROTO_UPB_H_ */
struct envoy_type_matcher_v3_RegexMatcher envoy_type_matcher_v3_RegexMatcher
Definition: regex.upb.h:26
const upb_msglayout envoy_type_matcher_v3_ListStringMatcher_msginit
Definition: string.upb.c:46
UPB_INLINE char * envoy_type_matcher_v3_ListStringMatcher_serialize(const envoy_type_matcher_v3_ListStringMatcher *msg, upb_arena *arena, size_t *len)
Definition: string.upb.h:119
UPB_INLINE envoy_type_matcher_v3_ListStringMatcher * envoy_type_matcher_v3_ListStringMatcher_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: string.upb.h:113
UPB_INLINE envoy_type_matcher_v3_ListStringMatcher * envoy_type_matcher_v3_ListStringMatcher_parse(const char *buf, size_t size, upb_arena *arena)
Definition: string.upb.h:108
const upb_msglayout envoy_type_matcher_v3_StringMatcher_msginit
Definition: string.upb.c:32
UPB_INLINE envoy_type_matcher_v3_ListStringMatcher * envoy_type_matcher_v3_ListStringMatcher_new(upb_arena *arena)
Definition: string.upb.h:105
UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_contains(const envoy_type_matcher_v3_StringMatcher *msg)
Definition: string.upb.h:72
UPB_INLINE envoy_type_matcher_v3_StringMatcher * envoy_type_matcher_v3_StringMatcher_new(upb_arena *arena)
Definition: string.upb.h:35
UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_prefix(const envoy_type_matcher_v3_StringMatcher *msg)
Definition: string.upb.h:65
UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_prefix(const envoy_type_matcher_v3_StringMatcher *msg)
Definition: string.upb.h:66
UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_suffix(const envoy_type_matcher_v3_StringMatcher *msg)
Definition: string.upb.h:68
UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_contains(envoy_type_matcher_v3_StringMatcher *msg, upb_strview value)
Definition: string.upb.h:99
UPB_INLINE bool envoy_type_matcher_v3_ListStringMatcher_has_patterns(const envoy_type_matcher_v3_ListStringMatcher *msg)
Definition: string.upb.h:123
UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_exact(const envoy_type_matcher_v3_StringMatcher *msg)
Definition: string.upb.h:63
UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_suffix(envoy_type_matcher_v3_StringMatcher *msg, upb_strview value)
Definition: string.upb.h:81
UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_ignore_case(const envoy_type_matcher_v3_StringMatcher *msg)
Definition: string.upb.h:71
UPB_INLINE envoy_type_matcher_v3_StringMatcher * envoy_type_matcher_v3_StringMatcher_parse_ex(const char *buf, size_t size, upb_arena *arena, int options)
Definition: string.upb.h:43
struct envoy_type_matcher_v3_ListStringMatcher envoy_type_matcher_v3_ListStringMatcher
Definition: string.upb.h:26
UPB_INLINE envoy_type_matcher_v3_StringMatcher * envoy_type_matcher_v3_StringMatcher_parse(const char *buf, size_t size, upb_arena *arena)
Definition: string.upb.h:38
UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_exact(const envoy_type_matcher_v3_StringMatcher *msg)
Definition: string.upb.h:64
UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_suffix(const envoy_type_matcher_v3_StringMatcher *msg)
Definition: string.upb.h:67
UPB_INLINE upb_strview envoy_type_matcher_v3_StringMatcher_contains(const envoy_type_matcher_v3_StringMatcher *msg)
Definition: string.upb.h:73
UPB_INLINE struct envoy_type_matcher_v3_StringMatcher * envoy_type_matcher_v3_ListStringMatcher_add_patterns(envoy_type_matcher_v3_ListStringMatcher *msg, upb_arena *arena)
Definition: string.upb.h:132
envoy_type_matcher_v3_StringMatcher_match_pattern_oneofcases
Definition: string.upb.h:53
@ envoy_type_matcher_v3_StringMatcher_match_pattern_contains
Definition: string.upb.h:58
@ envoy_type_matcher_v3_StringMatcher_match_pattern_prefix
Definition: string.upb.h:55
@ envoy_type_matcher_v3_StringMatcher_match_pattern_suffix
Definition: string.upb.h:56
@ envoy_type_matcher_v3_StringMatcher_match_pattern_safe_regex
Definition: string.upb.h:57
@ envoy_type_matcher_v3_StringMatcher_match_pattern_exact
Definition: string.upb.h:54
@ envoy_type_matcher_v3_StringMatcher_match_pattern_NOT_SET
Definition: string.upb.h:59
UPB_INLINE struct envoy_type_matcher_v3_RegexMatcher * envoy_type_matcher_v3_StringMatcher_mutable_safe_regex(envoy_type_matcher_v3_StringMatcher *msg, upb_arena *arena)
Definition: string.upb.h:87
UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_safe_regex(envoy_type_matcher_v3_StringMatcher *msg, struct envoy_type_matcher_v3_RegexMatcher *value)
Definition: string.upb.h:84
UPB_INLINE const struct envoy_type_matcher_v3_RegexMatcher * envoy_type_matcher_v3_StringMatcher_safe_regex(const envoy_type_matcher_v3_StringMatcher *msg)
Definition: string.upb.h:70
UPB_INLINE envoy_type_matcher_v3_StringMatcher ** envoy_type_matcher_v3_ListStringMatcher_resize_patterns(envoy_type_matcher_v3_ListStringMatcher *msg, size_t len, upb_arena *arena)
Definition: string.upb.h:129
UPB_INLINE const envoy_type_matcher_v3_StringMatcher *const * envoy_type_matcher_v3_ListStringMatcher_patterns(const envoy_type_matcher_v3_ListStringMatcher *msg, size_t *len)
Definition: string.upb.h:124
UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_ignore_case(envoy_type_matcher_v3_StringMatcher *msg, bool value)
Definition: string.upb.h:96
UPB_INLINE bool envoy_type_matcher_v3_StringMatcher_has_safe_regex(const envoy_type_matcher_v3_StringMatcher *msg)
Definition: string.upb.h:69
UPB_INLINE envoy_type_matcher_v3_StringMatcher_match_pattern_oneofcases envoy_type_matcher_v3_StringMatcher_match_pattern_case(const envoy_type_matcher_v3_StringMatcher *msg)
Definition: string.upb.h:61
UPB_INLINE char * envoy_type_matcher_v3_StringMatcher_serialize(const envoy_type_matcher_v3_StringMatcher *msg, upb_arena *arena, size_t *len)
Definition: string.upb.h:49
UPB_INLINE envoy_type_matcher_v3_StringMatcher ** envoy_type_matcher_v3_ListStringMatcher_mutable_patterns(envoy_type_matcher_v3_ListStringMatcher *msg, size_t *len)
Definition: string.upb.h:126
UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_exact(envoy_type_matcher_v3_StringMatcher *msg, upb_strview value)
Definition: string.upb.h:75
const upb_msglayout envoy_type_matcher_v3_RegexMatcher_msginit
Definition: regex.upb.c:28
UPB_INLINE void envoy_type_matcher_v3_StringMatcher_set_prefix(envoy_type_matcher_v3_StringMatcher *msg, upb_strview value)
Definition: string.upb.h:78
struct envoy_type_matcher_v3_StringMatcher envoy_type_matcher_v3_StringMatcher
Definition: string.upb.h:25
upb_arena * arena
Definition: xds_api.cc:909