messagePropertyName(oneof:prefixed:)
Calculate the name to use for the Swift field on the message.
func messagePropertyName(oneof: OneofDescriptor, prefixed: String = "_") -> OneofFieldNames
Calculate the name to use for the Swift field on the message.
func messagePropertyName(oneof: OneofDescriptor, prefixed: String = "_") -> OneofFieldNames
s26SwiftProtobufPluginLibrary0aB5NamerC19messagePropertyName5oneof8prefixedSS4name_SSAFtAA15OneofDescriptorC_SStF
What are these?5KFOJ
import SwiftProtobufPluginLibrary
A reusable framework for building protoc
plugins in Swift.
final class SwiftProtobufNamer
final class OneofDescriptor
Describes a oneof defined in a message type.
@frozen struct String
A Unicode string value that is a collection of characters.
typealias OneofFieldNames = (name: String, prefixed: String)
convenience init()
Initializes a a new namer, assuming everything will be in the same Swift module.
convenience init(currentFile file: FileDescriptor, protoFileToModuleMappings mappings: ProtoFileToModuleMappings)
Initializes a a new namer. All names will be generated as from the pov of the given file using the provided file to module mapper.
let mappings: ProtoFileToModuleMappings
var swiftProtobufModuleName: String { get }
var swiftProtobufModulePrefix: String { get }
let targetModule: String
func dottedRelativeName(enumValue: EnumValueDescriptor) -> String
The relative name with a leading dot so it can be used where the type is known.
func fullName(enum e: EnumDescriptor) -> String
Calculate the full name for the given enum.
func fullName(enumValue: EnumValueDescriptor) -> String
Calculate the full name for the given enum value.
func fullName(extensionField field: FieldDescriptor) -> String
Calculate the full name for the given extension.
func fullName(message: Descriptor) -> String
Calculate the full name for the given message.
func fullName(oneof: OneofDescriptor) -> String
Calculate the full name for the given oneof.
func messagePropertyNames(extensionField field: FieldDescriptor) -> MessageExtensionNames
Calculate the names to use for the Swift Extension on the extended message.
func messagePropertyNames(field: FieldDescriptor, prefixed: String, includeHasAndClear: Bool) -> MessageFieldNames
Calculate the names to use for the Swift fields on the message.
func relativeName(enum e: EnumDescriptor) -> String
Calculate the relative name for the given enum.
func relativeName(enumValue: EnumValueDescriptor) -> String
Calculate the relative name for the given enum value.
func relativeName(extensionField field: FieldDescriptor) -> String
Calculate the relative name for the given entension.
func relativeName(message: Descriptor) -> String
Calculate the relative name for the given message.
func relativeName(oneof: OneofDescriptor) -> String
Calculate the relative name for the given oneof.
func typePrefix(forFile file: FileDescriptor) -> String
Calculate the prefix to use for this file, it is derived from the proto package or swift_prefix file option.
typealias MessageExtensionNames = (value: String, has: String, clear: String)
typealias MessageFieldNames = (name: String, prefixed: String, has: String, clear: String)
func uniquelyNamedValues(enum e: EnumDescriptor) -> [EnumValueDescriptor]
Filters the Enum’s values to those that will have unique Swift names. Only poorly named proto enum alias values get filtered away, so the assumption is they aren’t really needed from an api pov.