index
Index of this descriptor within the file or containing type’s message type array.
let index: Int
Index of this descriptor within the file or containing type’s message type array.
let index: Int
import SwiftProtobufPluginLibrary
A reusable framework for building protoc
plugins in Swift.
final class Descriptor
Describes a type of protocol message, or a particular group within a message. Descriptor
s are not directly created, instead they are constructed/fetched via the DescriptorSet
or they are directly accessed via a messageType
property on FieldDescriptor
s, etc.
@frozen struct Int
A signed integer value type.
unowned var containingType: Descriptor? { get }
If this Descriptor describes a nested type, this returns the type in which it is nested.
let enums: [EnumDescriptor]
The enum defintions under this message.
let extensions: [FieldDescriptor]
The extension field defintions under this message.
let features: Google_Protobuf_FeatureSet
The resolved features for this Descriptor.
let fields: [FieldDescriptor]
The fields of this message.
var file: FileDescriptor! { get }
The .proto file in which this message type was defined.
let fullName: String
The fully-qualified name of the message type, scope delimited by periods. For example, message type “Foo” which is declared in package “bar” has full name “bar.Foo”. If a type “Baz” is nested within Foo, Baz’s fullName
is “bar.Foo.Baz”. To get only the part that comes after the last ‘.’, use name().
var isDeprecated: Bool { get }
var mapKeyAndValue: (key: FieldDescriptor, value: FieldDescriptor)? { get }
Returns the FieldDescriptor
s for the “key” and “value” fields. If this isn’t a map entry field, returns nil.
let messageExtensionRanges: [ExtensionRange]
The extension ranges declared for this message. They are returned in the order they are defined in the .proto file.
let messages: [Descriptor]
The message defintions under this message. In the C++ Descriptor this is nested_type
.
let name: String
The name of the message type, not including its scope.
let oneofs: [OneofDescriptor]
The oneofs in this message. This can include synthetic oneofs.
let options: Google_Protobuf_MessageOptions
The Google_Protobuf_MessageOptions
set on this Message.
lazy var realOneofs: [OneofDescriptor] { get set }
Non synthetic oneofs.
let reservedNames: [String]
The reserved field names for this message. These are returned in the order they are defined in the .proto file.
let reservedRanges: [Range<Int32>]
The reserved field number ranges for this message. These are returned in the order they are defined in the .proto file.
var typeName: String { get }
let wellKnownType: WellKnownType?
func getLocationPath(path: inout IndexPath)
final class ExtensionRange
Describes an extension range of a message. ExtensionRange
s are not directly created, instead they are constructed/fetched via the Descriptor
.
enum WellKnownType
The type of this Message.
lazy var ambitiousExtensionRanges: [Google_Protobuf_DescriptorProto.ExtensionRange] { get set }
The extensionRanges
from normalizedExtensionRanges
, but takes a step further in that any ranges that do not have any fields inbetween them are also merged together. These can then be used in context where it is ok to include field numbers that have to be extension or unknown fields.
var extensionRanges: [Google_Protobuf_DescriptorProto.ExtensionRange] { get }
The extension ranges declared for this message. They are returned in the order they are defined in the .proto file.
var isMapEntry: Bool { get }
True/False if this Message is just for a map<>
entry.
lazy var normalizedExtensionRanges: [Google_Protobuf_DescriptorProto.ExtensionRange] { get set }
The extensionRanges
are in the order they appear in the original .proto file; this orders them and then merges any ranges that are actually contiguious (i.e. - [(21,30),(10,20)] -> [(10,30)])
var proto: Google_Protobuf_DescriptorProto { get }
var useMessageSetWireFormat: Bool { get }