unittest_delimited_import.pb.swift 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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: google/protobuf/unittest_delimited_import.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. import SwiftProtobuf
  11. // If the compiler emits an error on this type, it is because this file
  12. // was generated by a version of the `protoc` Swift plug-in that is
  13. // incompatible with the version of SwiftProtobuf to which you are linking.
  14. // Please ensure that you are building against the same version of the API
  15. // that was used to generate this file.
  16. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  17. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  18. typealias Version = _2
  19. }
  20. struct EditionsUnittest_MessageImport: Sendable {
  21. // SwiftProtobuf.Message conformance is added in an extension below. See the
  22. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  23. // methods supported on all messages.
  24. var a: Int32 {
  25. get {_a ?? 0}
  26. set {_a = newValue}
  27. }
  28. /// Returns true if `a` has been explicitly set.
  29. var hasA: Bool {self._a != nil}
  30. /// Clears the value of `a`. Subsequent reads from it will return its default value.
  31. mutating func clearA() {self._a = nil}
  32. var b: Int32 {
  33. get {_b ?? 0}
  34. set {_b = newValue}
  35. }
  36. /// Returns true if `b` has been explicitly set.
  37. var hasB: Bool {self._b != nil}
  38. /// Clears the value of `b`. Subsequent reads from it will return its default value.
  39. mutating func clearB() {self._b = nil}
  40. var unknownFields = SwiftProtobuf.UnknownStorage()
  41. init() {}
  42. fileprivate var _a: Int32? = nil
  43. fileprivate var _b: Int32? = nil
  44. }
  45. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  46. fileprivate let _protobuf_package = "editions_unittest"
  47. extension EditionsUnittest_MessageImport: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  48. static let protoMessageName: String = _protobuf_package + ".MessageImport"
  49. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}a\0\u{1}b\0")
  50. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  51. while let fieldNumber = try decoder.nextFieldNumber() {
  52. // The use of inline closures is to circumvent an issue where the compiler
  53. // allocates stack space for every case branch when no optimizations are
  54. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  55. switch fieldNumber {
  56. case 1: try { try decoder.decodeSingularInt32Field(value: &self._a) }()
  57. case 2: try { try decoder.decodeSingularInt32Field(value: &self._b) }()
  58. default: break
  59. }
  60. }
  61. }
  62. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  63. // The use of inline closures is to circumvent an issue where the compiler
  64. // allocates stack space for every if/case branch local when no optimizations
  65. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  66. // https://github.com/apple/swift-protobuf/issues/1182
  67. try { if let v = self._a {
  68. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  69. } }()
  70. try { if let v = self._b {
  71. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  72. } }()
  73. try unknownFields.traverse(visitor: &visitor)
  74. }
  75. static func ==(lhs: EditionsUnittest_MessageImport, rhs: EditionsUnittest_MessageImport) -> Bool {
  76. if lhs._a != rhs._a {return false}
  77. if lhs._b != rhs._b {return false}
  78. if lhs.unknownFields != rhs.unknownFields {return false}
  79. return true
  80. }
  81. }