mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 17:12:01 +00:00
Implements verifier and code gen for swift (#6373)
Updates test cases on linux Adhere to new protocol naming Adds fuzzing Adds documentation Adds support for string unions Updated fuzzer generated code
This commit is contained in:
@@ -31,15 +31,26 @@ public protocol FlatBufferObject: FlatbuffersInitializable {
|
||||
var __buffer: ByteBuffer! { get }
|
||||
}
|
||||
|
||||
/// `ObjectAPIPacker` is a protocol that allows object to pack and unpack from a
|
||||
/// `NativeObject` to a flatbuffers Object and vice versa.
|
||||
public protocol ObjectAPIPacker {
|
||||
/// associatedtype to the object that should be unpacked.
|
||||
associatedtype T
|
||||
|
||||
/// `pack` tries packs the variables of a native Object into the `ByteBuffer` by using
|
||||
/// the FlatBufferBuilder
|
||||
/// - Parameters:
|
||||
/// - builder: FlatBufferBuilder that will host incoming data
|
||||
/// - obj: Object of associatedtype to the current implementer
|
||||
static func pack(_ builder: inout FlatBufferBuilder, obj: inout T?) -> Offset
|
||||
|
||||
/// `pack` packs the variables of a native Object into the `ByteBuffer` by using
|
||||
/// the FlatBufferBuilder
|
||||
/// - Parameters:
|
||||
/// - builder: FlatBufferBuilder that will host incoming data
|
||||
/// - obj: Object of associatedtype to the current implementer
|
||||
static func pack(_ builder: inout FlatBufferBuilder, obj: inout T) -> Offset
|
||||
|
||||
/// `Unpack` unpacks a flatbuffers object into a `NativeObject`
|
||||
mutating func unpack() -> T
|
||||
}
|
||||
|
||||
public protocol Enum {
|
||||
associatedtype T: Scalar
|
||||
static var byteSize: Int { get }
|
||||
var value: T { get }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user