mirror of
https://gitee.com/farsunset/cim.git
synced 2025-07-22 15:56:42 +08:00
132 lines
4.8 KiB
Swift
132 lines
4.8 KiB
Swift
// DO NOT EDIT.
|
|
// swift-format-ignore-file
|
|
//
|
|
// Generated by the Swift generator plugin for the protocol buffer compiler.
|
|
// Source: MessageProto.proto
|
|
//
|
|
// For information on using the generated types, please see the documentation:
|
|
// https://github.com/apple/swift-protobuf/
|
|
|
|
import Foundation
|
|
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 MessageProto {
|
|
// 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.
|
|
|
|
var id: Int64 = 0
|
|
|
|
var action: String = String()
|
|
|
|
var content: String = String()
|
|
|
|
var sender: String = String()
|
|
|
|
var receiver: String = String()
|
|
|
|
var extra: String = String()
|
|
|
|
var title: String = String()
|
|
|
|
var format: String = String()
|
|
|
|
var timestamp: Int64 = 0
|
|
|
|
var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
init() {}
|
|
}
|
|
|
|
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
|
|
|
extension MessageProto: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
static let protoMessageName: String = "MessageProto"
|
|
static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
1: .same(proto: "id"),
|
|
2: .same(proto: "action"),
|
|
3: .same(proto: "content"),
|
|
4: .same(proto: "sender"),
|
|
5: .same(proto: "receiver"),
|
|
6: .same(proto: "extra"),
|
|
7: .same(proto: "title"),
|
|
8: .same(proto: "format"),
|
|
9: .same(proto: "timestamp"),
|
|
]
|
|
|
|
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.decodeSingularInt64Field(value: &self.id) }()
|
|
case 2: try { try decoder.decodeSingularStringField(value: &self.action) }()
|
|
case 3: try { try decoder.decodeSingularStringField(value: &self.content) }()
|
|
case 4: try { try decoder.decodeSingularStringField(value: &self.sender) }()
|
|
case 5: try { try decoder.decodeSingularStringField(value: &self.receiver) }()
|
|
case 6: try { try decoder.decodeSingularStringField(value: &self.extra) }()
|
|
case 7: try { try decoder.decodeSingularStringField(value: &self.title) }()
|
|
case 8: try { try decoder.decodeSingularStringField(value: &self.format) }()
|
|
case 9: try { try decoder.decodeSingularInt64Field(value: &self.timestamp) }()
|
|
default: break
|
|
}
|
|
}
|
|
}
|
|
|
|
func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
if self.id != 0 {
|
|
try visitor.visitSingularInt64Field(value: self.id, fieldNumber: 1)
|
|
}
|
|
if !self.action.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.action, fieldNumber: 2)
|
|
}
|
|
if !self.content.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.content, fieldNumber: 3)
|
|
}
|
|
if !self.sender.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.sender, fieldNumber: 4)
|
|
}
|
|
if !self.receiver.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.receiver, fieldNumber: 5)
|
|
}
|
|
if !self.extra.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.extra, fieldNumber: 6)
|
|
}
|
|
if !self.title.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.title, fieldNumber: 7)
|
|
}
|
|
if !self.format.isEmpty {
|
|
try visitor.visitSingularStringField(value: self.format, fieldNumber: 8)
|
|
}
|
|
if self.timestamp != 0 {
|
|
try visitor.visitSingularInt64Field(value: self.timestamp, fieldNumber: 9)
|
|
}
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
}
|
|
|
|
static func ==(lhs: MessageProto, rhs: MessageProto) -> Bool {
|
|
if lhs.id != rhs.id {return false}
|
|
if lhs.action != rhs.action {return false}
|
|
if lhs.content != rhs.content {return false}
|
|
if lhs.sender != rhs.sender {return false}
|
|
if lhs.receiver != rhs.receiver {return false}
|
|
if lhs.extra != rhs.extra {return false}
|
|
if lhs.title != rhs.title {return false}
|
|
if lhs.format != rhs.format {return false}
|
|
if lhs.timestamp != rhs.timestamp {return false}
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
return true
|
|
}
|
|
}
|