Auto-generate files after cl/622260327

pull/16431/head
Protobuf Team Bot 10 months ago
parent 29c69ff00b
commit 8ce5c9f382
  1. 34
      php/ext/google/protobuf/php-upb.c
  2. 1
      php/ext/google/protobuf/php-upb.h
  3. 34
      ruby/ext/google/protobuf_c/ruby-upb.c
  4. 1
      ruby/ext/google/protobuf_c/ruby-upb.h

@ -13715,6 +13715,40 @@ bool _upb_FieldDef_ValidateUtf8(const upb_FieldDef* f) {
UPB_DESC(FeatureSet_VERIFY);
}
bool _upb_FieldDef_IsGroupLike(const upb_FieldDef* f) {
// Groups are always tag-delimited.
if (UPB_DESC(FeatureSet_message_encoding)(upb_FieldDef_ResolvedFeatures(f)) !=
UPB_DESC(FeatureSet_DELIMITED)) {
return false;
}
const upb_MessageDef* msg = upb_FieldDef_MessageSubDef(f);
// Group fields always are always the lowercase type name.
const char* mname = upb_MessageDef_Name(msg);
const char* fname = upb_FieldDef_Name(f);
size_t name_size = strlen(fname);
if (name_size != strlen(mname)) return false;
for (size_t i = 0; i < name_size; ++i) {
if ((mname[i] | 0x20) != fname[i]) {
// Case-insensitive ascii comparison.
return false;
}
}
if (upb_MessageDef_File(msg) != upb_FieldDef_File(f)) {
return false;
}
// Group messages are always defined in the same scope as the field. File
// level extensions will compare NULL == NULL here, which is why the file
// comparison above is necessary to ensure both come from the same file.
return upb_FieldDef_IsExtension(f) ? upb_FieldDef_ExtensionScope(f) ==
upb_MessageDef_ContainingType(msg)
: upb_FieldDef_ContainingType(f) ==
upb_MessageDef_ContainingType(msg);
}
uint64_t _upb_FieldDef_Modifiers(const upb_FieldDef* f) {
uint64_t out = upb_FieldDef_IsPacked(f) ? kUpb_FieldModifier_IsPacked : 0;

@ -11484,6 +11484,7 @@ UPB_API upb_Label upb_FieldDef_Label(const upb_FieldDef* f);
uint32_t upb_FieldDef_LayoutIndex(const upb_FieldDef* f);
UPB_API const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f);
bool _upb_FieldDef_ValidateUtf8(const upb_FieldDef* f);
bool _upb_FieldDef_IsGroupLike(const upb_FieldDef* f);
// Creates a mini descriptor string for a field, returns true on success.
bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a,

@ -13208,6 +13208,40 @@ bool _upb_FieldDef_ValidateUtf8(const upb_FieldDef* f) {
UPB_DESC(FeatureSet_VERIFY);
}
bool _upb_FieldDef_IsGroupLike(const upb_FieldDef* f) {
// Groups are always tag-delimited.
if (UPB_DESC(FeatureSet_message_encoding)(upb_FieldDef_ResolvedFeatures(f)) !=
UPB_DESC(FeatureSet_DELIMITED)) {
return false;
}
const upb_MessageDef* msg = upb_FieldDef_MessageSubDef(f);
// Group fields always are always the lowercase type name.
const char* mname = upb_MessageDef_Name(msg);
const char* fname = upb_FieldDef_Name(f);
size_t name_size = strlen(fname);
if (name_size != strlen(mname)) return false;
for (size_t i = 0; i < name_size; ++i) {
if ((mname[i] | 0x20) != fname[i]) {
// Case-insensitive ascii comparison.
return false;
}
}
if (upb_MessageDef_File(msg) != upb_FieldDef_File(f)) {
return false;
}
// Group messages are always defined in the same scope as the field. File
// level extensions will compare NULL == NULL here, which is why the file
// comparison above is necessary to ensure both come from the same file.
return upb_FieldDef_IsExtension(f) ? upb_FieldDef_ExtensionScope(f) ==
upb_MessageDef_ContainingType(msg)
: upb_FieldDef_ContainingType(f) ==
upb_MessageDef_ContainingType(msg);
}
uint64_t _upb_FieldDef_Modifiers(const upb_FieldDef* f) {
uint64_t out = upb_FieldDef_IsPacked(f) ? kUpb_FieldModifier_IsPacked : 0;

@ -11886,6 +11886,7 @@ UPB_API upb_Label upb_FieldDef_Label(const upb_FieldDef* f);
uint32_t upb_FieldDef_LayoutIndex(const upb_FieldDef* f);
UPB_API const upb_MessageDef* upb_FieldDef_MessageSubDef(const upb_FieldDef* f);
bool _upb_FieldDef_ValidateUtf8(const upb_FieldDef* f);
bool _upb_FieldDef_IsGroupLike(const upb_FieldDef* f);
// Creates a mini descriptor string for a field, returns true on success.
bool upb_FieldDef_MiniDescriptorEncode(const upb_FieldDef* f, upb_Arena* a,

Loading…
Cancel
Save