|
| 1 | +// DO NOT EDIT. |
| 2 | +// swift-format-ignore-file |
| 3 | +// |
| 4 | +// Generated by the Swift generator plugin for the protocol buffer compiler. |
| 5 | +// Source: unittest_swift_json.proto |
| 6 | +// |
| 7 | +// For information on using the generated types, please see the documentation: |
| 8 | +// https://github.com/apple/swift-protobuf/ |
| 9 | + |
| 10 | +// Protos/unittest_swift_json.proto |
| 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 | +import Foundation |
| 20 | +import SwiftProtobuf |
| 21 | + |
| 22 | +// If the compiler emits an error on this type, it is because this file |
| 23 | +// was generated by a version of the `protoc` Swift plug-in that is |
| 24 | +// incompatible with the version of SwiftProtobuf to which you are linking. |
| 25 | +// Please ensure that you are building against the same version of the API |
| 26 | +// that was used to generate this file. |
| 27 | +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { |
| 28 | + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} |
| 29 | + typealias Version = _2 |
| 30 | +} |
| 31 | + |
| 32 | +struct ProtobufUnittest_SwiftJSONTest { |
| 33 | + // SwiftProtobuf.Message conformance is added in an extension below. See the |
| 34 | + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for |
| 35 | + // methods supported on all messages. |
| 36 | + |
| 37 | + /// This case was omitted from test_messages_proto3.proto |
| 38 | + var repeatedNullValue: [SwiftProtobuf.Google_Protobuf_NullValue] = [] |
| 39 | + |
| 40 | + var unknownFields = SwiftProtobuf.UnknownStorage() |
| 41 | + |
| 42 | + init() {} |
| 43 | +} |
| 44 | + |
| 45 | +// MARK: - Code below here is support for the SwiftProtobuf runtime. |
| 46 | + |
| 47 | +fileprivate let _protobuf_package = "protobuf_unittest" |
| 48 | + |
| 49 | +extension ProtobufUnittest_SwiftJSONTest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { |
| 50 | + static let protoMessageName: String = _protobuf_package + ".SwiftJSONTest" |
| 51 | + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ |
| 52 | + 318: .standard(proto: "repeated_null_value"), |
| 53 | + ] |
| 54 | + |
| 55 | + mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { |
| 56 | + while let fieldNumber = try decoder.nextFieldNumber() { |
| 57 | + // The use of inline closures is to circumvent an issue where the compiler |
| 58 | + // allocates stack space for every case branch when no optimizations are |
| 59 | + // enabled. https://github.com/apple/swift-protobuf/issues/1034 |
| 60 | + switch fieldNumber { |
| 61 | + case 318: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedNullValue) }() |
| 62 | + default: break |
| 63 | + } |
| 64 | + } |
| 65 | + } |
| 66 | + |
| 67 | + func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { |
| 68 | + if !self.repeatedNullValue.isEmpty { |
| 69 | + try visitor.visitPackedEnumField(value: self.repeatedNullValue, fieldNumber: 318) |
| 70 | + } |
| 71 | + try unknownFields.traverse(visitor: &visitor) |
| 72 | + } |
| 73 | + |
| 74 | + static func ==(lhs: ProtobufUnittest_SwiftJSONTest, rhs: ProtobufUnittest_SwiftJSONTest) -> Bool { |
| 75 | + if lhs.repeatedNullValue != rhs.repeatedNullValue {return false} |
| 76 | + if lhs.unknownFields != rhs.unknownFields {return false} |
| 77 | + return true |
| 78 | + } |
| 79 | +} |
0 commit comments