Go to the documentation of this file.
54 #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_H__
55 #define GOOGLE_PROTOBUF_DESCRIPTOR_H__
65 #include <google/protobuf/port_def.inc>
73 #define PROTOBUF_EXPORT
86 class ServiceDescriptor;
87 class MethodDescriptor;
89 class DescriptorDatabase;
119 class DescriptorBuilder;
120 class FileDescriptorTables;
128 class CommandLineInterface;
135 namespace descriptor_unittest {
278 bool is_placeholder()
const;
283 int field_count()
const;
308 int oneof_decl_count()
const;
319 int nested_type_count()
const;
331 int enum_type_count()
const;
363 int extension_range_count()
const;
370 bool IsExtensionNumber(
int number)
const;
377 int extension_count()
const;
405 int reserved_range_count()
const;
412 bool IsReservedNumber(
int number)
const;
418 int reserved_name_count()
const;
452 bool include_opening_clause)
const;
456 void GetLocationPath(std::vector<int>*
output)
const;
563 CPPTYPE_MESSAGE = 10,
581 static const int kMaxNumber = (1 << 29) - 1;
585 static const int kFirstReservedNumber = 19000;
588 static const int kLastReservedNumber = 19999;
594 bool is_extension()
const;
617 const char* type_name()
const;
619 const char* cpp_type_name()
const;
622 bool is_required()
const;
623 bool is_optional()
const;
624 bool is_repeated()
const;
625 bool is_packable()
const;
627 bool is_packed()
const;
637 bool has_default_value()
const;
641 bool has_json_name()
const;
645 int32 default_value_int32()
const;
648 int64 default_value_int64()
const;
651 uint32 default_value_uint32()
const;
654 uint64 default_value_uint64()
const;
657 float default_value_float()
const;
660 double default_value_double()
const;
663 bool default_value_bool()
const;
682 int index_in_oneof()
const;
739 const std::string& PrintableNameForExtension()
const;
760 void DebugString(
int depth, PrintLabelFlag print_label_flag,
767 std::string DefaultValueAsString(
bool quote_string_type)
const;
774 void GetLocationPath(std::vector<int>*
output)
const;
777 bool is_map_message_type()
const;
789 void InternalTypeOnceInit()
const;
824 static const CppType kTypeToCppTypeMap[MAX_TYPE + 1];
826 static const char*
const kTypeToName[MAX_TYPE + 1];
828 static const char*
const kCppTypeToName[MAX_CPPTYPE + 1];
830 static const char*
const kLabelToName[MAX_LABEL + 1];
859 int field_count()
const;
895 void GetLocationPath(std::vector<int>*
output)
const;
936 int value_count()
const;
969 bool is_placeholder()
const;
980 int reserved_range_count()
const;
987 bool IsReservedNumber(
int number)
const;
990 const EnumDescriptor::ReservedRange* FindReservedRangeContainingNumber(
994 int reserved_name_count()
const;
1033 void GetLocationPath(std::vector<int>*
output)
const;
1130 void GetLocationPath(std::vector<int>*
output)
const;
1173 int method_count()
const;
1209 void GetLocationPath(std::vector<int>*
output)
const;
1256 bool client_streaming()
const;
1258 bool server_streaming()
const;
1295 void GetLocationPath(std::vector<int>*
output)
const;
1336 int dependency_count()
const;
1343 int public_dependency_count()
const;
1351 int weak_dependency_count()
const;
1359 int message_type_count()
const;
1366 int enum_type_count()
const;
1372 int service_count()
const;
1379 int extension_count()
const;
1397 static const char* SyntaxName(
Syntax syntax);
1441 bool is_placeholder()
const;
1452 bool GetSourceLocation(
const std::vector<int>&
path,
1463 void InternalDependenciesOnceInit()
const;
1623 std::vector<const FieldDescriptor*>* out)
const;
1654 virtual void AddError(
1742 static void InternalAddGeneratedFile(
const void* encoded_file_descriptor,
1758 void InternalDontEnforceDependencies();
1769 lazily_build_dependencies_ =
true;
1772 InternalDontEnforceDependencies();
1777 underlay_ = underlay;
1783 bool InternalIsFileLoaded(
const std::string& filename)
const;
1787 void AddUnusedImportTrackFile(
const std::string& file_name);
1788 void ClearUnusedImportTrackFiles();
1798 friend class StreamDescriptor;
1813 bool TryFindExtensionInFallbackDatabase(
const Descriptor* containing_type,
1814 int field_number)
const;
1828 bool expecting_enum)
const;
1838 PLACEHOLDER_EXTENDABLE_MESSAGE
1842 PlaceholderType placeholder_type)
const;
1844 PlaceholderType placeholder_type)
const;
1858 std::unique_ptr<Tables>
tables_;
1874 #define PROTOBUF_DEFINE_ACCESSOR(CLASS, FIELD, TYPE) \
1875 inline TYPE CLASS::FIELD() const { return FIELD##_; }
1878 #define PROTOBUF_DEFINE_STRING_ACCESSOR(CLASS, FIELD) \
1879 inline const std::string& CLASS::FIELD() const { return *FIELD##_; }
1882 #define PROTOBUF_DEFINE_ARRAY_ACCESSOR(CLASS, FIELD, TYPE) \
1883 inline TYPE CLASS::FIELD(int index) const { return FIELD##s_ + index; }
1885 #define PROTOBUF_DEFINE_OPTIONS_ACCESSOR(CLASS, TYPE) \
1886 inline const TYPE& CLASS::options() const { return *options_; }
1906 const Descriptor::ExtensionRange*)
2004 #undef PROTOBUF_DEFINE_ACCESSOR
2005 #undef PROTOBUF_DEFINE_STRING_ACCESSOR
2006 #undef PROTOBUF_DEFINE_ARRAY_ACCESSOR
2186 #include <google/protobuf/port_undef.inc>
2188 #endif // GOOGLE_PROTOBUF_DESCRIPTOR_H__
ServiceDescriptorProto Proto
bool is_unqualified_placeholder_
const FieldOptions * options_
PyObject * FindEnumTypeByName(PyDescriptorPool *self, PyObject *arg)
const std::string * full_name_
const std::string * name_
const std::string * name_
GLuint const GLchar * name
const FileDescriptor ** dependencies_
PyObject * FindOneofByName(PyDescriptorPool *self, PyObject *arg)
const EnumDescriptor * type() const
const Descriptor::ReservedRange value
const Descriptor * containing_type_
const std::string & reserved_name(int index) const
const OneofDescriptor * containing_oneof_
const FileDescriptor * file_
static const char *const kCppTypeToName[MAX_CPPTYPE+1]
#define GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeName)
bool IsExtensionNumber(int number) const
const EnumDescriptor * enum_type_
ServiceDescriptor * services_
const Descriptor::ReservedRange const EnumValueDescriptor const MethodDescriptor extension
ServiceOptions OptionsType
static PyObject * FindFileByName(PyObject *self, PyObject *arg)
const std::string * lowercase_name_
const std::string * full_name_
const MessageOptions * options_
zend_class_entry * field_type
const FileDescriptorTables * tables_
bool IsReservedNumber(int number) const
EnumValueDescriptor * values_
PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor, extension_range, const Descriptor::ExtensionRange *) PROTOBUF_DEFINE_ARRAY_ACCESSOR(Descriptor
const FileDescriptor * file_
GLuint GLsizei const GLchar * label
const char * type_name() const
void call_once(Args &&... args)
FieldDescriptor * extensions_
const Descriptor * containing_type() const
MethodDescriptorProto Proto
MethodDescriptor * methods_
DescriptorProto_ExtensionRange Proto
const FileDescriptor * file() const
internal::WrappedMutex * mutex_
ExtensionRange * extension_ranges_
void internal_set_underlay(const DescriptorPool *underlay)
const FileDescriptor * file() const
GLsizei const GLchar *const * string
const FieldDescriptor ** fields_
const ServiceOptions * options_
const std::string * default_value_enum_name_
const std::string ** reserved_names_
void EnforceWeakDependencies(bool enforce)
const OneofOptions * options_
const DescriptorPool * pool_
zend_class_entry * enum_type
std::string trailing_comments
const EnumValueDescriptor * default_value_enum_
MessageOptions OptionsType
const std::string * name_
const std::string * full_name_
ExtensionRangeOptions OptionsType
const std::string * full_name_
int extension_range_count_
void InternalSetLazilyBuildDependencies()
static PyObject * FindServiceByName(PyObject *self, PyObject *arg)
Descriptor * nested_types_
const FieldDescriptor * field(int index) const
int * public_dependencies_
int64 default_value_int64_
const Descriptor * descriptor_
std::string leading_comments
const std::string ** dependencies_names_
const ExtensionRangeOptions * options_
const SourceCodeInfo * source_code_info_
EnumValueOptions OptionsType
zend_class_entry * message_type
static PyObject * FindFileContainingSymbol(PyObject *self, PyObject *arg)
internal::once_flag * once_
static PyObject * FindExtensionByNumber(PyObject *self, PyObject *args)
const char * cpp_type_name() const
const std::string * full_name_
EnumDescriptorProto Proto
static PyObject * FindMethodByName(PyBaseDescriptor *self, PyObject *arg)
FieldDescriptor * fields_
const std::string * name_
internal::once_flag * type_once_
EnumDescriptor * enum_types_
const std::string * default_value_string_
EnumDescriptor * enum_types_
const FileDescriptor * file_
const EnumDescriptor * type_
const Descriptor * containing_type_
static void TypeOnceInit(const FieldDescriptor *to_init)
const EnumDescriptor::ReservedRange * FindReservedRangeContainingNumber(int number) const
uint64 default_value_uint64_
static const char * TypeName(Type type)
PyObject * FindFieldByName(PyDescriptorPool *self, PyObject *arg)
GLsizei const GLchar ** path
PyObject * FindExtensionByName(PyDescriptorPool *self, PyObject *arg)
InternalDescriptorPool * generated_pool
const DescriptorPool * underlay_
const ServiceDescriptor * service_
OneofDescriptorProto Proto
static bool IsTypePackable(Type field_type)
const FileDescriptor * file() const
bool IsReservedName(const std::string &name) const
#define PROTOBUF_DEFINE_STRING_ACCESSOR(CLASS, FIELD)
DescriptorDatabase * fallback_database_
const ReservedRange * FindReservedRangeContainingNumber(int number) const
ErrorCollector * default_error_collector_
const FileDescriptor * file() const
const std::string * package_
FileDescriptorProto Proto
MethodOptions OptionsType
struct EnumValueDescriptor EnumValueDescriptor
const ServiceDescriptor * service() const
bool enforce_dependencies_
static const char * CppTypeName(CppType cpp_type)
bool is_unqualified_placeholder_
uint32 default_value_uint32_
std::unique_ptr< Tables > tables_
const FileDescriptor * file() const
const FileDescriptor * file_
const FieldDescriptor * field
const FileDescriptor * weak_dependency(int index) const
GLint GLint GLsizei GLsizei GLsizei depth
ReservedRange * reserved_ranges_
const FileDescriptor * file_
void AllowUnknownDependencies()
const std::string * name_
void DisallowEnforceUtf8()
InternalDescriptorPool * pool
int reserved_range_count_
EnumDescriptor::ReservedRange * reserved_ranges_
OneofDescriptor * oneof_decls_
const Descriptor * containing_type_
const Descriptor * containing_type_
internal::once_flag * dependencies_once_
int reserved_range_count_
const std::string * camelcase_name_
virtual void AddWarning(const std::string &, const std::string &, const Message *, ErrorLocation, const std::string &)
#define PROTOBUF_DEFINE_OPTIONS_ACCESSOR(CLASS, TYPE)
const EnumOptions * options_
double default_value_double_
bool lazily_build_dependencies_
const std::string * name_
int reserved_name_count() const
const Descriptor * extension_scope_
int weak_dependency_count_
const std::string * name_
const FileDescriptor * dependency(int index) const
static const char *const kTypeToName[MAX_TYPE+1]
const std::string * name_
FieldDescriptor * extensions_
const FileOptions * options_
Descriptor * message_types_
bool disallow_enforce_utf8_
const Descriptor * message_type_
const FileDescriptor * file() const
static PyObject * FindAllExtensions(PyObject *self, PyObject *arg)
bool IsReservedName(const std::string &name) const
EnumValueDescriptorProto Proto
const std::string & reserved_name(int index) const
int reserved_name_count() const
std::set< std::string > unused_import_track_files_
const std::string * name_
std::string TypeName(FieldDescriptor *field)
FieldDescriptorProto Proto
bool is_map_message_type() const
std::vector< std::string > leading_detached_comments
bool IsReservedNumber(int number) const
int public_dependency_count_
const std::string ** reserved_names_
int32 default_value_int32_
const Descriptor::ReservedRange * PROTOBUF_DEFINE_ACCESSOR(FieldDescriptor, containing_oneof, const OneofDescriptor *) PROTOBUF_DEFINE_ARRAY_ACCESSOR(EnumDescriptor
GLsizei const GLfloat * value
const Descriptor * descriptor_
const upb_json_parsermethod const upb_symtab upb_sink * output
static CppType TypeToCppType(Type type)
const std::string * json_name_
static const CppType kTypeToCppTypeMap[MAX_TYPE+1]
struct DescriptorPool DescriptorPool
const std::string * full_name_
const FileDescriptor * public_dependency(int index) const
internal::LazyDescriptor output_type_
const std::string * type_name_
const std::string * full_name_
const EnumValueOptions * options_
const Descriptor * containing_type() const
FileDescriptorProto * file_
float default_value_float_
const ExtensionRange * FindExtensionRangeContainingNumber(int number) const
const MethodOptions * options_
GLenum GLuint GLenum GLsizei const GLchar * message
const Descriptor::ReservedRange const EnumValueDescriptor method
FieldDescriptor::CppType cpp_type(FieldType type)
internal::LazyDescriptor input_type_
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:49