diff --git a/csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs b/csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs new file mode 100644 index 0000000000..208ce1fcb6 --- /dev/null +++ b/csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs @@ -0,0 +1,17 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd +#endregion + +namespace Google.Protobuf.Reflection; + +internal sealed partial class FeatureSetDescriptor +{ + // Canonical serialized form of the edition defaults, generated by embed_edition_defaults. + private const string DefaultsBase64 = + "ChMYhAciACoMCAEQAhgCIAMoATACChMY5wciACoMCAIQARgBIAIoATABChMY6AciDAgBEAEYASACKAEwASoAIOYHKOgH"; +} diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h index 2ca5c00175..07c00b5b66 100644 --- a/php/ext/google/protobuf/php-upb.h +++ b/php/ext/google/protobuf/php-upb.h @@ -4167,6 +4167,18 @@ UPB_API_INLINE uint64_t upb_Message_GetExtensionUInt64( return ret; } +UPB_API_INLINE upb_StringView upb_Message_GetExtensionString( + const struct upb_Message* msg, const upb_MiniTableExtension* e, + upb_StringView default_val) { + UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_String || + upb_MiniTableExtension_CType(e) == kUpb_CType_Bytes); + UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) == + kUpb_FieldRep_StringView); + upb_StringView ret; + _upb_Message_GetExtensionField(msg, e, &default_val, &ret); + return ret; +} + UPB_API_INLINE struct upb_Message* upb_Message_GetExtensionMessage( const struct upb_Message* msg, const upb_MiniTableExtension* e, struct upb_Message* default_val) { @@ -4533,7 +4545,6 @@ UPB_API_INLINE void upb_Message_SetBaseFieldUInt64(struct upb_Message* msg, uint64_t value); // Extension Getters /////////////////////////////////////////////////////////// -// TODO: b/374976899 - Add support for non scalars UPB_API_INLINE bool upb_Message_GetExtensionBool( const upb_Message* msg, const upb_MiniTableExtension* f, bool default_val); @@ -4560,6 +4571,10 @@ UPB_API_INLINE uint64_t upb_Message_GetExtensionUInt64( const upb_Message* msg, const upb_MiniTableExtension* f, uint64_t default_val); +UPB_API_INLINE upb_StringView upb_Message_GetExtensionString( + const upb_Message* msg, const upb_MiniTableExtension* f, + upb_StringView default_val); + UPB_API_INLINE upb_Message* upb_Message_GetExtensionMessage( const upb_Message* msg, const upb_MiniTableExtension* f, struct upb_Message* default_val); diff --git a/ruby/ext/google/protobuf_c/ruby-upb.h b/ruby/ext/google/protobuf_c/ruby-upb.h index 08be54f936..f80e37486d 100755 --- a/ruby/ext/google/protobuf_c/ruby-upb.h +++ b/ruby/ext/google/protobuf_c/ruby-upb.h @@ -4169,6 +4169,18 @@ UPB_API_INLINE uint64_t upb_Message_GetExtensionUInt64( return ret; } +UPB_API_INLINE upb_StringView upb_Message_GetExtensionString( + const struct upb_Message* msg, const upb_MiniTableExtension* e, + upb_StringView default_val) { + UPB_ASSUME(upb_MiniTableExtension_CType(e) == kUpb_CType_String || + upb_MiniTableExtension_CType(e) == kUpb_CType_Bytes); + UPB_ASSUME(UPB_PRIVATE(_upb_MiniTableExtension_GetRep)(e) == + kUpb_FieldRep_StringView); + upb_StringView ret; + _upb_Message_GetExtensionField(msg, e, &default_val, &ret); + return ret; +} + UPB_API_INLINE struct upb_Message* upb_Message_GetExtensionMessage( const struct upb_Message* msg, const upb_MiniTableExtension* e, struct upb_Message* default_val) { @@ -4535,7 +4547,6 @@ UPB_API_INLINE void upb_Message_SetBaseFieldUInt64(struct upb_Message* msg, uint64_t value); // Extension Getters /////////////////////////////////////////////////////////// -// TODO: b/374976899 - Add support for non scalars UPB_API_INLINE bool upb_Message_GetExtensionBool( const upb_Message* msg, const upb_MiniTableExtension* f, bool default_val); @@ -4562,6 +4573,10 @@ UPB_API_INLINE uint64_t upb_Message_GetExtensionUInt64( const upb_Message* msg, const upb_MiniTableExtension* f, uint64_t default_val); +UPB_API_INLINE upb_StringView upb_Message_GetExtensionString( + const upb_Message* msg, const upb_MiniTableExtension* f, + upb_StringView default_val); + UPB_API_INLINE upb_Message* upb_Message_GetExtensionMessage( const upb_Message* msg, const upb_MiniTableExtension* f, struct upb_Message* default_val);