ExtensionRange
Describes an extension range of a message. ExtensionRange
s are not directly created, instead they are constructed/fetched via the Descriptor
.
final class ExtensionRange
Describes an extension range of a message. ExtensionRange
s are not directly created, instead they are constructed/fetched via the Descriptor
.
final class ExtensionRange
s26SwiftProtobufPluginLibrary10DescriptorC14ExtensionRangeC
What are these?8NOV1
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.
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().
let index: Int
Index of this descriptor within the file or containing type’s message type array.
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)
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 }
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol Escapable
protocol ProvidesLocationPath
Protocol that all the Descriptors conform to for original .proto file location lookup.
protocol ProvidesSourceCodeLocation
Protocol that all the Descriptors conform to for original .proto file location lookup.
var containingType: Descriptor { get }
The descriptor that owns with ExtensionRange.
var end: Int32 { get }
let features: Google_Protobuf_FeatureSet
The resolved features for this ExtensionRange.
var file: FileDescriptor! { get }
The .proto file in which this ExtensionRange was defined.
var fullName: String { get }
The fully-qualified name of the containing type, scope delimited by periods.
let index: Int
var name: String { get }
The name of the containing type, not including its scope.
let options: Google_Protobuf_ExtensionRangeOptions
The Google_Protobuf_ExtensionRangeOptions
set on this ExtensionRange.
let start: Int32
The start field number of this range (inclusive).
func getLocationPath(path: inout IndexPath)
var sourceCodeInfoLocation: Google_Protobuf_SourceCodeInfo.Location? { get }
func protoSourceComments(commentPrefix: String = "///", leadingDetachedPrefix: String? = nil) -> String
Helper to get a source comments as a string.