From e8ea41be7f76b3d6b88d76181a2b51684d9b9cd8 Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Thu, 27 Jun 2024 10:21:41 -0400 Subject: [PATCH] Regenerate. --- .../conformance/conformance.pb.swift | 4 +- .../upstream/conformance/conformance.pb.swift | 4 +- .../protobuf/unittest_string_type.pb.swift | 89 +++++++++++++++++++ Sources/Conformance/conformance.pb.swift | 4 +- 4 files changed, 95 insertions(+), 6 deletions(-) create mode 100644 Reference/upstream/google/protobuf/unittest_string_type.pb.swift diff --git a/Reference/Conformance/conformance/conformance.pb.swift b/Reference/Conformance/conformance/conformance.pb.swift index 51eafcdb6..8e67f9a9a 100644 --- a/Reference/Conformance/conformance/conformance.pb.swift +++ b/Reference/Conformance/conformance/conformance.pb.swift @@ -209,8 +209,8 @@ struct Conformance_ConformanceRequest: @unchecked Sendable { /// The full name for the test message to use; for the moment, either: /// protobuf_test_messages.proto3.TestAllTypesProto3 or - /// protobuf_test_messages.google.protobuf.TestAllTypesProto2 or - /// protobuf_test_messages.editions.google.protobuf.TestAllTypesProto2 or + /// protobuf_test_messages.proto2.TestAllTypesProto2 or + /// protobuf_test_messages.editions.proto2.TestAllTypesProto2 or /// protobuf_test_messages.editions.proto3.TestAllTypesProto3 or /// protobuf_test_messages.editions.TestAllTypesEdition2023. var messageType: String = String() diff --git a/Reference/upstream/conformance/conformance.pb.swift b/Reference/upstream/conformance/conformance.pb.swift index 51eafcdb6..8e67f9a9a 100644 --- a/Reference/upstream/conformance/conformance.pb.swift +++ b/Reference/upstream/conformance/conformance.pb.swift @@ -209,8 +209,8 @@ struct Conformance_ConformanceRequest: @unchecked Sendable { /// The full name for the test message to use; for the moment, either: /// protobuf_test_messages.proto3.TestAllTypesProto3 or - /// protobuf_test_messages.google.protobuf.TestAllTypesProto2 or - /// protobuf_test_messages.editions.google.protobuf.TestAllTypesProto2 or + /// protobuf_test_messages.proto2.TestAllTypesProto2 or + /// protobuf_test_messages.editions.proto2.TestAllTypesProto2 or /// protobuf_test_messages.editions.proto3.TestAllTypesProto3 or /// protobuf_test_messages.editions.TestAllTypesEdition2023. var messageType: String = String() diff --git a/Reference/upstream/google/protobuf/unittest_string_type.pb.swift b/Reference/upstream/google/protobuf/unittest_string_type.pb.swift new file mode 100644 index 000000000..ebc3ad23e --- /dev/null +++ b/Reference/upstream/google/protobuf/unittest_string_type.pb.swift @@ -0,0 +1,89 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: google/protobuf/unittest_string_type.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. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd + +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 +} + +struct ProtobufUnittest_EntryProto: @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 value: Data { + get {return _value ?? Data()} + set {_value = newValue} + } + /// Returns true if `value` has been explicitly set. + var hasValue: Bool {return self._value != nil} + /// Clears the value of `value`. Subsequent reads from it will return its default value. + mutating func clearValue() {self._value = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _value: Data? = nil +} + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +fileprivate let _protobuf_package = "protobuf_unittest" + +extension ProtobufUnittest_EntryProto: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".EntryProto" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 3: .same(proto: "value"), + ] + + 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 3: try { try decoder.decodeSingularBytesField(value: &self._value) }() + 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._value { + try visitor.visitSingularBytesField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: ProtobufUnittest_EntryProto, rhs: ProtobufUnittest_EntryProto) -> Bool { + if lhs._value != rhs._value {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/Sources/Conformance/conformance.pb.swift b/Sources/Conformance/conformance.pb.swift index 51eafcdb6..8e67f9a9a 100644 --- a/Sources/Conformance/conformance.pb.swift +++ b/Sources/Conformance/conformance.pb.swift @@ -209,8 +209,8 @@ struct Conformance_ConformanceRequest: @unchecked Sendable { /// The full name for the test message to use; for the moment, either: /// protobuf_test_messages.proto3.TestAllTypesProto3 or - /// protobuf_test_messages.google.protobuf.TestAllTypesProto2 or - /// protobuf_test_messages.editions.google.protobuf.TestAllTypesProto2 or + /// protobuf_test_messages.proto2.TestAllTypesProto2 or + /// protobuf_test_messages.editions.proto2.TestAllTypesProto2 or /// protobuf_test_messages.editions.proto3.TestAllTypesProto3 or /// protobuf_test_messages.editions.TestAllTypesEdition2023. var messageType: String = String()