plugin.pb.swift 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  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/compiler/plugin.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. //
  13. // Use of this source code is governed by a BSD-style
  14. // license that can be found in the LICENSE file or at
  15. // https://developers.google.com/open-source/licenses/bsd
  16. // Author: kenton@google.com (Kenton Varda)
  17. //
  18. // protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is
  19. // just a program that reads a CodeGeneratorRequest from stdin and writes a
  20. // CodeGeneratorResponse to stdout.
  21. //
  22. // Plugins written using C++ can use google/protobuf/compiler/plugin.h instead
  23. // of dealing with the raw protocol defined here.
  24. //
  25. // A plugin executable needs only to be placed somewhere in the path. The
  26. // plugin should be named "protoc-gen-$NAME", and will then be used when the
  27. // flag "--${NAME}_out" is passed to protoc.
  28. import SwiftProtobuf
  29. // If the compiler emits an error on this type, it is because this file
  30. // was generated by a version of the `protoc` Swift plug-in that is
  31. // incompatible with the version of SwiftProtobuf to which you are linking.
  32. // Please ensure that you are building against the same version of the API
  33. // that was used to generate this file.
  34. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  35. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  36. typealias Version = _2
  37. }
  38. /// The version number of protocol compiler.
  39. public struct Google_Protobuf_Compiler_Version: Sendable {
  40. // SwiftProtobuf.Message conformance is added in an extension below. See the
  41. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  42. // methods supported on all messages.
  43. public var major: Int32 {
  44. get {_major ?? 0}
  45. set {_major = newValue}
  46. }
  47. /// Returns true if `major` has been explicitly set.
  48. public var hasMajor: Bool {self._major != nil}
  49. /// Clears the value of `major`. Subsequent reads from it will return its default value.
  50. public mutating func clearMajor() {self._major = nil}
  51. public var minor: Int32 {
  52. get {_minor ?? 0}
  53. set {_minor = newValue}
  54. }
  55. /// Returns true if `minor` has been explicitly set.
  56. public var hasMinor: Bool {self._minor != nil}
  57. /// Clears the value of `minor`. Subsequent reads from it will return its default value.
  58. public mutating func clearMinor() {self._minor = nil}
  59. public var patch: Int32 {
  60. get {_patch ?? 0}
  61. set {_patch = newValue}
  62. }
  63. /// Returns true if `patch` has been explicitly set.
  64. public var hasPatch: Bool {self._patch != nil}
  65. /// Clears the value of `patch`. Subsequent reads from it will return its default value.
  66. public mutating func clearPatch() {self._patch = nil}
  67. /// A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
  68. /// be empty for mainline stable releases.
  69. public var suffix: String {
  70. get {_suffix ?? String()}
  71. set {_suffix = newValue}
  72. }
  73. /// Returns true if `suffix` has been explicitly set.
  74. public var hasSuffix: Bool {self._suffix != nil}
  75. /// Clears the value of `suffix`. Subsequent reads from it will return its default value.
  76. public mutating func clearSuffix() {self._suffix = nil}
  77. public var unknownFields = SwiftProtobuf.UnknownStorage()
  78. public init() {}
  79. fileprivate var _major: Int32? = nil
  80. fileprivate var _minor: Int32? = nil
  81. fileprivate var _patch: Int32? = nil
  82. fileprivate var _suffix: String? = nil
  83. }
  84. /// An encoded CodeGeneratorRequest is written to the plugin's stdin.
  85. public struct Google_Protobuf_Compiler_CodeGeneratorRequest: Sendable {
  86. // SwiftProtobuf.Message conformance is added in an extension below. See the
  87. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  88. // methods supported on all messages.
  89. /// The .proto files that were explicitly listed on the command-line. The
  90. /// code generator should generate code only for these files. Each file's
  91. /// descriptor will be included in proto_file, below.
  92. public var fileToGenerate: [String] = []
  93. /// The generator parameter passed on the command-line.
  94. public var parameter: String {
  95. get {_parameter ?? String()}
  96. set {_parameter = newValue}
  97. }
  98. /// Returns true if `parameter` has been explicitly set.
  99. public var hasParameter: Bool {self._parameter != nil}
  100. /// Clears the value of `parameter`. Subsequent reads from it will return its default value.
  101. public mutating func clearParameter() {self._parameter = nil}
  102. /// FileDescriptorProtos for all files in files_to_generate and everything
  103. /// they import. The files will appear in topological order, so each file
  104. /// appears before any file that imports it.
  105. ///
  106. /// Note: the files listed in files_to_generate will include runtime-retention
  107. /// options only, but all other files will include source-retention options.
  108. /// The source_file_descriptors field below is available in case you need
  109. /// source-retention options for files_to_generate.
  110. ///
  111. /// protoc guarantees that all proto_files will be written after
  112. /// the fields above, even though this is not technically guaranteed by the
  113. /// protobuf wire format. This theoretically could allow a plugin to stream
  114. /// in the FileDescriptorProtos and handle them one by one rather than read
  115. /// the entire set into memory at once. However, as of this writing, this
  116. /// is not similarly optimized on protoc's end -- it will store all fields in
  117. /// memory at once before sending them to the plugin.
  118. ///
  119. /// Type names of fields and extensions in the FileDescriptorProto are always
  120. /// fully qualified.
  121. public var protoFile: [SwiftProtobuf.Google_Protobuf_FileDescriptorProto] = []
  122. /// File descriptors with all options, including source-retention options.
  123. /// These descriptors are only provided for the files listed in
  124. /// files_to_generate.
  125. public var sourceFileDescriptors: [SwiftProtobuf.Google_Protobuf_FileDescriptorProto] = []
  126. /// The version number of protocol compiler.
  127. public var compilerVersion: Google_Protobuf_Compiler_Version {
  128. get {_compilerVersion ?? Google_Protobuf_Compiler_Version()}
  129. set {_compilerVersion = newValue}
  130. }
  131. /// Returns true if `compilerVersion` has been explicitly set.
  132. public var hasCompilerVersion: Bool {self._compilerVersion != nil}
  133. /// Clears the value of `compilerVersion`. Subsequent reads from it will return its default value.
  134. public mutating func clearCompilerVersion() {self._compilerVersion = nil}
  135. public var unknownFields = SwiftProtobuf.UnknownStorage()
  136. public init() {}
  137. fileprivate var _parameter: String? = nil
  138. fileprivate var _compilerVersion: Google_Protobuf_Compiler_Version? = nil
  139. }
  140. /// The plugin writes an encoded CodeGeneratorResponse to stdout.
  141. public struct Google_Protobuf_Compiler_CodeGeneratorResponse: Sendable {
  142. // SwiftProtobuf.Message conformance is added in an extension below. See the
  143. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  144. // methods supported on all messages.
  145. /// Error message. If non-empty, code generation failed. The plugin process
  146. /// should exit with status code zero even if it reports an error in this way.
  147. ///
  148. /// This should be used to indicate errors in .proto files which prevent the
  149. /// code generator from generating correct code. Errors which indicate a
  150. /// problem in protoc itself -- such as the input CodeGeneratorRequest being
  151. /// unparseable -- should be reported by writing a message to stderr and
  152. /// exiting with a non-zero status code.
  153. public var error: String {
  154. get {_error ?? String()}
  155. set {_error = newValue}
  156. }
  157. /// Returns true if `error` has been explicitly set.
  158. public var hasError: Bool {self._error != nil}
  159. /// Clears the value of `error`. Subsequent reads from it will return its default value.
  160. public mutating func clearError() {self._error = nil}
  161. /// A bitmask of supported features that the code generator supports.
  162. /// This is a bitwise "or" of values from the Feature enum.
  163. public var supportedFeatures: UInt64 {
  164. get {_supportedFeatures ?? 0}
  165. set {_supportedFeatures = newValue}
  166. }
  167. /// Returns true if `supportedFeatures` has been explicitly set.
  168. public var hasSupportedFeatures: Bool {self._supportedFeatures != nil}
  169. /// Clears the value of `supportedFeatures`. Subsequent reads from it will return its default value.
  170. public mutating func clearSupportedFeatures() {self._supportedFeatures = nil}
  171. /// The minimum edition this plugin supports. This will be treated as an
  172. /// Edition enum, but we want to allow unknown values. It should be specified
  173. /// according the edition enum value, *not* the edition number. Only takes
  174. /// effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
  175. public var minimumEdition: Int32 {
  176. get {_minimumEdition ?? 0}
  177. set {_minimumEdition = newValue}
  178. }
  179. /// Returns true if `minimumEdition` has been explicitly set.
  180. public var hasMinimumEdition: Bool {self._minimumEdition != nil}
  181. /// Clears the value of `minimumEdition`. Subsequent reads from it will return its default value.
  182. public mutating func clearMinimumEdition() {self._minimumEdition = nil}
  183. /// The maximum edition this plugin supports. This will be treated as an
  184. /// Edition enum, but we want to allow unknown values. It should be specified
  185. /// according the edition enum value, *not* the edition number. Only takes
  186. /// effect for plugins that have FEATURE_SUPPORTS_EDITIONS set.
  187. public var maximumEdition: Int32 {
  188. get {_maximumEdition ?? 0}
  189. set {_maximumEdition = newValue}
  190. }
  191. /// Returns true if `maximumEdition` has been explicitly set.
  192. public var hasMaximumEdition: Bool {self._maximumEdition != nil}
  193. /// Clears the value of `maximumEdition`. Subsequent reads from it will return its default value.
  194. public mutating func clearMaximumEdition() {self._maximumEdition = nil}
  195. public var file: [Google_Protobuf_Compiler_CodeGeneratorResponse.File] = []
  196. public var unknownFields = SwiftProtobuf.UnknownStorage()
  197. /// Sync with code_generator.h.
  198. public enum Feature: Int, SwiftProtobuf.Enum, Swift.CaseIterable {
  199. case none = 0
  200. case proto3Optional = 1
  201. case supportsEditions = 2
  202. public init() {
  203. self = .none
  204. }
  205. }
  206. /// Represents a single generated file.
  207. public struct File: Sendable {
  208. // SwiftProtobuf.Message conformance is added in an extension below. See the
  209. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  210. // methods supported on all messages.
  211. /// The file name, relative to the output directory. The name must not
  212. /// contain "." or ".." components and must be relative, not be absolute (so,
  213. /// the file cannot lie outside the output directory). "/" must be used as
  214. /// the path separator, not "\".
  215. ///
  216. /// If the name is omitted, the content will be appended to the previous
  217. /// file. This allows the generator to break large files into small chunks,
  218. /// and allows the generated text to be streamed back to protoc so that large
  219. /// files need not reside completely in memory at one time. Note that as of
  220. /// this writing protoc does not optimize for this -- it will read the entire
  221. /// CodeGeneratorResponse before writing files to disk.
  222. public var name: String {
  223. get {_name ?? String()}
  224. set {_name = newValue}
  225. }
  226. /// Returns true if `name` has been explicitly set.
  227. public var hasName: Bool {self._name != nil}
  228. /// Clears the value of `name`. Subsequent reads from it will return its default value.
  229. public mutating func clearName() {self._name = nil}
  230. /// If non-empty, indicates that the named file should already exist, and the
  231. /// content here is to be inserted into that file at a defined insertion
  232. /// point. This feature allows a code generator to extend the output
  233. /// produced by another code generator. The original generator may provide
  234. /// insertion points by placing special annotations in the file that look
  235. /// like:
  236. /// @@protoc_insertion_point(NAME)
  237. /// The annotation can have arbitrary text before and after it on the line,
  238. /// which allows it to be placed in a comment. NAME should be replaced with
  239. /// an identifier naming the point -- this is what other generators will use
  240. /// as the insertion_point. Code inserted at this point will be placed
  241. /// immediately above the line containing the insertion point (thus multiple
  242. /// insertions to the same point will come out in the order they were added).
  243. /// The double-@ is intended to make it unlikely that the generated code
  244. /// could contain things that look like insertion points by accident.
  245. ///
  246. /// For example, the C++ code generator places the following line in the
  247. /// .pb.h files that it generates:
  248. /// // @@protoc_insertion_point(namespace_scope)
  249. /// This line appears within the scope of the file's package namespace, but
  250. /// outside of any particular class. Another plugin can then specify the
  251. /// insertion_point "namespace_scope" to generate additional classes or
  252. /// other declarations that should be placed in this scope.
  253. ///
  254. /// Note that if the line containing the insertion point begins with
  255. /// whitespace, the same whitespace will be added to every line of the
  256. /// inserted text. This is useful for languages like Python, where
  257. /// indentation matters. In these languages, the insertion point comment
  258. /// should be indented the same amount as any inserted code will need to be
  259. /// in order to work correctly in that context.
  260. ///
  261. /// The code generator that generates the initial file and the one which
  262. /// inserts into it must both run as part of a single invocation of protoc.
  263. /// Code generators are executed in the order in which they appear on the
  264. /// command line.
  265. ///
  266. /// If |insertion_point| is present, |name| must also be present.
  267. public var insertionPoint: String {
  268. get {_insertionPoint ?? String()}
  269. set {_insertionPoint = newValue}
  270. }
  271. /// Returns true if `insertionPoint` has been explicitly set.
  272. public var hasInsertionPoint: Bool {self._insertionPoint != nil}
  273. /// Clears the value of `insertionPoint`. Subsequent reads from it will return its default value.
  274. public mutating func clearInsertionPoint() {self._insertionPoint = nil}
  275. /// The file contents.
  276. public var content: String {
  277. get {_content ?? String()}
  278. set {_content = newValue}
  279. }
  280. /// Returns true if `content` has been explicitly set.
  281. public var hasContent: Bool {self._content != nil}
  282. /// Clears the value of `content`. Subsequent reads from it will return its default value.
  283. public mutating func clearContent() {self._content = nil}
  284. /// Information describing the file content being inserted. If an insertion
  285. /// point is used, this information will be appropriately offset and inserted
  286. /// into the code generation metadata for the generated files.
  287. public var generatedCodeInfo: SwiftProtobuf.Google_Protobuf_GeneratedCodeInfo {
  288. get {_generatedCodeInfo ?? SwiftProtobuf.Google_Protobuf_GeneratedCodeInfo()}
  289. set {_generatedCodeInfo = newValue}
  290. }
  291. /// Returns true if `generatedCodeInfo` has been explicitly set.
  292. public var hasGeneratedCodeInfo: Bool {self._generatedCodeInfo != nil}
  293. /// Clears the value of `generatedCodeInfo`. Subsequent reads from it will return its default value.
  294. public mutating func clearGeneratedCodeInfo() {self._generatedCodeInfo = nil}
  295. public var unknownFields = SwiftProtobuf.UnknownStorage()
  296. public init() {}
  297. fileprivate var _name: String? = nil
  298. fileprivate var _insertionPoint: String? = nil
  299. fileprivate var _content: String? = nil
  300. fileprivate var _generatedCodeInfo: SwiftProtobuf.Google_Protobuf_GeneratedCodeInfo? = nil
  301. }
  302. public init() {}
  303. fileprivate var _error: String? = nil
  304. fileprivate var _supportedFeatures: UInt64? = nil
  305. fileprivate var _minimumEdition: Int32? = nil
  306. fileprivate var _maximumEdition: Int32? = nil
  307. }
  308. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  309. fileprivate let _protobuf_package = "google.protobuf.compiler"
  310. extension Google_Protobuf_Compiler_Version: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  311. public static let protoMessageName: String = _protobuf_package + ".Version"
  312. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}major\0\u{1}minor\0\u{1}patch\0\u{1}suffix\0")
  313. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  314. while let fieldNumber = try decoder.nextFieldNumber() {
  315. // The use of inline closures is to circumvent an issue where the compiler
  316. // allocates stack space for every case branch when no optimizations are
  317. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  318. switch fieldNumber {
  319. case 1: try { try decoder.decodeSingularInt32Field(value: &self._major) }()
  320. case 2: try { try decoder.decodeSingularInt32Field(value: &self._minor) }()
  321. case 3: try { try decoder.decodeSingularInt32Field(value: &self._patch) }()
  322. case 4: try { try decoder.decodeSingularStringField(value: &self._suffix) }()
  323. default: break
  324. }
  325. }
  326. }
  327. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  328. // The use of inline closures is to circumvent an issue where the compiler
  329. // allocates stack space for every if/case branch local when no optimizations
  330. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  331. // https://github.com/apple/swift-protobuf/issues/1182
  332. try { if let v = self._major {
  333. try visitor.visitSingularInt32Field(value: v, fieldNumber: 1)
  334. } }()
  335. try { if let v = self._minor {
  336. try visitor.visitSingularInt32Field(value: v, fieldNumber: 2)
  337. } }()
  338. try { if let v = self._patch {
  339. try visitor.visitSingularInt32Field(value: v, fieldNumber: 3)
  340. } }()
  341. try { if let v = self._suffix {
  342. try visitor.visitSingularStringField(value: v, fieldNumber: 4)
  343. } }()
  344. try unknownFields.traverse(visitor: &visitor)
  345. }
  346. public static func ==(lhs: Google_Protobuf_Compiler_Version, rhs: Google_Protobuf_Compiler_Version) -> Bool {
  347. if lhs._major != rhs._major {return false}
  348. if lhs._minor != rhs._minor {return false}
  349. if lhs._patch != rhs._patch {return false}
  350. if lhs._suffix != rhs._suffix {return false}
  351. if lhs.unknownFields != rhs.unknownFields {return false}
  352. return true
  353. }
  354. }
  355. extension Google_Protobuf_Compiler_CodeGeneratorRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  356. public static let protoMessageName: String = _protobuf_package + ".CodeGeneratorRequest"
  357. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}file_to_generate\0\u{1}parameter\0\u{3}compiler_version\0\u{4}\u{c}proto_file\0\u{4}\u{2}source_file_descriptors\0")
  358. public var isInitialized: Bool {
  359. if !SwiftProtobuf.Internal.areAllInitialized(self.protoFile) {return false}
  360. if !SwiftProtobuf.Internal.areAllInitialized(self.sourceFileDescriptors) {return false}
  361. return true
  362. }
  363. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  364. while let fieldNumber = try decoder.nextFieldNumber() {
  365. // The use of inline closures is to circumvent an issue where the compiler
  366. // allocates stack space for every case branch when no optimizations are
  367. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  368. switch fieldNumber {
  369. case 1: try { try decoder.decodeRepeatedStringField(value: &self.fileToGenerate) }()
  370. case 2: try { try decoder.decodeSingularStringField(value: &self._parameter) }()
  371. case 3: try { try decoder.decodeSingularMessageField(value: &self._compilerVersion) }()
  372. case 15: try { try decoder.decodeRepeatedMessageField(value: &self.protoFile) }()
  373. case 17: try { try decoder.decodeRepeatedMessageField(value: &self.sourceFileDescriptors) }()
  374. default: break
  375. }
  376. }
  377. }
  378. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  379. // The use of inline closures is to circumvent an issue where the compiler
  380. // allocates stack space for every if/case branch local when no optimizations
  381. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  382. // https://github.com/apple/swift-protobuf/issues/1182
  383. if !self.fileToGenerate.isEmpty {
  384. try visitor.visitRepeatedStringField(value: self.fileToGenerate, fieldNumber: 1)
  385. }
  386. try { if let v = self._parameter {
  387. try visitor.visitSingularStringField(value: v, fieldNumber: 2)
  388. } }()
  389. try { if let v = self._compilerVersion {
  390. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  391. } }()
  392. if !self.protoFile.isEmpty {
  393. try visitor.visitRepeatedMessageField(value: self.protoFile, fieldNumber: 15)
  394. }
  395. if !self.sourceFileDescriptors.isEmpty {
  396. try visitor.visitRepeatedMessageField(value: self.sourceFileDescriptors, fieldNumber: 17)
  397. }
  398. try unknownFields.traverse(visitor: &visitor)
  399. }
  400. public static func ==(lhs: Google_Protobuf_Compiler_CodeGeneratorRequest, rhs: Google_Protobuf_Compiler_CodeGeneratorRequest) -> Bool {
  401. if lhs.fileToGenerate != rhs.fileToGenerate {return false}
  402. if lhs._parameter != rhs._parameter {return false}
  403. if lhs.protoFile != rhs.protoFile {return false}
  404. if lhs.sourceFileDescriptors != rhs.sourceFileDescriptors {return false}
  405. if lhs._compilerVersion != rhs._compilerVersion {return false}
  406. if lhs.unknownFields != rhs.unknownFields {return false}
  407. return true
  408. }
  409. }
  410. extension Google_Protobuf_Compiler_CodeGeneratorResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  411. public static let protoMessageName: String = _protobuf_package + ".CodeGeneratorResponse"
  412. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}error\0\u{3}supported_features\0\u{3}minimum_edition\0\u{3}maximum_edition\0\u{2}\u{b}file\0")
  413. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  414. while let fieldNumber = try decoder.nextFieldNumber() {
  415. // The use of inline closures is to circumvent an issue where the compiler
  416. // allocates stack space for every case branch when no optimizations are
  417. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  418. switch fieldNumber {
  419. case 1: try { try decoder.decodeSingularStringField(value: &self._error) }()
  420. case 2: try { try decoder.decodeSingularUInt64Field(value: &self._supportedFeatures) }()
  421. case 3: try { try decoder.decodeSingularInt32Field(value: &self._minimumEdition) }()
  422. case 4: try { try decoder.decodeSingularInt32Field(value: &self._maximumEdition) }()
  423. case 15: try { try decoder.decodeRepeatedMessageField(value: &self.file) }()
  424. default: break
  425. }
  426. }
  427. }
  428. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  429. // The use of inline closures is to circumvent an issue where the compiler
  430. // allocates stack space for every if/case branch local when no optimizations
  431. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  432. // https://github.com/apple/swift-protobuf/issues/1182
  433. try { if let v = self._error {
  434. try visitor.visitSingularStringField(value: v, fieldNumber: 1)
  435. } }()
  436. try { if let v = self._supportedFeatures {
  437. try visitor.visitSingularUInt64Field(value: v, fieldNumber: 2)
  438. } }()
  439. try { if let v = self._minimumEdition {
  440. try visitor.visitSingularInt32Field(value: v, fieldNumber: 3)
  441. } }()
  442. try { if let v = self._maximumEdition {
  443. try visitor.visitSingularInt32Field(value: v, fieldNumber: 4)
  444. } }()
  445. if !self.file.isEmpty {
  446. try visitor.visitRepeatedMessageField(value: self.file, fieldNumber: 15)
  447. }
  448. try unknownFields.traverse(visitor: &visitor)
  449. }
  450. public static func ==(lhs: Google_Protobuf_Compiler_CodeGeneratorResponse, rhs: Google_Protobuf_Compiler_CodeGeneratorResponse) -> Bool {
  451. if lhs._error != rhs._error {return false}
  452. if lhs._supportedFeatures != rhs._supportedFeatures {return false}
  453. if lhs._minimumEdition != rhs._minimumEdition {return false}
  454. if lhs._maximumEdition != rhs._maximumEdition {return false}
  455. if lhs.file != rhs.file {return false}
  456. if lhs.unknownFields != rhs.unknownFields {return false}
  457. return true
  458. }
  459. }
  460. extension Google_Protobuf_Compiler_CodeGeneratorResponse.Feature: SwiftProtobuf._ProtoNameProviding {
  461. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0FEATURE_NONE\0\u{1}FEATURE_PROTO3_OPTIONAL\0\u{1}FEATURE_SUPPORTS_EDITIONS\0")
  462. }
  463. extension Google_Protobuf_Compiler_CodeGeneratorResponse.File: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  464. public static let protoMessageName: String = Google_Protobuf_Compiler_CodeGeneratorResponse.protoMessageName + ".File"
  465. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}name\0\u{3}insertion_point\0\u{2}\u{d}content\0\u{3}generated_code_info\0")
  466. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  467. while let fieldNumber = try decoder.nextFieldNumber() {
  468. // The use of inline closures is to circumvent an issue where the compiler
  469. // allocates stack space for every case branch when no optimizations are
  470. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  471. switch fieldNumber {
  472. case 1: try { try decoder.decodeSingularStringField(value: &self._name) }()
  473. case 2: try { try decoder.decodeSingularStringField(value: &self._insertionPoint) }()
  474. case 15: try { try decoder.decodeSingularStringField(value: &self._content) }()
  475. case 16: try { try decoder.decodeSingularMessageField(value: &self._generatedCodeInfo) }()
  476. default: break
  477. }
  478. }
  479. }
  480. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  481. // The use of inline closures is to circumvent an issue where the compiler
  482. // allocates stack space for every if/case branch local when no optimizations
  483. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  484. // https://github.com/apple/swift-protobuf/issues/1182
  485. try { if let v = self._name {
  486. try visitor.visitSingularStringField(value: v, fieldNumber: 1)
  487. } }()
  488. try { if let v = self._insertionPoint {
  489. try visitor.visitSingularStringField(value: v, fieldNumber: 2)
  490. } }()
  491. try { if let v = self._content {
  492. try visitor.visitSingularStringField(value: v, fieldNumber: 15)
  493. } }()
  494. try { if let v = self._generatedCodeInfo {
  495. try visitor.visitSingularMessageField(value: v, fieldNumber: 16)
  496. } }()
  497. try unknownFields.traverse(visitor: &visitor)
  498. }
  499. public static func ==(lhs: Google_Protobuf_Compiler_CodeGeneratorResponse.File, rhs: Google_Protobuf_Compiler_CodeGeneratorResponse.File) -> Bool {
  500. if lhs._name != rhs._name {return false}
  501. if lhs._insertionPoint != rhs._insertionPoint {return false}
  502. if lhs._content != rhs._content {return false}
  503. if lhs._generatedCodeInfo != rhs._generatedCodeInfo {return false}
  504. if lhs.unknownFields != rhs.unknownFields {return false}
  505. return true
  506. }
  507. }