| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- // DO NOT EDIT.
- // swift-format-ignore-file
- // swiftlint:disable all
- //
- // Generated by the Swift generator plugin for the protocol buffer compiler.
- // Source: google/protobuf/cpp_features.proto
- //
- // For information on using the generated types, please see the documentation:
- // https://github.com/apple/swift-protobuf/
- // Protocol Buffers - Google's data interchange format
- // Copyright 2023 Google Inc. All rights reserved.
- //
- // Use of this source code is governed by a BSD-style
- // license that can be found in the LICENSE file or at
- // https://developers.google.com/open-source/licenses/bsd
- import SwiftProtobuf
- // If the compiler emits an error on this type, it is because this file
- // was generated by a version of the `protoc` Swift plug-in that is
- // incompatible with the version of SwiftProtobuf to which you are linking.
- // Please ensure that you are building against the same version of the API
- // that was used to generate this file.
- fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
- struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
- typealias Version = _2
- }
- struct Pb_CppFeatures: Sendable {
- // SwiftProtobuf.Message conformance is added in an extension below. See the
- // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
- // methods supported on all messages.
- /// Whether or not to treat an enum field as closed. This option is only
- /// applicable to enum fields, and will be removed in the future. It is
- /// consistent with the legacy behavior of using proto3 enum types for proto2
- /// fields.
- var legacyClosedEnum: Bool {
- get {_legacyClosedEnum ?? false}
- set {_legacyClosedEnum = newValue}
- }
- /// Returns true if `legacyClosedEnum` has been explicitly set.
- var hasLegacyClosedEnum: Bool {self._legacyClosedEnum != nil}
- /// Clears the value of `legacyClosedEnum`. Subsequent reads from it will return its default value.
- mutating func clearLegacyClosedEnum() {self._legacyClosedEnum = nil}
- var stringType: Pb_CppFeatures.StringType {
- get {_stringType ?? .unknown}
- set {_stringType = newValue}
- }
- /// Returns true if `stringType` has been explicitly set.
- var hasStringType: Bool {self._stringType != nil}
- /// Clears the value of `stringType`. Subsequent reads from it will return its default value.
- mutating func clearStringType() {self._stringType = nil}
- var enumNameUsesStringView: Bool {
- get {_enumNameUsesStringView ?? false}
- set {_enumNameUsesStringView = newValue}
- }
- /// Returns true if `enumNameUsesStringView` has been explicitly set.
- var hasEnumNameUsesStringView: Bool {self._enumNameUsesStringView != nil}
- /// Clears the value of `enumNameUsesStringView`. Subsequent reads from it will return its default value.
- mutating func clearEnumNameUsesStringView() {self._enumNameUsesStringView = nil}
- var unknownFields = SwiftProtobuf.UnknownStorage()
- enum StringType: Int, SwiftProtobuf.Enum, Swift.CaseIterable {
- case unknown = 0
- case view = 1
- case cord = 2
- case string = 3
- init() {
- self = .unknown
- }
- }
- init() {}
- fileprivate var _legacyClosedEnum: Bool? = nil
- fileprivate var _stringType: Pb_CppFeatures.StringType? = nil
- fileprivate var _enumNameUsesStringView: Bool? = nil
- }
- // MARK: - Extension support defined in cpp_features.proto.
- // MARK: - Extension Properties
- // Swift Extensions on the extended Messages to add easy access to the declared
- // extension fields. The names are based on the extension field name from the proto
- // declaration. To avoid naming collisions, the names are prefixed with the name of
- // the scope where the extend directive occurs.
- extension SwiftProtobuf.Google_Protobuf_FeatureSet {
- var Pb_cpp: Pb_CppFeatures {
- get {return getExtensionValue(ext: Pb_Extensions_cpp) ?? Pb_CppFeatures()}
- set {setExtensionValue(ext: Pb_Extensions_cpp, value: newValue)}
- }
- /// Returns true if extension `Pb_Extensions_cpp`
- /// has been explicitly set.
- var hasPb_cpp: Bool {
- return hasExtensionValue(ext: Pb_Extensions_cpp)
- }
- /// Clears the value of extension `Pb_Extensions_cpp`.
- /// Subsequent reads from it will return its default value.
- mutating func clearPb_cpp() {
- clearExtensionValue(ext: Pb_Extensions_cpp)
- }
- }
- // MARK: - File's ExtensionMap: Pb_CppFeatures_Extensions
- /// A `SwiftProtobuf.SimpleExtensionMap` that includes all of the extensions defined by
- /// this .proto file. It can be used any place an `SwiftProtobuf.ExtensionMap` is needed
- /// in parsing, or it can be combined with other `SwiftProtobuf.SimpleExtensionMap`s to create
- /// a larger `SwiftProtobuf.SimpleExtensionMap`.
- let Pb_CppFeatures_Extensions: SwiftProtobuf.SimpleExtensionMap = [
- Pb_Extensions_cpp
- ]
- // Extension Objects - The only reason these might be needed is when manually
- // constructing a `SimpleExtensionMap`, otherwise, use the above _Extension Properties_
- // accessors for the extension fields on the messages directly.
- let Pb_Extensions_cpp = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalMessageExtensionField<Pb_CppFeatures>, SwiftProtobuf.Google_Protobuf_FeatureSet>(
- _protobuf_fieldNumber: 1000,
- fieldName: "pb.cpp"
- )
- // MARK: - Code below here is support for the SwiftProtobuf runtime.
- fileprivate let _protobuf_package = "pb"
- extension Pb_CppFeatures: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
- static let protoMessageName: String = _protobuf_package + ".CppFeatures"
- static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}legacy_closed_enum\0\u{3}string_type\0\u{3}enum_name_uses_string_view\0")
- mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
- while let fieldNumber = try decoder.nextFieldNumber() {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every case branch when no optimizations are
- // enabled. https://github.com/apple/swift-protobuf/issues/1034
- switch fieldNumber {
- case 1: try { try decoder.decodeSingularBoolField(value: &self._legacyClosedEnum) }()
- case 2: try { try decoder.decodeSingularEnumField(value: &self._stringType) }()
- case 3: try { try decoder.decodeSingularBoolField(value: &self._enumNameUsesStringView) }()
- default: break
- }
- }
- }
- func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
- // The use of inline closures is to circumvent an issue where the compiler
- // allocates stack space for every if/case branch local when no optimizations
- // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
- // https://github.com/apple/swift-protobuf/issues/1182
- try { if let v = self._legacyClosedEnum {
- try visitor.visitSingularBoolField(value: v, fieldNumber: 1)
- } }()
- try { if let v = self._stringType {
- try visitor.visitSingularEnumField(value: v, fieldNumber: 2)
- } }()
- try { if let v = self._enumNameUsesStringView {
- try visitor.visitSingularBoolField(value: v, fieldNumber: 3)
- } }()
- try unknownFields.traverse(visitor: &visitor)
- }
- static func ==(lhs: Pb_CppFeatures, rhs: Pb_CppFeatures) -> Bool {
- if lhs._legacyClosedEnum != rhs._legacyClosedEnum {return false}
- if lhs._stringType != rhs._stringType {return false}
- if lhs._enumNameUsesStringView != rhs._enumNameUsesStringView {return false}
- if lhs.unknownFields != rhs.unknownFields {return false}
- return true
- }
- }
- extension Pb_CppFeatures.StringType: SwiftProtobuf._ProtoNameProviding {
- static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0STRING_TYPE_UNKNOWN\0\u{1}VIEW\0\u{1}CORD\0\u{1}STRING\0")
- }
|