9 #ifndef GOOGLE_PROTOBUF_STRUCT_PROTO_UPB_H_ 10 #define GOOGLE_PROTOBUF_STRUCT_PROTO_UPB_H_ 12 #include "upb/generated_util.h" 14 #include "upb/decode.h" 15 #include "upb/encode.h" 17 #include "upb/port_def.inc" 65 bool ok = _upb_array_append_accessor(
66 msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
89 UPB_FIELD_AT(msg, upb_strview, UPB_SIZE(0, 0)) = value;
98 if (!sub)
return NULL;
143 UPB_WRITE_ONEOF(msg, int32_t, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 1);
146 UPB_WRITE_ONEOF(msg,
double, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 2);
149 UPB_WRITE_ONEOF(msg, upb_strview, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 3);
152 UPB_WRITE_ONEOF(msg,
bool, UPB_SIZE(0, 0), value, UPB_SIZE(8, 16), 4);
161 if (!sub)
return NULL;
173 if (!sub)
return NULL;
199 return (
google_protobuf_Value**)_upb_array_resize_accessor(msg, UPB_SIZE(0, 0), len, UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, arena);
203 bool ok = _upb_array_append_accessor(
204 msg, UPB_SIZE(0, 0), UPB_SIZE(4, 8), UPB_TYPE_MESSAGE, &sub, arena);
205 if (!ok)
return NULL;
213 #include "upb/port_undef.inc" UPB_INLINE bool google_protobuf_Value_has_list_value(const google_protobuf_Value *msg)
Definition: struct.upb.h:139
UPB_INLINE bool google_protobuf_Value_has_struct_value(const google_protobuf_Value *msg)
Definition: struct.upb.h:137
Definition: struct.upb.h:123
UPB_INLINE google_protobuf_Value ** google_protobuf_ListValue_mutable_values(google_protobuf_ListValue *msg, size_t *len)
Definition: struct.upb.h:195
UPB_INLINE google_protobuf_Struct_FieldsEntry * google_protobuf_Struct_FieldsEntry_parse(const char *buf, size_t size, upb_arena *arena)
Definition: struct.upb.h:76
UPB_INLINE struct google_protobuf_Value * google_protobuf_ListValue_add_values(google_protobuf_ListValue *msg, upb_arena *arena)
Definition: struct.upb.h:201
UPB_INLINE google_protobuf_Struct_FieldsEntry * google_protobuf_Struct_FieldsEntry_new(upb_arena *arena)
Definition: struct.upb.h:73
UPB_INLINE char * google_protobuf_ListValue_serialize(const google_protobuf_ListValue *msg, upb_arena *arena, size_t *len)
Definition: struct.upb.h:189
UPB_INLINE const google_protobuf_Struct * google_protobuf_Value_struct_value(const google_protobuf_Value *msg)
Definition: struct.upb.h:138
Definition: struct.upb.h:125
UPB_INLINE void google_protobuf_Value_set_number_value(google_protobuf_Value *msg, double value)
Definition: struct.upb.h:145
Definition: struct.upb.h:120
UPB_INLINE void google_protobuf_Value_set_struct_value(google_protobuf_Value *msg, google_protobuf_Struct *value)
Definition: struct.upb.h:154
UPB_INLINE void google_protobuf_Value_set_list_value(google_protobuf_Value *msg, google_protobuf_ListValue *value)
Definition: struct.upb.h:166
struct google_protobuf_Struct google_protobuf_Struct
Definition: struct.upb.h:27
UPB_INLINE bool google_protobuf_Value_has_string_value(const google_protobuf_Value *msg)
Definition: struct.upb.h:133
UPB_INLINE const google_protobuf_Value * google_protobuf_Struct_FieldsEntry_value(const google_protobuf_Struct_FieldsEntry *msg)
Definition: struct.upb.h:86
UPB_INLINE struct google_protobuf_Value * google_protobuf_Struct_FieldsEntry_mutable_value(google_protobuf_Struct_FieldsEntry *msg, upb_arena *arena)
Definition: struct.upb.h:94
UPB_INLINE google_protobuf_Struct * google_protobuf_Struct_parse(const char *buf, size_t size, upb_arena *arena)
Definition: struct.upb.h:46
Definition: struct.upb.h:122
Definition: struct.upb.h:37
UPB_INLINE int32_t google_protobuf_Value_null_value(const google_protobuf_Value *msg)
Definition: struct.upb.h:130
struct google_protobuf_Struct_FieldsEntry google_protobuf_Struct_FieldsEntry
Definition: struct.upb.h:28
struct google_protobuf_ListValue google_protobuf_ListValue
Definition: struct.upb.h:30
UPB_INLINE google_protobuf_ListValue * google_protobuf_ListValue_new(upb_arena *arena)
Definition: struct.upb.h:181
UPB_INLINE const google_protobuf_ListValue * google_protobuf_Value_list_value(const google_protobuf_Value *msg)
Definition: struct.upb.h:140
UPB_INLINE struct google_protobuf_Struct * google_protobuf_Value_mutable_struct_value(google_protobuf_Value *msg, upb_arena *arena)
Definition: struct.upb.h:157
UPB_INLINE bool google_protobuf_Value_bool_value(const google_protobuf_Value *msg)
Definition: struct.upb.h:136
UPB_INLINE void google_protobuf_Struct_FieldsEntry_set_value(google_protobuf_Struct_FieldsEntry *msg, google_protobuf_Value *value)
Definition: struct.upb.h:91
UPB_INLINE google_protobuf_ListValue * google_protobuf_ListValue_parse(const char *buf, size_t size, upb_arena *arena)
Definition: struct.upb.h:184
google_protobuf_NullValue
Definition: struct.upb.h:36
UPB_INLINE char * google_protobuf_Struct_FieldsEntry_serialize(const google_protobuf_Struct_FieldsEntry *msg, upb_arena *arena, size_t *len)
Definition: struct.upb.h:81
UPB_INLINE void google_protobuf_Value_set_string_value(google_protobuf_Value *msg, upb_strview value)
Definition: struct.upb.h:148
UPB_INLINE google_protobuf_Value_kind_oneofcases google_protobuf_Value_kind_case(const google_protobuf_Value *msg)
Definition: struct.upb.h:127
UPB_INLINE google_protobuf_Struct * google_protobuf_Struct_new(upb_arena *arena)
Definition: struct.upb.h:43
UPB_INLINE google_protobuf_Value ** google_protobuf_ListValue_resize_values(google_protobuf_ListValue *msg, size_t len, upb_arena *arena)
Definition: struct.upb.h:198
const upb_msglayout google_protobuf_ListValue_msginit
Definition: struct.upb.c:72
UPB_INLINE bool google_protobuf_Value_has_bool_value(const google_protobuf_Value *msg)
Definition: struct.upb.h:135
const upb_msglayout google_protobuf_Struct_FieldsEntry_msginit
Definition: struct.upb.c:38
UPB_INLINE google_protobuf_Value * google_protobuf_Value_new(upb_arena *arena)
Definition: struct.upb.h:106
UPB_INLINE double google_protobuf_Value_number_value(const google_protobuf_Value *msg)
Definition: struct.upb.h:132
UPB_INLINE bool google_protobuf_Value_has_null_value(const google_protobuf_Value *msg)
Definition: struct.upb.h:129
const upb_msglayout google_protobuf_Value_msginit
Definition: struct.upb.c:58
UPB_INLINE void google_protobuf_Value_set_bool_value(google_protobuf_Value *msg, bool value)
Definition: struct.upb.h:151
Definition: struct.upb.h:124
UPB_INLINE upb_strview google_protobuf_Value_string_value(const google_protobuf_Value *msg)
Definition: struct.upb.h:134
UPB_INLINE struct google_protobuf_ListValue * google_protobuf_Value_mutable_list_value(google_protobuf_Value *msg, upb_arena *arena)
Definition: struct.upb.h:169
google_protobuf_Value_kind_oneofcases
Definition: struct.upb.h:118
Definition: struct.upb.h:119
UPB_INLINE google_protobuf_Struct_FieldsEntry ** google_protobuf_Struct_mutable_fields(google_protobuf_Struct *msg, size_t *len)
Definition: struct.upb.h:57
UPB_INLINE char * google_protobuf_Struct_serialize(const google_protobuf_Struct *msg, upb_arena *arena, size_t *len)
Definition: struct.upb.h:51
struct google_protobuf_Value google_protobuf_Value
Definition: struct.upb.h:29
UPB_INLINE const google_protobuf_Struct_FieldsEntry *const * google_protobuf_Struct_fields(const google_protobuf_Struct *msg, size_t *len)
Definition: struct.upb.h:55
UPB_INLINE void google_protobuf_Value_set_null_value(google_protobuf_Value *msg, int32_t value)
Definition: struct.upb.h:142
UPB_INLINE upb_strview google_protobuf_Struct_FieldsEntry_key(const google_protobuf_Struct_FieldsEntry *msg)
Definition: struct.upb.h:85
UPB_INLINE struct google_protobuf_Struct_FieldsEntry * google_protobuf_Struct_add_fields(google_protobuf_Struct *msg, upb_arena *arena)
Definition: struct.upb.h:63
UPB_INLINE bool google_protobuf_Value_has_number_value(const google_protobuf_Value *msg)
Definition: struct.upb.h:131
UPB_INLINE google_protobuf_Struct_FieldsEntry ** google_protobuf_Struct_resize_fields(google_protobuf_Struct *msg, size_t len, upb_arena *arena)
Definition: struct.upb.h:60
UPB_INLINE const google_protobuf_Value *const * google_protobuf_ListValue_values(const google_protobuf_ListValue *msg, size_t *len)
Definition: struct.upb.h:193
UPB_INLINE void google_protobuf_Struct_FieldsEntry_set_key(google_protobuf_Struct_FieldsEntry *msg, upb_strview value)
Definition: struct.upb.h:88
Definition: struct.upb.h:121
UPB_INLINE char * google_protobuf_Value_serialize(const google_protobuf_Value *msg, upb_arena *arena, size_t *len)
Definition: struct.upb.h:114
UPB_INLINE google_protobuf_Value * google_protobuf_Value_parse(const char *buf, size_t size, upb_arena *arena)
Definition: struct.upb.h:109
const upb_msglayout google_protobuf_Struct_msginit
Definition: struct.upb.c:23