unittest_import_public.pb.swift 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. // swiftlint:disable all
  4. //
  5. // Generated by the Swift generator plugin for the protocol buffer compiler.
  6. // Source: unittest_import_public.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. // Protocol Buffers - Google's data interchange format
  11. // Copyright 2008 Google Inc. All rights reserved.
  12. // https://developers.google.com/protocol-buffers/
  13. //
  14. // Redistribution and use in source and binary forms, with or without
  15. // modification, are permitted provided that the following conditions are
  16. // met:
  17. //
  18. // * Redistributions of source code must retain the above copyright
  19. // notice, this list of conditions and the following disclaimer.
  20. // * Redistributions in binary form must reproduce the above
  21. // copyright notice, this list of conditions and the following disclaimer
  22. // in the documentation and/or other materials provided with the
  23. // distribution.
  24. // * Neither the name of Google Inc. nor the names of its
  25. // contributors may be used to endorse or promote products derived from
  26. // this software without specific prior written permission.
  27. //
  28. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  29. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  30. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  31. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  32. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  33. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  34. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  35. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  36. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  37. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  38. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39. // Author: liujisi@google.com (Pherl Liu)
  40. import SwiftProtobuf
  41. // If the compiler emits an error on this type, it is because this file
  42. // was generated by a version of the `protoc` Swift plug-in that is
  43. // incompatible with the version of SwiftProtobuf to which you are linking.
  44. // Please ensure that you are building against the same version of the API
  45. // that was used to generate this file.
  46. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  47. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  48. typealias Version = _2
  49. }
  50. struct SwiftProtoTesting_Import_PublicImportMessage: Sendable {
  51. // SwiftProtobuf.Message conformance is added in an extension below. See the
  52. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  53. // methods supported on all messages.
  54. var e: Int32 {
  55. get {_e ?? 0}
  56. set {_e = newValue}
  57. }
  58. /// Returns true if `e` has been explicitly set.
  59. var hasE: Bool {self._e != nil}
  60. /// Clears the value of `e`. Subsequent reads from it will return its default value.
  61. mutating func clearE() {self._e = nil}
  62. var unknownFields = SwiftProtobuf.UnknownStorage()
  63. init() {}
  64. fileprivate var _e: Int32? = nil
  65. }
  66. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  67. fileprivate let _protobuf_package = "swift_proto_testing.import"
  68. extension SwiftProtoTesting_Import_PublicImportMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  69. static let protoMessageName: String = _protobuf_package + ".PublicImportMessage"
  70. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}e\0")
  71. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  72. while let fieldNumber = try decoder.nextFieldNumber() {
  73. // The use of inline closures is to circumvent an issue where the compiler
  74. // allocates stack space for every case branch when no optimizations are
  75. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  76. switch fieldNumber {
  77. case 1: try { try decoder.decodeSingularInt32Field(value: &self._e) }()
  78. default: break
  79. }
  80. }
  81. }
  82. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  83. // The use of inline closures is to circumvent an issue where the compiler
  84. // allocates stack space for every if/case branch local when no optimizations
  85. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  86. // https://github.com/apple/swift-protobuf/issues/1182
  87. try { if let v = self._e {
  88. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  89. } }()
  90. try unknownFields.traverse(visitor: &visitor)
  91. }
  92. static func ==(lhs: SwiftProtoTesting_Import_PublicImportMessage, rhs: SwiftProtoTesting_Import_PublicImportMessage) -> Bool {
  93. if lhs._e != rhs._e {return false}
  94. if lhs.unknownFields != rhs.unknownFields {return false}
  95. return true
  96. }
  97. }