source_context.pb.swift 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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/source_context.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. // 'import SwiftProtobuf' suppressed, this proto file is meant to be bundled in the runtime.
  40. // If the compiler emits an error on this type, it is because this file
  41. // was generated by a version of the `protoc` Swift plug-in that is
  42. // incompatible with the version of SwiftProtobuf to which you are linking.
  43. // Please ensure that you are building against the same version of the API
  44. // that was used to generate this file.
  45. fileprivate struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIVersionCheck {
  46. struct _2: ProtobufAPIVersion_2 {}
  47. typealias Version = _2
  48. }
  49. /// `SourceContext` represents information about the source of a
  50. /// protobuf element, like the file in which it is defined.
  51. public struct Google_Protobuf_SourceContext: Sendable {
  52. // SwiftProtobuf.Message conformance is added in an extension below. See the
  53. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  54. // methods supported on all messages.
  55. /// The path-qualified name of the .proto file that contained the associated
  56. /// protobuf element. For example: `"google/protobuf/source_context.proto"`.
  57. public var fileName: String = String()
  58. public var unknownFields = UnknownStorage()
  59. public init() {}
  60. }
  61. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  62. fileprivate let _protobuf_package = "google.protobuf"
  63. extension Google_Protobuf_SourceContext: Message, _MessageImplementationBase, _ProtoNameProviding {
  64. public static let protoMessageName: String = _protobuf_package + ".SourceContext"
  65. public static let _protobuf_nameMap = _NameMap(bytecode: "\0\u{3}file_name\0")
  66. public mutating func decodeMessage<D: Decoder>(decoder: inout D) throws {
  67. while let fieldNumber = try decoder.nextFieldNumber() {
  68. // The use of inline closures is to circumvent an issue where the compiler
  69. // allocates stack space for every case branch when no optimizations are
  70. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  71. switch fieldNumber {
  72. case 1: try { try decoder.decodeSingularStringField(value: &self.fileName) }()
  73. default: break
  74. }
  75. }
  76. }
  77. public func traverse<V: Visitor>(visitor: inout V) throws {
  78. if !self.fileName.isEmpty {
  79. try visitor.visitSingularStringField(value: self.fileName, fieldNumber: 1)
  80. }
  81. try unknownFields.traverse(visitor: &visitor)
  82. }
  83. public static func ==(lhs: Google_Protobuf_SourceContext, rhs: Google_Protobuf_SourceContext) -> Bool {
  84. if lhs.fileName != rhs.fileName {return false}
  85. if lhs.unknownFields != rhs.unknownFields {return false}
  86. return true
  87. }
  88. }