diff options
Diffstat (limited to 'src/google/protobuf/descriptor.h')
-rw-r--r-- | src/google/protobuf/descriptor.h | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/src/google/protobuf/descriptor.h b/src/google/protobuf/descriptor.h index e7e8c6af..3ecc0a9c 100644 --- a/src/google/protobuf/descriptor.h +++ b/src/google/protobuf/descriptor.h @@ -127,6 +127,11 @@ namespace descriptor_unittest { class DescriptorTest; } // namespace descriptor_unittest +// Defined in printer.h +namespace io { +class Printer; +} // namespace io + // NB, all indices are zero-based. struct SourceLocation { int start_line; @@ -359,6 +364,9 @@ class LIBPROTOBUF_EXPORT Descriptor { // Allows tests to test CopyTo(proto, true). friend class ::google::protobuf::descriptor_unittest::DescriptorTest; + // Allows access to GetLocationPath for annotations. + friend class ::google::protobuf::io::Printer; + // Fill the json_name field of FieldDescriptorProto. void CopyJsonNameTo(DescriptorProto* proto) const; @@ -644,6 +652,9 @@ class LIBPROTOBUF_EXPORT FieldDescriptor { private: typedef FieldOptions OptionsType; + // Allows access to GetLocationPath for annotations. + friend class ::google::protobuf::io::Printer; + // Fill the json_name field of FieldDescriptorProto. void CopyJsonNameTo(FieldDescriptorProto* proto) const; @@ -756,6 +767,9 @@ class LIBPROTOBUF_EXPORT OneofDescriptor { bool GetSourceLocation(SourceLocation* out_location) const; private: + // Allows access to GetLocationPath for annotations. + friend class ::google::protobuf::io::Printer; + // See Descriptor::DebugString(). void DebugString(int depth, string* contents, const DebugStringOptions& options) const; @@ -846,6 +860,9 @@ class LIBPROTOBUF_EXPORT EnumDescriptor { private: typedef EnumOptions OptionsType; + // Allows access to GetLocationPath for annotations. + friend class ::google::protobuf::io::Printer; + // 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, @@ -942,6 +959,9 @@ class LIBPROTOBUF_EXPORT EnumValueDescriptor { private: typedef EnumValueOptions OptionsType; + // Allows access to GetLocationPath for annotations. + friend class ::google::protobuf::io::Printer; + // See Descriptor::DebugString(). void DebugString(int depth, string *contents, const DebugStringOptions& options) const; @@ -1018,6 +1038,9 @@ class LIBPROTOBUF_EXPORT ServiceDescriptor { private: typedef ServiceOptions OptionsType; + // Allows access to GetLocationPath for annotations. + friend class ::google::protobuf::io::Printer; + // See Descriptor::DebugString(). void DebugString(string *contents, const DebugStringOptions& options) const; @@ -1096,6 +1119,9 @@ class LIBPROTOBUF_EXPORT MethodDescriptor { private: typedef MethodOptions OptionsType; + // Allows access to GetLocationPath for annotations. + friend class ::google::protobuf::io::Printer; + // See Descriptor::DebugString(). void DebugString(int depth, string *contents, const DebugStringOptions& options) const; @@ -1645,7 +1671,7 @@ PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, reserved_range, const Descriptor::ReservedRange*) PROTOBUF_DEFINE_ACCESSOR(Descriptor, reserved_name_count, int) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(Descriptor, MessageOptions); +PROTOBUF_DEFINE_OPTIONS_ACCESSOR(Descriptor, MessageOptions) PROTOBUF_DEFINE_ACCESSOR(Descriptor, is_placeholder, bool) PROTOBUF_DEFINE_STRING_ACCESSOR(FieldDescriptor, name) @@ -1690,7 +1716,7 @@ PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, containing_type, const Descriptor*) PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, value_count, int) PROTOBUF_DEFINE_ARRAY_ACCESSOR(EnumDescriptor, value, const EnumValueDescriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(EnumDescriptor, EnumOptions); +PROTOBUF_DEFINE_OPTIONS_ACCESSOR(EnumDescriptor, EnumOptions) PROTOBUF_DEFINE_ACCESSOR(EnumDescriptor, is_placeholder, bool) PROTOBUF_DEFINE_STRING_ACCESSOR(EnumValueDescriptor, name) @@ -1705,14 +1731,14 @@ PROTOBUF_DEFINE_ACCESSOR(ServiceDescriptor, file, const FileDescriptor*) PROTOBUF_DEFINE_ACCESSOR(ServiceDescriptor, method_count, int) PROTOBUF_DEFINE_ARRAY_ACCESSOR(ServiceDescriptor, method, const MethodDescriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(ServiceDescriptor, ServiceOptions); +PROTOBUF_DEFINE_OPTIONS_ACCESSOR(ServiceDescriptor, ServiceOptions) PROTOBUF_DEFINE_STRING_ACCESSOR(MethodDescriptor, name) PROTOBUF_DEFINE_STRING_ACCESSOR(MethodDescriptor, full_name) PROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, service, const ServiceDescriptor*) PROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, input_type, const Descriptor*) PROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, output_type, const Descriptor*) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(MethodDescriptor, MethodOptions); +PROTOBUF_DEFINE_OPTIONS_ACCESSOR(MethodDescriptor, MethodOptions) PROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, client_streaming, bool) PROTOBUF_DEFINE_ACCESSOR(MethodDescriptor, server_streaming, bool) @@ -1726,7 +1752,7 @@ PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, message_type_count, int) PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, enum_type_count, int) PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, service_count, int) PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, extension_count, int) -PROTOBUF_DEFINE_OPTIONS_ACCESSOR(FileDescriptor, FileOptions); +PROTOBUF_DEFINE_OPTIONS_ACCESSOR(FileDescriptor, FileOptions) PROTOBUF_DEFINE_ACCESSOR(FileDescriptor, is_placeholder, bool) PROTOBUF_DEFINE_ARRAY_ACCESSOR(FileDescriptor, message_type, const Descriptor*) |