| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613 |
- // DO NOT EDIT.
- // swift-format-ignore-file
- // swiftlint:disable all
- //
- // Generated by the Swift generator plugin for the protocol buffer compiler.
- // Source: unittest_proto3.proto
- //
- // For information on using the generated types, please see the documentation:
- // https://github.com/apple/swift-protobuf/
- // Protocol Buffers - Google's data interchange format
- // Copyright 2008 Google Inc. All rights reserved.
- // https://developers.google.com/protocol-buffers/
- //
- // Redistribution and use in source and binary forms, with or without
- // modification, are permitted provided that the following conditions are
- // met:
- //
- // * Redistributions of source code must retain the above copyright
- // notice, this list of conditions and the following disclaimer.
- // * Redistributions in binary form must reproduce the above
- // copyright notice, this list of conditions and the following disclaimer
- // in the documentation and/or other materials provided with the
- // distribution.
- // * Neither the name of Google Inc. nor the names of its
- // contributors may be used to endorse or promote products derived from
- // this software without specific prior written permission.
- //
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- import Foundation
- 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
- }
- enum SwiftProtoTesting_Proto3_ForeignEnum: SwiftProtobuf.Enum, Swift.CaseIterable {
- typealias RawValue = Int
- case foreignZero // = 0
- case foreignFoo // = 4
- case foreignBar // = 5
- case foreignBaz // = 6
- case UNRECOGNIZED(Int)
- init() {
- self = .foreignZero
- }
- init?(rawValue: Int) {
- switch rawValue {
- case 0: self = .foreignZero
- case 4: self = .foreignFoo
- case 5: self = .foreignBar
- case 6: self = .foreignBaz
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .foreignZero: return 0
- case .foreignFoo: return 4
- case .foreignBar: return 5
- case .foreignBaz: return 6
- case .UNRECOGNIZED(let i): return i
- }
- }
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static let allCases: [SwiftProtoTesting_Proto3_ForeignEnum] = [
- .foreignZero,
- .foreignFoo,
- .foreignBar,
- .foreignBaz,
- ]
- }
- /// This proto includes every type of field in both singular and repeated
- /// forms.
- struct SwiftProtoTesting_Proto3_TestAllTypes: @unchecked 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.
- /// Singular
- var optionalInt32: Int32 {
- get {return _storage._optionalInt32}
- set {_uniqueStorage()._optionalInt32 = newValue}
- }
- var optionalInt64: Int64 {
- get {return _storage._optionalInt64}
- set {_uniqueStorage()._optionalInt64 = newValue}
- }
- var optionalUint32: UInt32 {
- get {return _storage._optionalUint32}
- set {_uniqueStorage()._optionalUint32 = newValue}
- }
- var optionalUint64: UInt64 {
- get {return _storage._optionalUint64}
- set {_uniqueStorage()._optionalUint64 = newValue}
- }
- var optionalSint32: Int32 {
- get {return _storage._optionalSint32}
- set {_uniqueStorage()._optionalSint32 = newValue}
- }
- var optionalSint64: Int64 {
- get {return _storage._optionalSint64}
- set {_uniqueStorage()._optionalSint64 = newValue}
- }
- var optionalFixed32: UInt32 {
- get {return _storage._optionalFixed32}
- set {_uniqueStorage()._optionalFixed32 = newValue}
- }
- var optionalFixed64: UInt64 {
- get {return _storage._optionalFixed64}
- set {_uniqueStorage()._optionalFixed64 = newValue}
- }
- var optionalSfixed32: Int32 {
- get {return _storage._optionalSfixed32}
- set {_uniqueStorage()._optionalSfixed32 = newValue}
- }
- var optionalSfixed64: Int64 {
- get {return _storage._optionalSfixed64}
- set {_uniqueStorage()._optionalSfixed64 = newValue}
- }
- var optionalFloat: Float {
- get {return _storage._optionalFloat}
- set {_uniqueStorage()._optionalFloat = newValue}
- }
- var optionalDouble: Double {
- get {return _storage._optionalDouble}
- set {_uniqueStorage()._optionalDouble = newValue}
- }
- var optionalBool: Bool {
- get {return _storage._optionalBool}
- set {_uniqueStorage()._optionalBool = newValue}
- }
- var optionalString: String {
- get {return _storage._optionalString}
- set {_uniqueStorage()._optionalString = newValue}
- }
- var optionalBytes: Data {
- get {return _storage._optionalBytes}
- set {_uniqueStorage()._optionalBytes = newValue}
- }
- var optionalNestedMessage: SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage {
- get {return _storage._optionalNestedMessage ?? SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage()}
- set {_uniqueStorage()._optionalNestedMessage = newValue}
- }
- /// Returns true if `optionalNestedMessage` has been explicitly set.
- var hasOptionalNestedMessage: Bool {return _storage._optionalNestedMessage != nil}
- /// Clears the value of `optionalNestedMessage`. Subsequent reads from it will return its default value.
- mutating func clearOptionalNestedMessage() {_uniqueStorage()._optionalNestedMessage = nil}
- var optionalForeignMessage: SwiftProtoTesting_Proto3_ForeignMessage {
- get {return _storage._optionalForeignMessage ?? SwiftProtoTesting_Proto3_ForeignMessage()}
- set {_uniqueStorage()._optionalForeignMessage = newValue}
- }
- /// Returns true if `optionalForeignMessage` has been explicitly set.
- var hasOptionalForeignMessage: Bool {return _storage._optionalForeignMessage != nil}
- /// Clears the value of `optionalForeignMessage`. Subsequent reads from it will return its default value.
- mutating func clearOptionalForeignMessage() {_uniqueStorage()._optionalForeignMessage = nil}
- var optionalImportMessage: SwiftProtoTesting_Import_ImportMessage {
- get {return _storage._optionalImportMessage ?? SwiftProtoTesting_Import_ImportMessage()}
- set {_uniqueStorage()._optionalImportMessage = newValue}
- }
- /// Returns true if `optionalImportMessage` has been explicitly set.
- var hasOptionalImportMessage: Bool {return _storage._optionalImportMessage != nil}
- /// Clears the value of `optionalImportMessage`. Subsequent reads from it will return its default value.
- mutating func clearOptionalImportMessage() {_uniqueStorage()._optionalImportMessage = nil}
- var optionalNestedEnum: SwiftProtoTesting_Proto3_TestAllTypes.NestedEnum {
- get {return _storage._optionalNestedEnum}
- set {_uniqueStorage()._optionalNestedEnum = newValue}
- }
- var optionalForeignEnum: SwiftProtoTesting_Proto3_ForeignEnum {
- get {return _storage._optionalForeignEnum}
- set {_uniqueStorage()._optionalForeignEnum = newValue}
- }
- var optionalStringPiece: String {
- get {return _storage._optionalStringPiece}
- set {_uniqueStorage()._optionalStringPiece = newValue}
- }
- var optionalCord: String {
- get {return _storage._optionalCord}
- set {_uniqueStorage()._optionalCord = newValue}
- }
- /// Defined in unittest_import_public.proto
- var optionalPublicImportMessage: SwiftProtoTesting_Import_PublicImportMessage {
- get {return _storage._optionalPublicImportMessage ?? SwiftProtoTesting_Import_PublicImportMessage()}
- set {_uniqueStorage()._optionalPublicImportMessage = newValue}
- }
- /// Returns true if `optionalPublicImportMessage` has been explicitly set.
- var hasOptionalPublicImportMessage: Bool {return _storage._optionalPublicImportMessage != nil}
- /// Clears the value of `optionalPublicImportMessage`. Subsequent reads from it will return its default value.
- mutating func clearOptionalPublicImportMessage() {_uniqueStorage()._optionalPublicImportMessage = nil}
- var optionalLazyMessage: SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage {
- get {return _storage._optionalLazyMessage ?? SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage()}
- set {_uniqueStorage()._optionalLazyMessage = newValue}
- }
- /// Returns true if `optionalLazyMessage` has been explicitly set.
- var hasOptionalLazyMessage: Bool {return _storage._optionalLazyMessage != nil}
- /// Clears the value of `optionalLazyMessage`. Subsequent reads from it will return its default value.
- mutating func clearOptionalLazyMessage() {_uniqueStorage()._optionalLazyMessage = nil}
- var optionalUnverifiedLazyMessage: SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage {
- get {return _storage._optionalUnverifiedLazyMessage ?? SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage()}
- set {_uniqueStorage()._optionalUnverifiedLazyMessage = newValue}
- }
- /// Returns true if `optionalUnverifiedLazyMessage` has been explicitly set.
- var hasOptionalUnverifiedLazyMessage: Bool {return _storage._optionalUnverifiedLazyMessage != nil}
- /// Clears the value of `optionalUnverifiedLazyMessage`. Subsequent reads from it will return its default value.
- mutating func clearOptionalUnverifiedLazyMessage() {_uniqueStorage()._optionalUnverifiedLazyMessage = nil}
- var optionalLazyImportMessage: SwiftProtoTesting_Import_ImportMessage {
- get {return _storage._optionalLazyImportMessage ?? SwiftProtoTesting_Import_ImportMessage()}
- set {_uniqueStorage()._optionalLazyImportMessage = newValue}
- }
- /// Returns true if `optionalLazyImportMessage` has been explicitly set.
- var hasOptionalLazyImportMessage: Bool {return _storage._optionalLazyImportMessage != nil}
- /// Clears the value of `optionalLazyImportMessage`. Subsequent reads from it will return its default value.
- mutating func clearOptionalLazyImportMessage() {_uniqueStorage()._optionalLazyImportMessage = nil}
- /// Repeated
- var repeatedInt32: [Int32] {
- get {return _storage._repeatedInt32}
- set {_uniqueStorage()._repeatedInt32 = newValue}
- }
- var repeatedInt64: [Int64] {
- get {return _storage._repeatedInt64}
- set {_uniqueStorage()._repeatedInt64 = newValue}
- }
- var repeatedUint32: [UInt32] {
- get {return _storage._repeatedUint32}
- set {_uniqueStorage()._repeatedUint32 = newValue}
- }
- var repeatedUint64: [UInt64] {
- get {return _storage._repeatedUint64}
- set {_uniqueStorage()._repeatedUint64 = newValue}
- }
- var repeatedSint32: [Int32] {
- get {return _storage._repeatedSint32}
- set {_uniqueStorage()._repeatedSint32 = newValue}
- }
- var repeatedSint64: [Int64] {
- get {return _storage._repeatedSint64}
- set {_uniqueStorage()._repeatedSint64 = newValue}
- }
- var repeatedFixed32: [UInt32] {
- get {return _storage._repeatedFixed32}
- set {_uniqueStorage()._repeatedFixed32 = newValue}
- }
- var repeatedFixed64: [UInt64] {
- get {return _storage._repeatedFixed64}
- set {_uniqueStorage()._repeatedFixed64 = newValue}
- }
- var repeatedSfixed32: [Int32] {
- get {return _storage._repeatedSfixed32}
- set {_uniqueStorage()._repeatedSfixed32 = newValue}
- }
- var repeatedSfixed64: [Int64] {
- get {return _storage._repeatedSfixed64}
- set {_uniqueStorage()._repeatedSfixed64 = newValue}
- }
- var repeatedFloat: [Float] {
- get {return _storage._repeatedFloat}
- set {_uniqueStorage()._repeatedFloat = newValue}
- }
- var repeatedDouble: [Double] {
- get {return _storage._repeatedDouble}
- set {_uniqueStorage()._repeatedDouble = newValue}
- }
- var repeatedBool: [Bool] {
- get {return _storage._repeatedBool}
- set {_uniqueStorage()._repeatedBool = newValue}
- }
- var repeatedString: [String] {
- get {return _storage._repeatedString}
- set {_uniqueStorage()._repeatedString = newValue}
- }
- var repeatedBytes: [Data] {
- get {return _storage._repeatedBytes}
- set {_uniqueStorage()._repeatedBytes = newValue}
- }
- var repeatedNestedMessage: [SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage] {
- get {return _storage._repeatedNestedMessage}
- set {_uniqueStorage()._repeatedNestedMessage = newValue}
- }
- var repeatedForeignMessage: [SwiftProtoTesting_Proto3_ForeignMessage] {
- get {return _storage._repeatedForeignMessage}
- set {_uniqueStorage()._repeatedForeignMessage = newValue}
- }
- var repeatedImportMessage: [SwiftProtoTesting_Import_ImportMessage] {
- get {return _storage._repeatedImportMessage}
- set {_uniqueStorage()._repeatedImportMessage = newValue}
- }
- var repeatedNestedEnum: [SwiftProtoTesting_Proto3_TestAllTypes.NestedEnum] {
- get {return _storage._repeatedNestedEnum}
- set {_uniqueStorage()._repeatedNestedEnum = newValue}
- }
- var repeatedForeignEnum: [SwiftProtoTesting_Proto3_ForeignEnum] {
- get {return _storage._repeatedForeignEnum}
- set {_uniqueStorage()._repeatedForeignEnum = newValue}
- }
- var repeatedStringPiece: [String] {
- get {return _storage._repeatedStringPiece}
- set {_uniqueStorage()._repeatedStringPiece = newValue}
- }
- var repeatedCord: [String] {
- get {return _storage._repeatedCord}
- set {_uniqueStorage()._repeatedCord = newValue}
- }
- var repeatedLazyMessage: [SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage] {
- get {return _storage._repeatedLazyMessage}
- set {_uniqueStorage()._repeatedLazyMessage = newValue}
- }
- var oneofField: OneOf_OneofField? {
- get {return _storage._oneofField}
- set {_uniqueStorage()._oneofField = newValue}
- }
- var oneofUint32: UInt32 {
- get {
- if case .oneofUint32(let v)? = _storage._oneofField {return v}
- return 0
- }
- set {_uniqueStorage()._oneofField = .oneofUint32(newValue)}
- }
- var oneofNestedMessage: SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage {
- get {
- if case .oneofNestedMessage(let v)? = _storage._oneofField {return v}
- return SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage()
- }
- set {_uniqueStorage()._oneofField = .oneofNestedMessage(newValue)}
- }
- var oneofString: String {
- get {
- if case .oneofString(let v)? = _storage._oneofField {return v}
- return String()
- }
- set {_uniqueStorage()._oneofField = .oneofString(newValue)}
- }
- var oneofBytes: Data {
- get {
- if case .oneofBytes(let v)? = _storage._oneofField {return v}
- return Data()
- }
- set {_uniqueStorage()._oneofField = .oneofBytes(newValue)}
- }
- var unknownFields = SwiftProtobuf.UnknownStorage()
- enum OneOf_OneofField: Equatable, @unchecked Sendable {
- case oneofUint32(UInt32)
- case oneofNestedMessage(SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage)
- case oneofString(String)
- case oneofBytes(Data)
- }
- enum NestedEnum: SwiftProtobuf.Enum, Swift.CaseIterable {
- typealias RawValue = Int
- case zero // = 0
- case foo // = 1
- case bar // = 2
- case baz // = 3
- /// Intentionally negative.
- case neg // = -1
- case UNRECOGNIZED(Int)
- init() {
- self = .zero
- }
- init?(rawValue: Int) {
- switch rawValue {
- case -1: self = .neg
- case 0: self = .zero
- case 1: self = .foo
- case 2: self = .bar
- case 3: self = .baz
- default: self = .UNRECOGNIZED(rawValue)
- }
- }
- var rawValue: Int {
- switch self {
- case .neg: return -1
- case .zero: return 0
- case .foo: return 1
- case .bar: return 2
- case .baz: return 3
- case .UNRECOGNIZED(let i): return i
- }
- }
- // The compiler won't synthesize support with the UNRECOGNIZED case.
- static let allCases: [SwiftProtoTesting_Proto3_TestAllTypes.NestedEnum] = [
- .zero,
- .foo,
- .bar,
- .baz,
- .neg,
- ]
- }
- struct NestedMessage: 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.
- /// The field name "b" fails to compile in proto1 because it conflicts with
- /// a local variable named "b" in one of the generated methods. Doh.
- /// This file needs to compile in proto1 to test backwards-compatibility.
- var bb: Int32 = 0
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- struct SwiftProtoTesting_Proto3_TestPackedTypes: 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 packedInt32: [Int32] = []
- var packedInt64: [Int64] = []
- var packedUint32: [UInt32] = []
- var packedUint64: [UInt64] = []
- var packedSint32: [Int32] = []
- var packedSint64: [Int64] = []
- var packedFixed32: [UInt32] = []
- var packedFixed64: [UInt64] = []
- var packedSfixed32: [Int32] = []
- var packedSfixed64: [Int64] = []
- var packedFloat: [Float] = []
- var packedDouble: [Double] = []
- var packedBool: [Bool] = []
- var packedEnum: [SwiftProtoTesting_Proto3_ForeignEnum] = []
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// Explicitly set packed to false
- struct SwiftProtoTesting_Proto3_TestUnpackedTypes: 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 repeatedInt32: [Int32] = []
- var repeatedInt64: [Int64] = []
- var repeatedUint32: [UInt32] = []
- var repeatedUint64: [UInt64] = []
- var repeatedSint32: [Int32] = []
- var repeatedSint64: [Int64] = []
- var repeatedFixed32: [UInt32] = []
- var repeatedFixed64: [UInt64] = []
- var repeatedSfixed32: [Int32] = []
- var repeatedSfixed64: [Int64] = []
- var repeatedFloat: [Float] = []
- var repeatedDouble: [Double] = []
- var repeatedBool: [Bool] = []
- var repeatedNestedEnum: [SwiftProtoTesting_Proto3_TestAllTypes.NestedEnum] = []
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// This proto includes a recursively nested message.
- struct SwiftProtoTesting_Proto3_NestedTestAllTypes: @unchecked 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 child: SwiftProtoTesting_Proto3_NestedTestAllTypes {
- get {return _storage._child ?? SwiftProtoTesting_Proto3_NestedTestAllTypes()}
- set {_uniqueStorage()._child = newValue}
- }
- /// Returns true if `child` has been explicitly set.
- var hasChild: Bool {return _storage._child != nil}
- /// Clears the value of `child`. Subsequent reads from it will return its default value.
- mutating func clearChild() {_uniqueStorage()._child = nil}
- var payload: SwiftProtoTesting_Proto3_TestAllTypes {
- get {return _storage._payload ?? SwiftProtoTesting_Proto3_TestAllTypes()}
- set {_uniqueStorage()._payload = newValue}
- }
- /// Returns true if `payload` has been explicitly set.
- var hasPayload: Bool {return _storage._payload != nil}
- /// Clears the value of `payload`. Subsequent reads from it will return its default value.
- mutating func clearPayload() {_uniqueStorage()._payload = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _storage = _StorageClass.defaultInstance
- }
- /// Define these after TestAllTypes to make sure the compiler can handle
- /// that.
- struct SwiftProtoTesting_Proto3_ForeignMessage: 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 c: Int32 = 0
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- }
- /// TestEmptyMessage is used to test behavior of unknown fields.
- struct SwiftProtoTesting_Proto3_TestEmptyMessage: 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() {}
- }
- /// Test a proto3 defined message with a proto2 as a field that has required fields.
- struct SwiftProtoTesting_Proto3_TestProto2Required: 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 proto2: SwiftProtoTesting_TestRequired {
- get {return _proto2 ?? SwiftProtoTesting_TestRequired()}
- set {_proto2 = newValue}
- }
- /// Returns true if `proto2` has been explicitly set.
- var hasProto2: Bool {return self._proto2 != nil}
- /// Clears the value of `proto2`. Subsequent reads from it will return its default value.
- mutating func clearProto2() {self._proto2 = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- init() {}
- fileprivate var _proto2: SwiftProtoTesting_TestRequired? = nil
- }
- // MARK: - Code below here is support for the SwiftProtobuf runtime.
- fileprivate let _protobuf_package = "swift_proto_testing.proto3"
- extension SwiftProtoTesting_Proto3_ForeignEnum: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 0: .same(proto: "FOREIGN_ZERO"),
- 4: .same(proto: "FOREIGN_FOO"),
- 5: .same(proto: "FOREIGN_BAR"),
- 6: .same(proto: "FOREIGN_BAZ"),
- ]
- }
- extension SwiftProtoTesting_Proto3_TestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestAllTypes"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "optional_int32"),
- 2: .standard(proto: "optional_int64"),
- 3: .standard(proto: "optional_uint32"),
- 4: .standard(proto: "optional_uint64"),
- 5: .standard(proto: "optional_sint32"),
- 6: .standard(proto: "optional_sint64"),
- 7: .standard(proto: "optional_fixed32"),
- 8: .standard(proto: "optional_fixed64"),
- 9: .standard(proto: "optional_sfixed32"),
- 10: .standard(proto: "optional_sfixed64"),
- 11: .standard(proto: "optional_float"),
- 12: .standard(proto: "optional_double"),
- 13: .standard(proto: "optional_bool"),
- 14: .standard(proto: "optional_string"),
- 15: .standard(proto: "optional_bytes"),
- 18: .standard(proto: "optional_nested_message"),
- 19: .standard(proto: "optional_foreign_message"),
- 20: .standard(proto: "optional_import_message"),
- 21: .standard(proto: "optional_nested_enum"),
- 22: .standard(proto: "optional_foreign_enum"),
- 24: .standard(proto: "optional_string_piece"),
- 25: .standard(proto: "optional_cord"),
- 26: .standard(proto: "optional_public_import_message"),
- 27: .standard(proto: "optional_lazy_message"),
- 28: .standard(proto: "optional_unverified_lazy_message"),
- 115: .standard(proto: "optional_lazy_import_message"),
- 31: .standard(proto: "repeated_int32"),
- 32: .standard(proto: "repeated_int64"),
- 33: .standard(proto: "repeated_uint32"),
- 34: .standard(proto: "repeated_uint64"),
- 35: .standard(proto: "repeated_sint32"),
- 36: .standard(proto: "repeated_sint64"),
- 37: .standard(proto: "repeated_fixed32"),
- 38: .standard(proto: "repeated_fixed64"),
- 39: .standard(proto: "repeated_sfixed32"),
- 40: .standard(proto: "repeated_sfixed64"),
- 41: .standard(proto: "repeated_float"),
- 42: .standard(proto: "repeated_double"),
- 43: .standard(proto: "repeated_bool"),
- 44: .standard(proto: "repeated_string"),
- 45: .standard(proto: "repeated_bytes"),
- 48: .standard(proto: "repeated_nested_message"),
- 49: .standard(proto: "repeated_foreign_message"),
- 50: .standard(proto: "repeated_import_message"),
- 51: .standard(proto: "repeated_nested_enum"),
- 52: .standard(proto: "repeated_foreign_enum"),
- 54: .standard(proto: "repeated_string_piece"),
- 55: .standard(proto: "repeated_cord"),
- 57: .standard(proto: "repeated_lazy_message"),
- 111: .standard(proto: "oneof_uint32"),
- 112: .standard(proto: "oneof_nested_message"),
- 113: .standard(proto: "oneof_string"),
- 114: .standard(proto: "oneof_bytes"),
- ]
- fileprivate class _StorageClass {
- var _optionalInt32: Int32 = 0
- var _optionalInt64: Int64 = 0
- var _optionalUint32: UInt32 = 0
- var _optionalUint64: UInt64 = 0
- var _optionalSint32: Int32 = 0
- var _optionalSint64: Int64 = 0
- var _optionalFixed32: UInt32 = 0
- var _optionalFixed64: UInt64 = 0
- var _optionalSfixed32: Int32 = 0
- var _optionalSfixed64: Int64 = 0
- var _optionalFloat: Float = 0
- var _optionalDouble: Double = 0
- var _optionalBool: Bool = false
- var _optionalString: String = String()
- var _optionalBytes: Data = Data()
- var _optionalNestedMessage: SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage? = nil
- var _optionalForeignMessage: SwiftProtoTesting_Proto3_ForeignMessage? = nil
- var _optionalImportMessage: SwiftProtoTesting_Import_ImportMessage? = nil
- var _optionalNestedEnum: SwiftProtoTesting_Proto3_TestAllTypes.NestedEnum = .zero
- var _optionalForeignEnum: SwiftProtoTesting_Proto3_ForeignEnum = .foreignZero
- var _optionalStringPiece: String = String()
- var _optionalCord: String = String()
- var _optionalPublicImportMessage: SwiftProtoTesting_Import_PublicImportMessage? = nil
- var _optionalLazyMessage: SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage? = nil
- var _optionalUnverifiedLazyMessage: SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage? = nil
- var _optionalLazyImportMessage: SwiftProtoTesting_Import_ImportMessage? = nil
- var _repeatedInt32: [Int32] = []
- var _repeatedInt64: [Int64] = []
- var _repeatedUint32: [UInt32] = []
- var _repeatedUint64: [UInt64] = []
- var _repeatedSint32: [Int32] = []
- var _repeatedSint64: [Int64] = []
- var _repeatedFixed32: [UInt32] = []
- var _repeatedFixed64: [UInt64] = []
- var _repeatedSfixed32: [Int32] = []
- var _repeatedSfixed64: [Int64] = []
- var _repeatedFloat: [Float] = []
- var _repeatedDouble: [Double] = []
- var _repeatedBool: [Bool] = []
- var _repeatedString: [String] = []
- var _repeatedBytes: [Data] = []
- var _repeatedNestedMessage: [SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage] = []
- var _repeatedForeignMessage: [SwiftProtoTesting_Proto3_ForeignMessage] = []
- var _repeatedImportMessage: [SwiftProtoTesting_Import_ImportMessage] = []
- var _repeatedNestedEnum: [SwiftProtoTesting_Proto3_TestAllTypes.NestedEnum] = []
- var _repeatedForeignEnum: [SwiftProtoTesting_Proto3_ForeignEnum] = []
- var _repeatedStringPiece: [String] = []
- var _repeatedCord: [String] = []
- var _repeatedLazyMessage: [SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage] = []
- var _oneofField: SwiftProtoTesting_Proto3_TestAllTypes.OneOf_OneofField?
- // This property is used as the initial default value for new instances of the type.
- // The type itself is protecting the reference to its storage via CoW semantics.
- // This will force a copy to be made of this reference when the first mutation occurs;
- // hence, it is safe to mark this as `nonisolated(unsafe)`.
- static nonisolated(unsafe) let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _optionalInt32 = source._optionalInt32
- _optionalInt64 = source._optionalInt64
- _optionalUint32 = source._optionalUint32
- _optionalUint64 = source._optionalUint64
- _optionalSint32 = source._optionalSint32
- _optionalSint64 = source._optionalSint64
- _optionalFixed32 = source._optionalFixed32
- _optionalFixed64 = source._optionalFixed64
- _optionalSfixed32 = source._optionalSfixed32
- _optionalSfixed64 = source._optionalSfixed64
- _optionalFloat = source._optionalFloat
- _optionalDouble = source._optionalDouble
- _optionalBool = source._optionalBool
- _optionalString = source._optionalString
- _optionalBytes = source._optionalBytes
- _optionalNestedMessage = source._optionalNestedMessage
- _optionalForeignMessage = source._optionalForeignMessage
- _optionalImportMessage = source._optionalImportMessage
- _optionalNestedEnum = source._optionalNestedEnum
- _optionalForeignEnum = source._optionalForeignEnum
- _optionalStringPiece = source._optionalStringPiece
- _optionalCord = source._optionalCord
- _optionalPublicImportMessage = source._optionalPublicImportMessage
- _optionalLazyMessage = source._optionalLazyMessage
- _optionalUnverifiedLazyMessage = source._optionalUnverifiedLazyMessage
- _optionalLazyImportMessage = source._optionalLazyImportMessage
- _repeatedInt32 = source._repeatedInt32
- _repeatedInt64 = source._repeatedInt64
- _repeatedUint32 = source._repeatedUint32
- _repeatedUint64 = source._repeatedUint64
- _repeatedSint32 = source._repeatedSint32
- _repeatedSint64 = source._repeatedSint64
- _repeatedFixed32 = source._repeatedFixed32
- _repeatedFixed64 = source._repeatedFixed64
- _repeatedSfixed32 = source._repeatedSfixed32
- _repeatedSfixed64 = source._repeatedSfixed64
- _repeatedFloat = source._repeatedFloat
- _repeatedDouble = source._repeatedDouble
- _repeatedBool = source._repeatedBool
- _repeatedString = source._repeatedString
- _repeatedBytes = source._repeatedBytes
- _repeatedNestedMessage = source._repeatedNestedMessage
- _repeatedForeignMessage = source._repeatedForeignMessage
- _repeatedImportMessage = source._repeatedImportMessage
- _repeatedNestedEnum = source._repeatedNestedEnum
- _repeatedForeignEnum = source._repeatedForeignEnum
- _repeatedStringPiece = source._repeatedStringPiece
- _repeatedCord = source._repeatedCord
- _repeatedLazyMessage = source._repeatedLazyMessage
- _oneofField = source._oneofField
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- 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: &_storage._optionalInt32) }()
- case 2: try { try decoder.decodeSingularInt64Field(value: &_storage._optionalInt64) }()
- case 3: try { try decoder.decodeSingularUInt32Field(value: &_storage._optionalUint32) }()
- case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._optionalUint64) }()
- case 5: try { try decoder.decodeSingularSInt32Field(value: &_storage._optionalSint32) }()
- case 6: try { try decoder.decodeSingularSInt64Field(value: &_storage._optionalSint64) }()
- case 7: try { try decoder.decodeSingularFixed32Field(value: &_storage._optionalFixed32) }()
- case 8: try { try decoder.decodeSingularFixed64Field(value: &_storage._optionalFixed64) }()
- case 9: try { try decoder.decodeSingularSFixed32Field(value: &_storage._optionalSfixed32) }()
- case 10: try { try decoder.decodeSingularSFixed64Field(value: &_storage._optionalSfixed64) }()
- case 11: try { try decoder.decodeSingularFloatField(value: &_storage._optionalFloat) }()
- case 12: try { try decoder.decodeSingularDoubleField(value: &_storage._optionalDouble) }()
- case 13: try { try decoder.decodeSingularBoolField(value: &_storage._optionalBool) }()
- case 14: try { try decoder.decodeSingularStringField(value: &_storage._optionalString) }()
- case 15: try { try decoder.decodeSingularBytesField(value: &_storage._optionalBytes) }()
- case 18: try { try decoder.decodeSingularMessageField(value: &_storage._optionalNestedMessage) }()
- case 19: try { try decoder.decodeSingularMessageField(value: &_storage._optionalForeignMessage) }()
- case 20: try { try decoder.decodeSingularMessageField(value: &_storage._optionalImportMessage) }()
- case 21: try { try decoder.decodeSingularEnumField(value: &_storage._optionalNestedEnum) }()
- case 22: try { try decoder.decodeSingularEnumField(value: &_storage._optionalForeignEnum) }()
- case 24: try { try decoder.decodeSingularStringField(value: &_storage._optionalStringPiece) }()
- case 25: try { try decoder.decodeSingularStringField(value: &_storage._optionalCord) }()
- case 26: try { try decoder.decodeSingularMessageField(value: &_storage._optionalPublicImportMessage) }()
- case 27: try { try decoder.decodeSingularMessageField(value: &_storage._optionalLazyMessage) }()
- case 28: try { try decoder.decodeSingularMessageField(value: &_storage._optionalUnverifiedLazyMessage) }()
- case 31: try { try decoder.decodeRepeatedInt32Field(value: &_storage._repeatedInt32) }()
- case 32: try { try decoder.decodeRepeatedInt64Field(value: &_storage._repeatedInt64) }()
- case 33: try { try decoder.decodeRepeatedUInt32Field(value: &_storage._repeatedUint32) }()
- case 34: try { try decoder.decodeRepeatedUInt64Field(value: &_storage._repeatedUint64) }()
- case 35: try { try decoder.decodeRepeatedSInt32Field(value: &_storage._repeatedSint32) }()
- case 36: try { try decoder.decodeRepeatedSInt64Field(value: &_storage._repeatedSint64) }()
- case 37: try { try decoder.decodeRepeatedFixed32Field(value: &_storage._repeatedFixed32) }()
- case 38: try { try decoder.decodeRepeatedFixed64Field(value: &_storage._repeatedFixed64) }()
- case 39: try { try decoder.decodeRepeatedSFixed32Field(value: &_storage._repeatedSfixed32) }()
- case 40: try { try decoder.decodeRepeatedSFixed64Field(value: &_storage._repeatedSfixed64) }()
- case 41: try { try decoder.decodeRepeatedFloatField(value: &_storage._repeatedFloat) }()
- case 42: try { try decoder.decodeRepeatedDoubleField(value: &_storage._repeatedDouble) }()
- case 43: try { try decoder.decodeRepeatedBoolField(value: &_storage._repeatedBool) }()
- case 44: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedString) }()
- case 45: try { try decoder.decodeRepeatedBytesField(value: &_storage._repeatedBytes) }()
- case 48: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedNestedMessage) }()
- case 49: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedForeignMessage) }()
- case 50: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedImportMessage) }()
- case 51: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedNestedEnum) }()
- case 52: try { try decoder.decodeRepeatedEnumField(value: &_storage._repeatedForeignEnum) }()
- case 54: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedStringPiece) }()
- case 55: try { try decoder.decodeRepeatedStringField(value: &_storage._repeatedCord) }()
- case 57: try { try decoder.decodeRepeatedMessageField(value: &_storage._repeatedLazyMessage) }()
- case 111: try {
- var v: UInt32?
- try decoder.decodeSingularUInt32Field(value: &v)
- if let v = v {
- if _storage._oneofField != nil {try decoder.handleConflictingOneOf()}
- _storage._oneofField = .oneofUint32(v)
- }
- }()
- case 112: try {
- var v: SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage?
- var hadOneofValue = false
- if let current = _storage._oneofField {
- hadOneofValue = true
- if case .oneofNestedMessage(let m) = current {v = m}
- }
- try decoder.decodeSingularMessageField(value: &v)
- if let v = v {
- if hadOneofValue {try decoder.handleConflictingOneOf()}
- _storage._oneofField = .oneofNestedMessage(v)
- }
- }()
- case 113: try {
- var v: String?
- try decoder.decodeSingularStringField(value: &v)
- if let v = v {
- if _storage._oneofField != nil {try decoder.handleConflictingOneOf()}
- _storage._oneofField = .oneofString(v)
- }
- }()
- case 114: try {
- var v: Data?
- try decoder.decodeSingularBytesField(value: &v)
- if let v = v {
- if _storage._oneofField != nil {try decoder.handleConflictingOneOf()}
- _storage._oneofField = .oneofBytes(v)
- }
- }()
- case 115: try { try decoder.decodeSingularMessageField(value: &_storage._optionalLazyImportMessage) }()
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- // 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
- if _storage._optionalInt32 != 0 {
- try visitor.visitSingularInt32Field(value: _storage._optionalInt32, fieldNumber: 1)
- }
- if _storage._optionalInt64 != 0 {
- try visitor.visitSingularInt64Field(value: _storage._optionalInt64, fieldNumber: 2)
- }
- if _storage._optionalUint32 != 0 {
- try visitor.visitSingularUInt32Field(value: _storage._optionalUint32, fieldNumber: 3)
- }
- if _storage._optionalUint64 != 0 {
- try visitor.visitSingularUInt64Field(value: _storage._optionalUint64, fieldNumber: 4)
- }
- if _storage._optionalSint32 != 0 {
- try visitor.visitSingularSInt32Field(value: _storage._optionalSint32, fieldNumber: 5)
- }
- if _storage._optionalSint64 != 0 {
- try visitor.visitSingularSInt64Field(value: _storage._optionalSint64, fieldNumber: 6)
- }
- if _storage._optionalFixed32 != 0 {
- try visitor.visitSingularFixed32Field(value: _storage._optionalFixed32, fieldNumber: 7)
- }
- if _storage._optionalFixed64 != 0 {
- try visitor.visitSingularFixed64Field(value: _storage._optionalFixed64, fieldNumber: 8)
- }
- if _storage._optionalSfixed32 != 0 {
- try visitor.visitSingularSFixed32Field(value: _storage._optionalSfixed32, fieldNumber: 9)
- }
- if _storage._optionalSfixed64 != 0 {
- try visitor.visitSingularSFixed64Field(value: _storage._optionalSfixed64, fieldNumber: 10)
- }
- if _storage._optionalFloat.bitPattern != 0 {
- try visitor.visitSingularFloatField(value: _storage._optionalFloat, fieldNumber: 11)
- }
- if _storage._optionalDouble.bitPattern != 0 {
- try visitor.visitSingularDoubleField(value: _storage._optionalDouble, fieldNumber: 12)
- }
- if _storage._optionalBool != false {
- try visitor.visitSingularBoolField(value: _storage._optionalBool, fieldNumber: 13)
- }
- if !_storage._optionalString.isEmpty {
- try visitor.visitSingularStringField(value: _storage._optionalString, fieldNumber: 14)
- }
- if !_storage._optionalBytes.isEmpty {
- try visitor.visitSingularBytesField(value: _storage._optionalBytes, fieldNumber: 15)
- }
- try { if let v = _storage._optionalNestedMessage {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 18)
- } }()
- try { if let v = _storage._optionalForeignMessage {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 19)
- } }()
- try { if let v = _storage._optionalImportMessage {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 20)
- } }()
- if _storage._optionalNestedEnum != .zero {
- try visitor.visitSingularEnumField(value: _storage._optionalNestedEnum, fieldNumber: 21)
- }
- if _storage._optionalForeignEnum != .foreignZero {
- try visitor.visitSingularEnumField(value: _storage._optionalForeignEnum, fieldNumber: 22)
- }
- if !_storage._optionalStringPiece.isEmpty {
- try visitor.visitSingularStringField(value: _storage._optionalStringPiece, fieldNumber: 24)
- }
- if !_storage._optionalCord.isEmpty {
- try visitor.visitSingularStringField(value: _storage._optionalCord, fieldNumber: 25)
- }
- try { if let v = _storage._optionalPublicImportMessage {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 26)
- } }()
- try { if let v = _storage._optionalLazyMessage {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 27)
- } }()
- try { if let v = _storage._optionalUnverifiedLazyMessage {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 28)
- } }()
- if !_storage._repeatedInt32.isEmpty {
- try visitor.visitPackedInt32Field(value: _storage._repeatedInt32, fieldNumber: 31)
- }
- if !_storage._repeatedInt64.isEmpty {
- try visitor.visitPackedInt64Field(value: _storage._repeatedInt64, fieldNumber: 32)
- }
- if !_storage._repeatedUint32.isEmpty {
- try visitor.visitPackedUInt32Field(value: _storage._repeatedUint32, fieldNumber: 33)
- }
- if !_storage._repeatedUint64.isEmpty {
- try visitor.visitPackedUInt64Field(value: _storage._repeatedUint64, fieldNumber: 34)
- }
- if !_storage._repeatedSint32.isEmpty {
- try visitor.visitPackedSInt32Field(value: _storage._repeatedSint32, fieldNumber: 35)
- }
- if !_storage._repeatedSint64.isEmpty {
- try visitor.visitPackedSInt64Field(value: _storage._repeatedSint64, fieldNumber: 36)
- }
- if !_storage._repeatedFixed32.isEmpty {
- try visitor.visitPackedFixed32Field(value: _storage._repeatedFixed32, fieldNumber: 37)
- }
- if !_storage._repeatedFixed64.isEmpty {
- try visitor.visitPackedFixed64Field(value: _storage._repeatedFixed64, fieldNumber: 38)
- }
- if !_storage._repeatedSfixed32.isEmpty {
- try visitor.visitPackedSFixed32Field(value: _storage._repeatedSfixed32, fieldNumber: 39)
- }
- if !_storage._repeatedSfixed64.isEmpty {
- try visitor.visitPackedSFixed64Field(value: _storage._repeatedSfixed64, fieldNumber: 40)
- }
- if !_storage._repeatedFloat.isEmpty {
- try visitor.visitPackedFloatField(value: _storage._repeatedFloat, fieldNumber: 41)
- }
- if !_storage._repeatedDouble.isEmpty {
- try visitor.visitPackedDoubleField(value: _storage._repeatedDouble, fieldNumber: 42)
- }
- if !_storage._repeatedBool.isEmpty {
- try visitor.visitPackedBoolField(value: _storage._repeatedBool, fieldNumber: 43)
- }
- if !_storage._repeatedString.isEmpty {
- try visitor.visitRepeatedStringField(value: _storage._repeatedString, fieldNumber: 44)
- }
- if !_storage._repeatedBytes.isEmpty {
- try visitor.visitRepeatedBytesField(value: _storage._repeatedBytes, fieldNumber: 45)
- }
- if !_storage._repeatedNestedMessage.isEmpty {
- try visitor.visitRepeatedMessageField(value: _storage._repeatedNestedMessage, fieldNumber: 48)
- }
- if !_storage._repeatedForeignMessage.isEmpty {
- try visitor.visitRepeatedMessageField(value: _storage._repeatedForeignMessage, fieldNumber: 49)
- }
- if !_storage._repeatedImportMessage.isEmpty {
- try visitor.visitRepeatedMessageField(value: _storage._repeatedImportMessage, fieldNumber: 50)
- }
- if !_storage._repeatedNestedEnum.isEmpty {
- try visitor.visitPackedEnumField(value: _storage._repeatedNestedEnum, fieldNumber: 51)
- }
- if !_storage._repeatedForeignEnum.isEmpty {
- try visitor.visitPackedEnumField(value: _storage._repeatedForeignEnum, fieldNumber: 52)
- }
- if !_storage._repeatedStringPiece.isEmpty {
- try visitor.visitRepeatedStringField(value: _storage._repeatedStringPiece, fieldNumber: 54)
- }
- if !_storage._repeatedCord.isEmpty {
- try visitor.visitRepeatedStringField(value: _storage._repeatedCord, fieldNumber: 55)
- }
- if !_storage._repeatedLazyMessage.isEmpty {
- try visitor.visitRepeatedMessageField(value: _storage._repeatedLazyMessage, fieldNumber: 57)
- }
- switch _storage._oneofField {
- case .oneofUint32?: try {
- guard case .oneofUint32(let v)? = _storage._oneofField else { preconditionFailure() }
- try visitor.visitSingularUInt32Field(value: v, fieldNumber: 111)
- }()
- case .oneofNestedMessage?: try {
- guard case .oneofNestedMessage(let v)? = _storage._oneofField else { preconditionFailure() }
- try visitor.visitSingularMessageField(value: v, fieldNumber: 112)
- }()
- case .oneofString?: try {
- guard case .oneofString(let v)? = _storage._oneofField else { preconditionFailure() }
- try visitor.visitSingularStringField(value: v, fieldNumber: 113)
- }()
- case .oneofBytes?: try {
- guard case .oneofBytes(let v)? = _storage._oneofField else { preconditionFailure() }
- try visitor.visitSingularBytesField(value: v, fieldNumber: 114)
- }()
- case nil: break
- }
- try { if let v = _storage._optionalLazyImportMessage {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 115)
- } }()
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: SwiftProtoTesting_Proto3_TestAllTypes, rhs: SwiftProtoTesting_Proto3_TestAllTypes) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._optionalInt32 != rhs_storage._optionalInt32 {return false}
- if _storage._optionalInt64 != rhs_storage._optionalInt64 {return false}
- if _storage._optionalUint32 != rhs_storage._optionalUint32 {return false}
- if _storage._optionalUint64 != rhs_storage._optionalUint64 {return false}
- if _storage._optionalSint32 != rhs_storage._optionalSint32 {return false}
- if _storage._optionalSint64 != rhs_storage._optionalSint64 {return false}
- if _storage._optionalFixed32 != rhs_storage._optionalFixed32 {return false}
- if _storage._optionalFixed64 != rhs_storage._optionalFixed64 {return false}
- if _storage._optionalSfixed32 != rhs_storage._optionalSfixed32 {return false}
- if _storage._optionalSfixed64 != rhs_storage._optionalSfixed64 {return false}
- if _storage._optionalFloat != rhs_storage._optionalFloat {return false}
- if _storage._optionalDouble != rhs_storage._optionalDouble {return false}
- if _storage._optionalBool != rhs_storage._optionalBool {return false}
- if _storage._optionalString != rhs_storage._optionalString {return false}
- if _storage._optionalBytes != rhs_storage._optionalBytes {return false}
- if _storage._optionalNestedMessage != rhs_storage._optionalNestedMessage {return false}
- if _storage._optionalForeignMessage != rhs_storage._optionalForeignMessage {return false}
- if _storage._optionalImportMessage != rhs_storage._optionalImportMessage {return false}
- if _storage._optionalNestedEnum != rhs_storage._optionalNestedEnum {return false}
- if _storage._optionalForeignEnum != rhs_storage._optionalForeignEnum {return false}
- if _storage._optionalStringPiece != rhs_storage._optionalStringPiece {return false}
- if _storage._optionalCord != rhs_storage._optionalCord {return false}
- if _storage._optionalPublicImportMessage != rhs_storage._optionalPublicImportMessage {return false}
- if _storage._optionalLazyMessage != rhs_storage._optionalLazyMessage {return false}
- if _storage._optionalUnverifiedLazyMessage != rhs_storage._optionalUnverifiedLazyMessage {return false}
- if _storage._optionalLazyImportMessage != rhs_storage._optionalLazyImportMessage {return false}
- if _storage._repeatedInt32 != rhs_storage._repeatedInt32 {return false}
- if _storage._repeatedInt64 != rhs_storage._repeatedInt64 {return false}
- if _storage._repeatedUint32 != rhs_storage._repeatedUint32 {return false}
- if _storage._repeatedUint64 != rhs_storage._repeatedUint64 {return false}
- if _storage._repeatedSint32 != rhs_storage._repeatedSint32 {return false}
- if _storage._repeatedSint64 != rhs_storage._repeatedSint64 {return false}
- if _storage._repeatedFixed32 != rhs_storage._repeatedFixed32 {return false}
- if _storage._repeatedFixed64 != rhs_storage._repeatedFixed64 {return false}
- if _storage._repeatedSfixed32 != rhs_storage._repeatedSfixed32 {return false}
- if _storage._repeatedSfixed64 != rhs_storage._repeatedSfixed64 {return false}
- if _storage._repeatedFloat != rhs_storage._repeatedFloat {return false}
- if _storage._repeatedDouble != rhs_storage._repeatedDouble {return false}
- if _storage._repeatedBool != rhs_storage._repeatedBool {return false}
- if _storage._repeatedString != rhs_storage._repeatedString {return false}
- if _storage._repeatedBytes != rhs_storage._repeatedBytes {return false}
- if _storage._repeatedNestedMessage != rhs_storage._repeatedNestedMessage {return false}
- if _storage._repeatedForeignMessage != rhs_storage._repeatedForeignMessage {return false}
- if _storage._repeatedImportMessage != rhs_storage._repeatedImportMessage {return false}
- if _storage._repeatedNestedEnum != rhs_storage._repeatedNestedEnum {return false}
- if _storage._repeatedForeignEnum != rhs_storage._repeatedForeignEnum {return false}
- if _storage._repeatedStringPiece != rhs_storage._repeatedStringPiece {return false}
- if _storage._repeatedCord != rhs_storage._repeatedCord {return false}
- if _storage._repeatedLazyMessage != rhs_storage._repeatedLazyMessage {return false}
- if _storage._oneofField != rhs_storage._oneofField {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension SwiftProtoTesting_Proto3_TestAllTypes.NestedEnum: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- -1: .same(proto: "NEG"),
- 0: .same(proto: "ZERO"),
- 1: .same(proto: "FOO"),
- 2: .same(proto: "BAR"),
- 3: .same(proto: "BAZ"),
- ]
- }
- extension SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = SwiftProtoTesting_Proto3_TestAllTypes.protoMessageName + ".NestedMessage"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "bb"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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.bb) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if self.bb != 0 {
- try visitor.visitSingularInt32Field(value: self.bb, fieldNumber: 1)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage, rhs: SwiftProtoTesting_Proto3_TestAllTypes.NestedMessage) -> Bool {
- if lhs.bb != rhs.bb {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension SwiftProtoTesting_Proto3_TestPackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestPackedTypes"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 90: .standard(proto: "packed_int32"),
- 91: .standard(proto: "packed_int64"),
- 92: .standard(proto: "packed_uint32"),
- 93: .standard(proto: "packed_uint64"),
- 94: .standard(proto: "packed_sint32"),
- 95: .standard(proto: "packed_sint64"),
- 96: .standard(proto: "packed_fixed32"),
- 97: .standard(proto: "packed_fixed64"),
- 98: .standard(proto: "packed_sfixed32"),
- 99: .standard(proto: "packed_sfixed64"),
- 100: .standard(proto: "packed_float"),
- 101: .standard(proto: "packed_double"),
- 102: .standard(proto: "packed_bool"),
- 103: .standard(proto: "packed_enum"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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 90: try { try decoder.decodeRepeatedInt32Field(value: &self.packedInt32) }()
- case 91: try { try decoder.decodeRepeatedInt64Field(value: &self.packedInt64) }()
- case 92: try { try decoder.decodeRepeatedUInt32Field(value: &self.packedUint32) }()
- case 93: try { try decoder.decodeRepeatedUInt64Field(value: &self.packedUint64) }()
- case 94: try { try decoder.decodeRepeatedSInt32Field(value: &self.packedSint32) }()
- case 95: try { try decoder.decodeRepeatedSInt64Field(value: &self.packedSint64) }()
- case 96: try { try decoder.decodeRepeatedFixed32Field(value: &self.packedFixed32) }()
- case 97: try { try decoder.decodeRepeatedFixed64Field(value: &self.packedFixed64) }()
- case 98: try { try decoder.decodeRepeatedSFixed32Field(value: &self.packedSfixed32) }()
- case 99: try { try decoder.decodeRepeatedSFixed64Field(value: &self.packedSfixed64) }()
- case 100: try { try decoder.decodeRepeatedFloatField(value: &self.packedFloat) }()
- case 101: try { try decoder.decodeRepeatedDoubleField(value: &self.packedDouble) }()
- case 102: try { try decoder.decodeRepeatedBoolField(value: &self.packedBool) }()
- case 103: try { try decoder.decodeRepeatedEnumField(value: &self.packedEnum) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.packedInt32.isEmpty {
- try visitor.visitPackedInt32Field(value: self.packedInt32, fieldNumber: 90)
- }
- if !self.packedInt64.isEmpty {
- try visitor.visitPackedInt64Field(value: self.packedInt64, fieldNumber: 91)
- }
- if !self.packedUint32.isEmpty {
- try visitor.visitPackedUInt32Field(value: self.packedUint32, fieldNumber: 92)
- }
- if !self.packedUint64.isEmpty {
- try visitor.visitPackedUInt64Field(value: self.packedUint64, fieldNumber: 93)
- }
- if !self.packedSint32.isEmpty {
- try visitor.visitPackedSInt32Field(value: self.packedSint32, fieldNumber: 94)
- }
- if !self.packedSint64.isEmpty {
- try visitor.visitPackedSInt64Field(value: self.packedSint64, fieldNumber: 95)
- }
- if !self.packedFixed32.isEmpty {
- try visitor.visitPackedFixed32Field(value: self.packedFixed32, fieldNumber: 96)
- }
- if !self.packedFixed64.isEmpty {
- try visitor.visitPackedFixed64Field(value: self.packedFixed64, fieldNumber: 97)
- }
- if !self.packedSfixed32.isEmpty {
- try visitor.visitPackedSFixed32Field(value: self.packedSfixed32, fieldNumber: 98)
- }
- if !self.packedSfixed64.isEmpty {
- try visitor.visitPackedSFixed64Field(value: self.packedSfixed64, fieldNumber: 99)
- }
- if !self.packedFloat.isEmpty {
- try visitor.visitPackedFloatField(value: self.packedFloat, fieldNumber: 100)
- }
- if !self.packedDouble.isEmpty {
- try visitor.visitPackedDoubleField(value: self.packedDouble, fieldNumber: 101)
- }
- if !self.packedBool.isEmpty {
- try visitor.visitPackedBoolField(value: self.packedBool, fieldNumber: 102)
- }
- if !self.packedEnum.isEmpty {
- try visitor.visitPackedEnumField(value: self.packedEnum, fieldNumber: 103)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: SwiftProtoTesting_Proto3_TestPackedTypes, rhs: SwiftProtoTesting_Proto3_TestPackedTypes) -> Bool {
- if lhs.packedInt32 != rhs.packedInt32 {return false}
- if lhs.packedInt64 != rhs.packedInt64 {return false}
- if lhs.packedUint32 != rhs.packedUint32 {return false}
- if lhs.packedUint64 != rhs.packedUint64 {return false}
- if lhs.packedSint32 != rhs.packedSint32 {return false}
- if lhs.packedSint64 != rhs.packedSint64 {return false}
- if lhs.packedFixed32 != rhs.packedFixed32 {return false}
- if lhs.packedFixed64 != rhs.packedFixed64 {return false}
- if lhs.packedSfixed32 != rhs.packedSfixed32 {return false}
- if lhs.packedSfixed64 != rhs.packedSfixed64 {return false}
- if lhs.packedFloat != rhs.packedFloat {return false}
- if lhs.packedDouble != rhs.packedDouble {return false}
- if lhs.packedBool != rhs.packedBool {return false}
- if lhs.packedEnum != rhs.packedEnum {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension SwiftProtoTesting_Proto3_TestUnpackedTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestUnpackedTypes"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .standard(proto: "repeated_int32"),
- 2: .standard(proto: "repeated_int64"),
- 3: .standard(proto: "repeated_uint32"),
- 4: .standard(proto: "repeated_uint64"),
- 5: .standard(proto: "repeated_sint32"),
- 6: .standard(proto: "repeated_sint64"),
- 7: .standard(proto: "repeated_fixed32"),
- 8: .standard(proto: "repeated_fixed64"),
- 9: .standard(proto: "repeated_sfixed32"),
- 10: .standard(proto: "repeated_sfixed64"),
- 11: .standard(proto: "repeated_float"),
- 12: .standard(proto: "repeated_double"),
- 13: .standard(proto: "repeated_bool"),
- 14: .standard(proto: "repeated_nested_enum"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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.decodeRepeatedInt32Field(value: &self.repeatedInt32) }()
- case 2: try { try decoder.decodeRepeatedInt64Field(value: &self.repeatedInt64) }()
- case 3: try { try decoder.decodeRepeatedUInt32Field(value: &self.repeatedUint32) }()
- case 4: try { try decoder.decodeRepeatedUInt64Field(value: &self.repeatedUint64) }()
- case 5: try { try decoder.decodeRepeatedSInt32Field(value: &self.repeatedSint32) }()
- case 6: try { try decoder.decodeRepeatedSInt64Field(value: &self.repeatedSint64) }()
- case 7: try { try decoder.decodeRepeatedFixed32Field(value: &self.repeatedFixed32) }()
- case 8: try { try decoder.decodeRepeatedFixed64Field(value: &self.repeatedFixed64) }()
- case 9: try { try decoder.decodeRepeatedSFixed32Field(value: &self.repeatedSfixed32) }()
- case 10: try { try decoder.decodeRepeatedSFixed64Field(value: &self.repeatedSfixed64) }()
- case 11: try { try decoder.decodeRepeatedFloatField(value: &self.repeatedFloat) }()
- case 12: try { try decoder.decodeRepeatedDoubleField(value: &self.repeatedDouble) }()
- case 13: try { try decoder.decodeRepeatedBoolField(value: &self.repeatedBool) }()
- case 14: try { try decoder.decodeRepeatedEnumField(value: &self.repeatedNestedEnum) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if !self.repeatedInt32.isEmpty {
- try visitor.visitRepeatedInt32Field(value: self.repeatedInt32, fieldNumber: 1)
- }
- if !self.repeatedInt64.isEmpty {
- try visitor.visitRepeatedInt64Field(value: self.repeatedInt64, fieldNumber: 2)
- }
- if !self.repeatedUint32.isEmpty {
- try visitor.visitRepeatedUInt32Field(value: self.repeatedUint32, fieldNumber: 3)
- }
- if !self.repeatedUint64.isEmpty {
- try visitor.visitRepeatedUInt64Field(value: self.repeatedUint64, fieldNumber: 4)
- }
- if !self.repeatedSint32.isEmpty {
- try visitor.visitRepeatedSInt32Field(value: self.repeatedSint32, fieldNumber: 5)
- }
- if !self.repeatedSint64.isEmpty {
- try visitor.visitRepeatedSInt64Field(value: self.repeatedSint64, fieldNumber: 6)
- }
- if !self.repeatedFixed32.isEmpty {
- try visitor.visitRepeatedFixed32Field(value: self.repeatedFixed32, fieldNumber: 7)
- }
- if !self.repeatedFixed64.isEmpty {
- try visitor.visitRepeatedFixed64Field(value: self.repeatedFixed64, fieldNumber: 8)
- }
- if !self.repeatedSfixed32.isEmpty {
- try visitor.visitRepeatedSFixed32Field(value: self.repeatedSfixed32, fieldNumber: 9)
- }
- if !self.repeatedSfixed64.isEmpty {
- try visitor.visitRepeatedSFixed64Field(value: self.repeatedSfixed64, fieldNumber: 10)
- }
- if !self.repeatedFloat.isEmpty {
- try visitor.visitRepeatedFloatField(value: self.repeatedFloat, fieldNumber: 11)
- }
- if !self.repeatedDouble.isEmpty {
- try visitor.visitRepeatedDoubleField(value: self.repeatedDouble, fieldNumber: 12)
- }
- if !self.repeatedBool.isEmpty {
- try visitor.visitRepeatedBoolField(value: self.repeatedBool, fieldNumber: 13)
- }
- if !self.repeatedNestedEnum.isEmpty {
- try visitor.visitRepeatedEnumField(value: self.repeatedNestedEnum, fieldNumber: 14)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: SwiftProtoTesting_Proto3_TestUnpackedTypes, rhs: SwiftProtoTesting_Proto3_TestUnpackedTypes) -> Bool {
- if lhs.repeatedInt32 != rhs.repeatedInt32 {return false}
- if lhs.repeatedInt64 != rhs.repeatedInt64 {return false}
- if lhs.repeatedUint32 != rhs.repeatedUint32 {return false}
- if lhs.repeatedUint64 != rhs.repeatedUint64 {return false}
- if lhs.repeatedSint32 != rhs.repeatedSint32 {return false}
- if lhs.repeatedSint64 != rhs.repeatedSint64 {return false}
- if lhs.repeatedFixed32 != rhs.repeatedFixed32 {return false}
- if lhs.repeatedFixed64 != rhs.repeatedFixed64 {return false}
- if lhs.repeatedSfixed32 != rhs.repeatedSfixed32 {return false}
- if lhs.repeatedSfixed64 != rhs.repeatedSfixed64 {return false}
- if lhs.repeatedFloat != rhs.repeatedFloat {return false}
- if lhs.repeatedDouble != rhs.repeatedDouble {return false}
- if lhs.repeatedBool != rhs.repeatedBool {return false}
- if lhs.repeatedNestedEnum != rhs.repeatedNestedEnum {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension SwiftProtoTesting_Proto3_NestedTestAllTypes: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".NestedTestAllTypes"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "child"),
- 2: .same(proto: "payload"),
- ]
- fileprivate class _StorageClass {
- var _child: SwiftProtoTesting_Proto3_NestedTestAllTypes? = nil
- var _payload: SwiftProtoTesting_Proto3_TestAllTypes? = nil
- // This property is used as the initial default value for new instances of the type.
- // The type itself is protecting the reference to its storage via CoW semantics.
- // This will force a copy to be made of this reference when the first mutation occurs;
- // hence, it is safe to mark this as `nonisolated(unsafe)`.
- static nonisolated(unsafe) let defaultInstance = _StorageClass()
- private init() {}
- init(copying source: _StorageClass) {
- _child = source._child
- _payload = source._payload
- }
- }
- fileprivate mutating func _uniqueStorage() -> _StorageClass {
- if !isKnownUniquelyReferenced(&_storage) {
- _storage = _StorageClass(copying: _storage)
- }
- return _storage
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- _ = _uniqueStorage()
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- 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: &_storage._child) }()
- case 2: try { try decoder.decodeSingularMessageField(value: &_storage._payload) }()
- default: break
- }
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try withExtendedLifetime(_storage) { (_storage: _StorageClass) in
- // 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 = _storage._child {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- try { if let v = _storage._payload {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
- } }()
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: SwiftProtoTesting_Proto3_NestedTestAllTypes, rhs: SwiftProtoTesting_Proto3_NestedTestAllTypes) -> Bool {
- if lhs._storage !== rhs._storage {
- let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in
- let _storage = _args.0
- let rhs_storage = _args.1
- if _storage._child != rhs_storage._child {return false}
- if _storage._payload != rhs_storage._payload {return false}
- return true
- }
- if !storagesAreEqual {return false}
- }
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension SwiftProtoTesting_Proto3_ForeignMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".ForeignMessage"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "c"),
- ]
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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.c) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- if self.c != 0 {
- try visitor.visitSingularInt32Field(value: self.c, fieldNumber: 1)
- }
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: SwiftProtoTesting_Proto3_ForeignMessage, rhs: SwiftProtoTesting_Proto3_ForeignMessage) -> Bool {
- if lhs.c != rhs.c {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension SwiftProtoTesting_Proto3_TestEmptyMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestEmptyMessage"
- static let _protobuf_nameMap = SwiftProtobuf._NameMap()
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- // Load everything into unknown fields
- while try decoder.nextFieldNumber() != nil {}
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: SwiftProtoTesting_Proto3_TestEmptyMessage, rhs: SwiftProtoTesting_Proto3_TestEmptyMessage) -> Bool {
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension SwiftProtoTesting_Proto3_TestProto2Required: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".TestProto2Required"
- static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
- 1: .same(proto: "proto2"),
- ]
- public var isInitialized: Bool {
- if let v = self._proto2, !v.isInitialized {return false}
- return true
- }
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(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._proto2) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(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._proto2 {
- try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
- } }()
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: SwiftProtoTesting_Proto3_TestProto2Required, rhs: SwiftProtoTesting_Proto3_TestProto2Required) -> Bool {
- if lhs._proto2 != rhs._proto2 {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
|