From c24d9de3ce2c5604d4e77c19098f57eba1cc6a06 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Wed, 10 Jan 2024 17:29:24 -0800 Subject: [PATCH] Add proto2::VisitFields() API. PiperOrigin-RevId: 597398441 --- src/google/protobuf/extension_set.h | 6 +++++- src/google/protobuf/message.h | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/google/protobuf/extension_set.h b/src/google/protobuf/extension_set.h index 79754ba275..e85370a412 100644 --- a/src/google/protobuf/extension_set.h +++ b/src/google/protobuf/extension_set.h @@ -60,8 +60,10 @@ class Reflection; // message.h class UnknownFieldSet; // unknown_field_set.h class FeatureSet; namespace internal { -class FieldSkipper; // wire_format_lite.h +class FieldSkipper; // wire_format_lite.h +class ReflectionVisit; // message_reflection_util.h class WireFormat; +struct DynamicExtensionInfoHelper; void InitializeLazyExtensionSet(); } // namespace internal } // namespace protobuf @@ -530,6 +532,8 @@ class PROTOBUF_EXPORT ExtensionSet { friend class RepeatedEnumTypeTraits; friend class google::protobuf::Reflection; + friend class google::protobuf::internal::ReflectionVisit; + friend struct google::protobuf::internal::DynamicExtensionInfoHelper; friend class google::protobuf::internal::WireFormat; friend void internal::InitializeLazyExtensionSet(); diff --git a/src/google/protobuf/message.h b/src/google/protobuf/message.h index adfc8d1533..bbcc2da15f 100644 --- a/src/google/protobuf/message.h +++ b/src/google/protobuf/message.h @@ -138,8 +138,11 @@ class TextFormat; namespace internal { struct FuzzPeer; struct DescriptorTable; +template +struct DynamicFieldInfoHelper; class MapFieldBase; class MessageUtil; +class ReflectionVisit; class SwapFieldHelper; class CachedSize; struct TailCallTableInfo; @@ -979,6 +982,7 @@ class PROTOBUF_EXPORT Reflection final { friend class FastReflectionBase; friend class FastReflectionMessageMutator; + friend class internal::ReflectionVisit; friend bool internal::IsDescendant(Message& root, const Message& message); const Descriptor* const descriptor_; @@ -1034,6 +1038,8 @@ class PROTOBUF_EXPORT Reflection final { friend class internal::WireFormat; friend class internal::ReflectionOps; friend class internal::SwapFieldHelper; + template + friend struct internal::DynamicFieldInfoHelper; friend struct internal::FuzzPeer; // Needed for implementing text format for map. friend class internal::MapFieldPrinterHelper;