From b4b7403e22b0c470d684dc6d7e41ed26755b66d6 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Mon, 15 May 2023 19:23:53 -0700 Subject: [PATCH] Internal changes PiperOrigin-RevId: 532297611 --- src/google/protobuf/descriptor.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/google/protobuf/descriptor.h b/src/google/protobuf/descriptor.h index 8c61750838..13f661b18b 100644 --- a/src/google/protobuf/descriptor.h +++ b/src/google/protobuf/descriptor.h @@ -257,6 +257,7 @@ class PROTOBUF_EXPORT SymbolBase { template class PROTOBUF_EXPORT SymbolBaseN : public SymbolBase {}; + } // namespace internal // Describes a type of protocol message, or a particular group within a @@ -299,7 +300,6 @@ class PROTOBUF_EXPORT Descriptor : private internal::SymbolBase { // available extensions of that message. const MessageOptions& options() const; - // Write the contents of this Descriptor into the given DescriptorProto. // The target DescriptorProto must be clear before calling this; if it // isn't, the result may be garbage. @@ -446,7 +446,6 @@ class PROTOBUF_EXPORT Descriptor : private internal::SymbolBase { // Returns the ExtensionRangeOptions for this range. const ExtensionRangeOptions& options() const { return *options_; } - // Returns the name of the containing type. const std::string& name() const { return containing_type_->name(); } @@ -471,6 +470,7 @@ class PROTOBUF_EXPORT Descriptor : private internal::SymbolBase { private: const Descriptor* containing_type_; + // Walks up the descriptor tree to generate the source location path // to this descriptor from the file root. void GetLocationPath(std::vector* output) const; @@ -593,6 +593,7 @@ class PROTOBUF_EXPORT Descriptor : private internal::SymbolBase { friend class io::Printer; friend class compiler::cpp::Formatter; + // Fill the json_name field of FieldDescriptorProto. void CopyJsonNameTo(DescriptorProto* proto) const; @@ -914,7 +915,6 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase { // descriptor.proto, and any available extensions of that message. const FieldOptions& options() const; - // See Descriptor::CopyTo(). void CopyTo(FieldDescriptorProto* proto) const; @@ -979,6 +979,7 @@ class PROTOBUF_EXPORT FieldDescriptor : private internal::SymbolBase { private: + // Fill the json_name field of FieldDescriptorProto. void CopyJsonNameTo(FieldDescriptorProto* proto) const; @@ -1111,7 +1112,6 @@ class PROTOBUF_EXPORT OneofDescriptor : private internal::SymbolBase { const OneofOptions& options() const; - // See Descriptor::CopyTo(). void CopyTo(OneofDescriptorProto* proto) const; @@ -1148,6 +1148,7 @@ class PROTOBUF_EXPORT OneofDescriptor : private internal::SymbolBase { private: + // See Descriptor::DebugString(). void DebugString(int depth, std::string* contents, const DebugStringOptions& options) const; @@ -1224,7 +1225,6 @@ class PROTOBUF_EXPORT EnumDescriptor : private internal::SymbolBase { // extensions of that message. const EnumOptions& options() const; - // See Descriptor::CopyTo(). void CopyTo(EnumDescriptorProto* proto) const; @@ -1307,6 +1307,7 @@ class PROTOBUF_EXPORT EnumDescriptor : private internal::SymbolBase { // Allow access to FindValueByNumberCreatingIfUnknown. friend class descriptor_unittest::DescriptorTest; + // Looks up a value by number. If the value does not exist, dynamically // creates a new EnumValueDescriptor for that value, assuming that it was // unknown. If a new descriptor is created, this is done in a thread-safe way, @@ -1409,7 +1410,6 @@ class PROTOBUF_EXPORT EnumValueDescriptor : private internal::SymbolBaseN<0>, // available extensions of that message. const EnumValueOptions& options() const; - // See Descriptor::CopyTo(). void CopyTo(EnumValueDescriptorProto* proto) const; @@ -1434,6 +1434,7 @@ class PROTOBUF_EXPORT EnumValueDescriptor : private internal::SymbolBaseN<0>, friend class io::Printer; friend class compiler::cpp::Formatter; + // See Descriptor::DebugString(). void DebugString(int depth, std::string* contents, const DebugStringOptions& options) const; @@ -1489,7 +1490,6 @@ class PROTOBUF_EXPORT ServiceDescriptor : private internal::SymbolBase { // available extensions of that message. const ServiceOptions& options() const; - // The number of methods this service defines. int method_count() const; // Gets a MethodDescriptor by index, where 0 <= index < method_count(). @@ -1523,6 +1523,7 @@ class PROTOBUF_EXPORT ServiceDescriptor : private internal::SymbolBase { friend class io::Printer; friend class compiler::cpp::Formatter; + // See Descriptor::DebugString(). void DebugString(std::string* contents, const DebugStringOptions& options) const; @@ -1591,7 +1592,6 @@ class PROTOBUF_EXPORT MethodDescriptor : private internal::SymbolBase { // descriptor.proto, and any available extensions of that message. const MethodOptions& options() const; - // See Descriptor::CopyTo(). void CopyTo(MethodDescriptorProto* proto) const; @@ -1616,6 +1616,7 @@ class PROTOBUF_EXPORT MethodDescriptor : private internal::SymbolBase { friend class io::Printer; friend class compiler::cpp::Formatter; + // See Descriptor::DebugString(). void DebugString(int depth, std::string* contents, const DebugStringOptions& options) const; @@ -1723,7 +1724,6 @@ class PROTOBUF_EXPORT FileDescriptor : private internal::SymbolBase { const FileOptions& options() const; - private: // With the upcoming release of editions, syntax should not be used for // business logic. Instead, the various feature helpers defined in this file @@ -1840,6 +1840,7 @@ class PROTOBUF_EXPORT FileDescriptor : private internal::SymbolBase { const std::string* package_; const DescriptorPool* pool_; + // dependencies_once_ contain a once_flag followed by N NUL terminated // strings. Dependencies that do not need to be loaded will be empty. ie just // {'\0'}