|
|
|
@ -63,7 +63,7 @@ UPB_API_INLINE bool upb_Message_GetBool(const upb_Message* msg, |
|
|
|
|
bool default_val) { |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Bool); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_1Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
bool ret; |
|
|
|
|
_upb_Message_GetField(msg, field, &default_val, &ret); |
|
|
|
|
return ret; |
|
|
|
@ -74,7 +74,7 @@ UPB_API_INLINE bool upb_Message_SetBool(upb_Message* msg, |
|
|
|
|
bool value, upb_Arena* a) { |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Bool); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_1Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
return _upb_Message_SetField(msg, field, &value, a); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -84,7 +84,7 @@ UPB_API_INLINE int32_t upb_Message_GetInt32(const upb_Message* msg, |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Int32 || |
|
|
|
|
upb_MiniTableField_CType(field) == kUpb_CType_Enum); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
int32_t ret; |
|
|
|
|
_upb_Message_GetField(msg, field, &default_val, &ret); |
|
|
|
|
return ret; |
|
|
|
@ -96,7 +96,7 @@ UPB_API_INLINE bool upb_Message_SetInt32(upb_Message* msg, |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Int32 || |
|
|
|
|
upb_MiniTableField_CType(field) == kUpb_CType_Enum); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
return _upb_Message_SetField(msg, field, &value, a); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -105,7 +105,7 @@ UPB_API_INLINE uint32_t upb_Message_GetUInt32(const upb_Message* msg, |
|
|
|
|
uint32_t default_val) { |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_UInt32); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
uint32_t ret; |
|
|
|
|
_upb_Message_GetField(msg, field, &default_val, &ret); |
|
|
|
|
return ret; |
|
|
|
@ -116,7 +116,7 @@ UPB_API_INLINE bool upb_Message_SetUInt32(upb_Message* msg, |
|
|
|
|
uint32_t value, upb_Arena* a) { |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_UInt32); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
return _upb_Message_SetField(msg, field, &value, a); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -125,7 +125,7 @@ UPB_API_INLINE void upb_Message_SetClosedEnum( |
|
|
|
|
const upb_MiniTableField* field, int32_t value) { |
|
|
|
|
UPB_ASSERT(upb_MiniTableField_IsClosedEnum(field)); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSERT(upb_MiniTableEnum_CheckValue( |
|
|
|
|
upb_MiniTable_GetSubEnumTable(msg_mini_table, field), value)); |
|
|
|
|
_upb_Message_SetNonExtensionField(msg, field, &value); |
|
|
|
@ -136,7 +136,7 @@ UPB_API_INLINE int64_t upb_Message_GetInt64(const upb_Message* msg, |
|
|
|
|
uint64_t default_val) { |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Int64); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
int64_t ret; |
|
|
|
|
_upb_Message_GetField(msg, field, &default_val, &ret); |
|
|
|
|
return ret; |
|
|
|
@ -147,7 +147,7 @@ UPB_API_INLINE bool upb_Message_SetInt64(upb_Message* msg, |
|
|
|
|
int64_t value, upb_Arena* a) { |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Int64); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
return _upb_Message_SetField(msg, field, &value, a); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -156,7 +156,7 @@ UPB_API_INLINE uint64_t upb_Message_GetUInt64(const upb_Message* msg, |
|
|
|
|
uint64_t default_val) { |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_UInt64); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
uint64_t ret; |
|
|
|
|
_upb_Message_GetField(msg, field, &default_val, &ret); |
|
|
|
|
return ret; |
|
|
|
@ -167,7 +167,7 @@ UPB_API_INLINE bool upb_Message_SetUInt64(upb_Message* msg, |
|
|
|
|
uint64_t value, upb_Arena* a) { |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_UInt64); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
return _upb_Message_SetField(msg, field, &value, a); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -176,7 +176,7 @@ UPB_API_INLINE float upb_Message_GetFloat(const upb_Message* msg, |
|
|
|
|
float default_val) { |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Float); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
float ret; |
|
|
|
|
_upb_Message_GetField(msg, field, &default_val, &ret); |
|
|
|
|
return ret; |
|
|
|
@ -187,7 +187,7 @@ UPB_API_INLINE bool upb_Message_SetFloat(upb_Message* msg, |
|
|
|
|
float value, upb_Arena* a) { |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Float); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_4Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
return _upb_Message_SetField(msg, field, &value, a); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -196,7 +196,7 @@ UPB_API_INLINE double upb_Message_GetDouble(const upb_Message* msg, |
|
|
|
|
double default_val) { |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Double); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
double ret; |
|
|
|
|
_upb_Message_GetField(msg, field, &default_val, &ret); |
|
|
|
|
return ret; |
|
|
|
@ -207,7 +207,7 @@ UPB_API_INLINE bool upb_Message_SetDouble(upb_Message* msg, |
|
|
|
|
double value, upb_Arena* a) { |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Double); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_8Byte); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
return _upb_Message_SetField(msg, field, &value, a); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -217,7 +217,7 @@ upb_Message_GetString(const upb_Message* msg, const upb_MiniTableField* field, |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_String || |
|
|
|
|
upb_MiniTableField_CType(field) == kUpb_CType_Bytes); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_StringView); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
upb_StringView ret; |
|
|
|
|
_upb_Message_GetField(msg, field, &def_val, &ret); |
|
|
|
|
return ret; |
|
|
|
@ -229,7 +229,7 @@ UPB_API_INLINE bool upb_Message_SetString(upb_Message* msg, |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_String || |
|
|
|
|
upb_MiniTableField_CType(field) == kUpb_CType_Bytes); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == kUpb_FieldRep_StringView); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
return _upb_Message_SetField(msg, field, &value, a); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -239,7 +239,7 @@ UPB_API_INLINE upb_TaggedMessagePtr upb_Message_GetTaggedMessagePtr( |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Message); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == |
|
|
|
|
UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte)); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
upb_TaggedMessagePtr tagged; |
|
|
|
|
_upb_Message_GetNonExtensionField(msg, field, &default_val, &tagged); |
|
|
|
|
return tagged; |
|
|
|
@ -262,7 +262,7 @@ UPB_API_INLINE void _upb_Message_SetTaggedMessagePtr( |
|
|
|
|
UPB_ASSUME(upb_MiniTableField_CType(field) == kUpb_CType_Message); |
|
|
|
|
UPB_ASSUME(_upb_MiniTableField_GetRep(field) == |
|
|
|
|
UPB_SIZE(kUpb_FieldRep_4Byte, kUpb_FieldRep_8Byte)); |
|
|
|
|
UPB_ASSUME(!upb_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSUME(!upb_MiniTableField_IsRepeatedOrMap(field)); |
|
|
|
|
UPB_ASSERT(mini_table->subs[field->UPB_PRIVATE(submsg_index)].submsg); |
|
|
|
|
_upb_Message_SetNonExtensionField(msg, field, &sub_message); |
|
|
|
|
} |
|
|
|
|