|
| 1 | +// DO NOT EDIT. |
| 2 | +// |
| 3 | +// Generated by the Swift generator plugin for the protocol buffer compiler. |
| 4 | +// Source: unittest_swift_größ.proto |
| 5 | +// |
| 6 | +// For information on using the generated types, please see the documentation: |
| 7 | +// https://github.com/apple/swift-protobuf/ |
| 8 | + |
| 9 | +// Protos/unittest_swift_größ.proto - test proto |
| 10 | +// |
| 11 | +// This source file is part of the Swift.org open source project |
| 12 | +// |
| 13 | +// Copyright (c) 2020 Apple Inc. and the Swift project authors |
| 14 | +// Licensed under Apache License v2.0 with Runtime Library Exception |
| 15 | +// |
| 16 | +// See http://swift.org/LICENSE.txt for license information |
| 17 | +// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors |
| 18 | +// |
| 19 | +// ----------------------------------------------------------------------------- |
| 20 | +/// |
| 21 | +/// Test Swift reserved words used as enum or message names |
| 22 | +/// |
| 23 | +// ----------------------------------------------------------------------------- |
| 24 | + |
| 25 | +import Foundation |
| 26 | +import SwiftProtobuf |
| 27 | + |
| 28 | +// If the compiler emits an error on this type, it is because this file |
| 29 | +// was generated by a version of the `protoc` Swift plug-in that is |
| 30 | +// incompatible with the version of SwiftProtobuf to which you are linking. |
| 31 | +// Please ensure that you are building against the same version of the API |
| 32 | +// that was used to generate this file. |
| 33 | +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { |
| 34 | + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} |
| 35 | + typealias Version = _2 |
| 36 | +} |
| 37 | + |
| 38 | +struct ToExtend: SwiftProtobuf.ExtensibleMessage { |
| 39 | + // SwiftProtobuf.Message conformance is added in an extension below. See the |
| 40 | + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for |
| 41 | + // methods supported on all messages. |
| 42 | + |
| 43 | + var unknownFields = SwiftProtobuf.UnknownStorage() |
| 44 | + |
| 45 | + init() {} |
| 46 | + |
| 47 | + var _protobuf_extensionFieldValues = SwiftProtobuf.ExtensionFieldValueSet() |
| 48 | +} |
| 49 | + |
| 50 | +// MARK: - Extension support defined in unittest_swift_größ.proto. |
| 51 | + |
| 52 | +extension ToExtend { |
| 53 | + |
| 54 | + var added: Int32 { |
| 55 | + get {return getExtensionValue(ext: Extensions_added) ?? 0} |
| 56 | + set {setExtensionValue(ext: Extensions_added, value: newValue)} |
| 57 | + } |
| 58 | + /// Returns true if extension `Extensions_added` |
| 59 | + /// has been explicitly set. |
| 60 | + var hasAdded: Bool { |
| 61 | + return hasExtensionValue(ext: Extensions_added) |
| 62 | + } |
| 63 | + /// Clears the value of extension `Extensions_added`. |
| 64 | + /// Subsequent reads from it will return its default value. |
| 65 | + mutating func clearAdded() { |
| 66 | + clearExtensionValue(ext: Extensions_added) |
| 67 | + } |
| 68 | + |
| 69 | +} |
| 70 | + |
| 71 | +/// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by |
| 72 | +/// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed |
| 73 | +/// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create |
| 74 | +/// a larger `SwiftProtobuf.SimpleExtensionMap`. |
| 75 | +let UnittestSwiftGröß_Extensions: SwiftProtobuf.SimpleExtensionMap = [ |
| 76 | + Extensions_added |
| 77 | +] |
| 78 | + |
| 79 | +let Extensions_added = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalExtensionField<SwiftProtobuf.ProtobufInt32>, ToExtend>( |
| 80 | + _protobuf_fieldNumber: 101, |
| 81 | + fieldName: "added" |
| 82 | +) |
| 83 | + |
| 84 | +// MARK: - Code below here is support for the SwiftProtobuf runtime. |
| 85 | + |
| 86 | +extension ToExtend: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { |
| 87 | + static let protoMessageName: String = "ToExtend" |
| 88 | + static let _protobuf_nameMap = SwiftProtobuf._NameMap() |
| 89 | + |
| 90 | + public var isInitialized: Bool { |
| 91 | + if !_protobuf_extensionFieldValues.isInitialized {return false} |
| 92 | + return true |
| 93 | + } |
| 94 | + |
| 95 | + mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { |
| 96 | + while let fieldNumber = try decoder.nextFieldNumber() { |
| 97 | + if (1 <= fieldNumber && fieldNumber < 5001) { |
| 98 | + try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ToExtend.self, fieldNumber: fieldNumber) |
| 99 | + } |
| 100 | + } |
| 101 | + } |
| 102 | + |
| 103 | + func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { |
| 104 | + try visitor.visitExtensionFields(fields: _protobuf_extensionFieldValues, start: 1, end: 5001) |
| 105 | + try unknownFields.traverse(visitor: &visitor) |
| 106 | + } |
| 107 | + |
| 108 | + static func ==(lhs: ToExtend, rhs: ToExtend) -> Bool { |
| 109 | + if lhs.unknownFields != rhs.unknownFields {return false} |
| 110 | + if lhs._protobuf_extensionFieldValues != rhs._protobuf_extensionFieldValues {return false} |
| 111 | + return true |
| 112 | + } |
| 113 | +} |
0 commit comments