// DO NOT EDIT. // swift-format-ignore-file // swiftlint:disable all // // Generated by the Swift generator plugin for the protocol buffer compiler. // Source: pluginlib_descriptor_test_import.proto // // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ // Protos/SwiftProtobufPluginLibraryTests/pluginlib_descriptor_test_import.proto - test proto // // This source file is part of the Swift.org open source project // // Copyright (c) 2024 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LICENSE.txt for license information // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // // ----------------------------------------------------------------------------- /// /// Test proto for Tests/SwiftProtobufPluginLibraryTests/Test_Descriptor.swift /// // ----------------------------------------------------------------------------- import SwiftProtobuf // If the compiler emits an error on this type, it is because this file // was generated by a version of the `protoc` Swift plug-in that is // incompatible with the version of SwiftProtobuf to which you are linking. // Please ensure that you are building against the same version of the API // that was used to generate this file. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} typealias Version = _2 } struct SwiftDescriptorTest_Import_Version: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var major: Int32 { get {_major ?? 0} set {_major = newValue} } /// Returns true if `major` has been explicitly set. var hasMajor: Bool {self._major != nil} /// Clears the value of `major`. Subsequent reads from it will return its default value. mutating func clearMajor() {self._major = nil} var minor: Int32 { get {_minor ?? 0} set {_minor = newValue} } /// Returns true if `minor` has been explicitly set. var hasMinor: Bool {self._minor != nil} /// Clears the value of `minor`. Subsequent reads from it will return its default value. mutating func clearMinor() {self._minor = nil} var patch: Int32 { get {_patch ?? 0} set {_patch = newValue} } /// Returns true if `patch` has been explicitly set. var hasPatch: Bool {self._patch != nil} /// Clears the value of `patch`. Subsequent reads from it will return its default value. mutating func clearPatch() {self._patch = nil} var suffix: String { get {_suffix ?? String()} set {_suffix = newValue} } /// Returns true if `suffix` has been explicitly set. var hasSuffix: Bool {self._suffix != nil} /// Clears the value of `suffix`. Subsequent reads from it will return its default value. mutating func clearSuffix() {self._suffix = nil} var unknownFields = SwiftProtobuf.UnknownStorage() init() {} fileprivate var _major: Int32? = nil fileprivate var _minor: Int32? = nil fileprivate var _patch: Int32? = nil fileprivate var _suffix: String? = nil } struct SwiftDescriptorTest_Import_ExtendableOne: SwiftProtobuf.ExtensibleMessage, Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var subMsgField: SwiftDescriptorTest_Import_ExtendableOne.ExtendableTwo { get {_subMsgField ?? SwiftDescriptorTest_Import_ExtendableOne.ExtendableTwo()} set {_subMsgField = newValue} } /// Returns true if `subMsgField` has been explicitly set. var hasSubMsgField: Bool {self._subMsgField != nil} /// Clears the value of `subMsgField`. Subsequent reads from it will return its default value. mutating func clearSubMsgField() {self._subMsgField = nil} var unknownFields = SwiftProtobuf.UnknownStorage() struct ExtendableTwo: SwiftProtobuf.ExtensibleMessage, Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var unknownFields = SwiftProtobuf.UnknownStorage() init() {} var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() } init() {} var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() fileprivate var _subMsgField: SwiftDescriptorTest_Import_ExtendableOne.ExtendableTwo? = nil } // MARK: - Code below here is support for the SwiftProtobuf runtime. fileprivate let _protobuf_package = "swift_descriptor_test.import" extension SwiftDescriptorTest_Import_Version: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Version" static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}major\0\u{1}minor\0\u{1}patch\0\u{1}suffix\0") mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { // The use of inline closures is to circumvent an issue where the compiler // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularInt32Field(value: &self._major) }() case 2: try { try decoder.decodeSingularInt32Field(value: &self._minor) }() case 3: try { try decoder.decodeSingularInt32Field(value: &self._patch) }() case 4: try { try decoder.decodeSingularStringField(value: &self._suffix) }() default: break } } } func traverse(visitor: inout V) throws { // The use of inline closures is to circumvent an issue where the compiler // allocates stack space for every if/case branch local when no optimizations // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and // https://github.com/apple/swift-protobuf/issues/1182 try { if let v = self._major { try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) } }() try { if let v = self._minor { try visitor.visitSingularInt32Field(value: v, fieldNumber: 2) } }() try { if let v = self._patch { try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) } }() try { if let v = self._suffix { try visitor.visitSingularStringField(value: v, fieldNumber: 4) } }() try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: SwiftDescriptorTest_Import_Version, rhs: SwiftDescriptorTest_Import_Version) -> Bool { if lhs._major != rhs._major {return false} if lhs._minor != rhs._minor {return false} if lhs._patch != rhs._patch {return false} if lhs._suffix != rhs._suffix {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } extension SwiftDescriptorTest_Import_ExtendableOne: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".ExtendableOne" static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}sub_msg_field\0") public var isInitialized: Bool { if !_protobuf_extensionFieldValues.isInitialized {return false} if let v = self._subMsgField, !v.isInitialized {return false} return true } mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { // The use of inline closures is to circumvent an issue where the compiler // allocates stack space for every case branch when no optimizations are // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularMessageField(value: &self._subMsgField) }() case 1000..<536870912: try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: SwiftDescriptorTest_Import_ExtendableOne.self, fieldNumber: fieldNumber) }() default: break } } } func traverse(visitor: inout V) throws { // The use of inline closures is to circumvent an issue where the compiler // allocates stack space for every if/case branch local when no optimizations // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and // https://github.com/apple/swift-protobuf/issues/1182 try { if let v = self._subMsgField { try visitor.visitSingularMessageField(value: v, fieldNumber: 1) } }() try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: SwiftDescriptorTest_Import_ExtendableOne, rhs: SwiftDescriptorTest_Import_ExtendableOne) -> Bool { if lhs._subMsgField != rhs._subMsgField {return false} if lhs.unknownFields != rhs.unknownFields {return false} if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} return true } } extension SwiftDescriptorTest_Import_ExtendableOne.ExtendableTwo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = SwiftDescriptorTest_Import_ExtendableOne.protoMessageName + ".ExtendableTwo" static let _protobuf_nameMap = SwiftProtobuf._NameMap() public var isInitialized: Bool { if !_protobuf_extensionFieldValues.isInitialized {return false} return true } mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { if (1000 <= fieldNumber && fieldNumber < 536870912) { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: SwiftDescriptorTest_Import_ExtendableOne.ExtendableTwo.self, fieldNumber: fieldNumber) } } } func traverse(visitor: inout V) throws { try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1000, end: 536870912) try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: SwiftDescriptorTest_Import_ExtendableOne.ExtendableTwo, rhs: SwiftDescriptorTest_Import_ExtendableOne.ExtendableTwo) -> Bool { if lhs.unknownFields != rhs.unknownFields {return false} if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} return true } }