Lines Matching refs:Descriptor
49 The message descriptor can be used in conjunction with the message_factory
62 from google.protobuf import descriptor
83 """A collection of protobufs dynamically constructed by descriptor protos."""
89 specialized file descriptor proto lookup code to be triggered on demand. An
114 """Adds a Descriptor to the pool, non-recursively.
116 If the Descriptor contains nested messages or enums, the caller must
121 desc: A Descriptor.
123 if not isinstance(desc, descriptor.Descriptor):
124 raise TypeError('Expected instance of descriptor.Descriptor.')
138 if not isinstance(enum_desc, descriptor.EnumDescriptor):
139 raise TypeError('Expected instance of descriptor.EnumDescriptor.')
154 if not isinstance(file_desc, descriptor.FileDescriptor):
155 raise TypeError('Expected instance of descriptor.FileDescriptor.')
162 file_name: The path to the file to get a descriptor for.
225 """Loads the named descriptor from the pool.
228 full_name: The full name of the descriptor to load.
231 The descriptor for the named type.
240 """Loads the named enum descriptor from the pool.
243 full_name: The full name of the enum descriptor to load.
246 The enum descriptor for the named type.
271 file_descriptor = descriptor.FileDescriptor(
335 The added descriptor.
363 descriptor.OneofDescriptor(desc.name, '.'.join((desc_name, desc.name)),
371 desc = descriptor.Descriptor(
408 file_desc: The file containing the enum descriptor.
413 The added descriptor
428 desc = descriptor.EnumDescriptor(name=enum_proto.name,
441 """Creates a field descriptor from a FieldDescriptorProto.
444 in the pool for the appropriate descriptor for that type. If it
464 return descriptor.FieldDescriptor(
482 """Sets all the descriptor's fields's types.
488 desc_proto: The message descriptor to update.
518 field_desc: The descriptor to modiy.
528 if isinstance(desc, descriptor.Descriptor):
529 field_proto.type = descriptor.FieldDescriptor.TYPE_MESSAGE
531 field_proto.type = descriptor.FieldDescriptor.TYPE_ENUM
533 field_desc.cpp_type = descriptor.FieldDescriptor.ProtoTypeToCppProtoType(
536 if (field_proto.type == descriptor.FieldDescriptor.TYPE_MESSAGE
537 or field_proto.type == descriptor.FieldDescriptor.TYPE_GROUP):
540 if field_proto.type == descriptor.FieldDescriptor.TYPE_ENUM:
543 if field_proto.label == descriptor.FieldDescriptor.LABEL_REPEATED:
548 if (field_proto.type == descriptor.FieldDescriptor.TYPE_DOUBLE or
549 field_proto.type == descriptor.FieldDescriptor.TYPE_FLOAT):
551 elif field_proto.type == descriptor.FieldDescriptor.TYPE_STRING:
553 elif field_proto.type == descriptor.FieldDescriptor.TYPE_BOOL:
555 elif field_proto.type == descriptor.FieldDescriptor.TYPE_ENUM:
558 elif field_proto.type == descriptor.FieldDescriptor.TYPE_BYTES:
570 """Creates a enum value descriptor object from a enum value proto.
580 return descriptor.EnumValueDescriptor(
588 """Pulls out all the symbols from descriptor protos.
593 A two element tuple of the type name and descriptor object.
628 The descriptor for the requested type.