swift_protobuf_module_mappings.pb.swift 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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: swift_protobuf_module_mappings.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. // Protos/SwiftProtobufPluginLibrary/swift_protobuf_module_mappings.proto - Swift Module mappings configuration
  11. //
  12. // This source file is part of the Swift.org open source project
  13. //
  14. // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
  15. // Licensed under Apache License v2.0 with Runtime Library Exception
  16. //
  17. // See http://swift.org/LICENSE.txt for license information
  18. // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
  19. import SwiftProtobuf
  20. // If the compiler emits an error on this type, it is because this file
  21. // was generated by a version of the `protoc` Swift plug-in that is
  22. // incompatible with the version of SwiftProtobuf to which you are linking.
  23. // Please ensure that you are building against the same version of the API
  24. // that was used to generate this file.
  25. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  26. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  27. typealias Version = _2
  28. }
  29. /// Configuration used to define the mappings for generated proto files
  30. /// to the Swift module they will be included in.
  31. struct SwiftProtobuf_GenSwift_ModuleMappings: Sendable {
  32. // SwiftProtobuf.Message conformance is added in an extension below. See the
  33. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  34. // methods supported on all messages.
  35. /// The mappings.
  36. var mapping: [SwiftProtobuf_GenSwift_ModuleMappings.Entry] = []
  37. var unknownFields = SwiftProtobuf.UnknownStorage()
  38. /// Individual listing of the module name and the files that will go
  39. /// into it.
  40. struct Entry: Sendable {
  41. // SwiftProtobuf.Message conformance is added in an extension below. See the
  42. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  43. // methods supported on all messages.
  44. /// The Swift module name that will be imported and used to scope all
  45. /// the types from the given proto files.
  46. var moduleName: String = String()
  47. /// The proto files that should be considered it this module. The values
  48. /// should be the how they are expressed to the generated; i.e. - how they
  49. /// are used in import states to be used from other files, so `my_file.proto`
  50. /// or `path/to/file.proto`.
  51. var protoFilePath: [String] = []
  52. var unknownFields = SwiftProtobuf.UnknownStorage()
  53. init() {}
  54. }
  55. init() {}
  56. }
  57. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  58. fileprivate let _protobuf_package = "swift_protobuf.gen_swift"
  59. extension SwiftProtobuf_GenSwift_ModuleMappings: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  60. static let protoMessageName: String = _protobuf_package + ".ModuleMappings"
  61. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}mapping\0")
  62. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  63. while let fieldNumber = try decoder.nextFieldNumber() {
  64. // The use of inline closures is to circumvent an issue where the compiler
  65. // allocates stack space for every case branch when no optimizations are
  66. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  67. switch fieldNumber {
  68. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.mapping) }()
  69. default: break
  70. }
  71. }
  72. }
  73. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  74. if !self.mapping.isEmpty {
  75. try visitor.visitRepeatedMessageField(value: self.mapping, fieldNumber: 1)
  76. }
  77. try unknownFields.traverse(visitor: &visitor)
  78. }
  79. static func ==(lhs: SwiftProtobuf_GenSwift_ModuleMappings, rhs: SwiftProtobuf_GenSwift_ModuleMappings) -> Bool {
  80. if lhs.mapping != rhs.mapping {return false}
  81. if lhs.unknownFields != rhs.unknownFields {return false}
  82. return true
  83. }
  84. }
  85. extension SwiftProtobuf_GenSwift_ModuleMappings.Entry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  86. static let protoMessageName: String = SwiftProtobuf_GenSwift_ModuleMappings.protoMessageName + ".Entry"
  87. static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}module_name\0\u{3}proto_file_path\0")
  88. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  89. while let fieldNumber = try decoder.nextFieldNumber() {
  90. // The use of inline closures is to circumvent an issue where the compiler
  91. // allocates stack space for every case branch when no optimizations are
  92. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  93. switch fieldNumber {
  94. case 1: try { try decoder.decodeSingularStringField(value: &self.moduleName) }()
  95. case 2: try { try decoder.decodeRepeatedStringField(value: &self.protoFilePath) }()
  96. default: break
  97. }
  98. }
  99. }
  100. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  101. if !self.moduleName.isEmpty {
  102. try visitor.visitSingularStringField(value: self.moduleName, fieldNumber: 1)
  103. }
  104. if !self.protoFilePath.isEmpty {
  105. try visitor.visitRepeatedStringField(value: self.protoFilePath, fieldNumber: 2)
  106. }
  107. try unknownFields.traverse(visitor: &visitor)
  108. }
  109. static func ==(lhs: SwiftProtobuf_GenSwift_ModuleMappings.Entry, rhs: SwiftProtobuf_GenSwift_ModuleMappings.Entry) -> Bool {
  110. if lhs.moduleName != rhs.moduleName {return false}
  111. if lhs.protoFilePath != rhs.protoFilePath {return false}
  112. if lhs.unknownFields != rhs.unknownFields {return false}
  113. return true
  114. }
  115. }