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:
mustiikhalil
2021-05-14 20:59:28 +03:00
committed by GitHub
parent 04b10f5a3a
commit a5175c513a
38 changed files with 2291 additions and 168 deletions

View File

@@ -16,7 +16,8 @@
import Foundation
public final class FlatBuffersUtils {
/// FlatBuffersUtils hosts some utility functions that might be useful
public enum FlatBuffersUtils {
/// Gets the size of the prefix
/// - Parameter bb: Flatbuffer object
@@ -24,7 +25,9 @@ public final class FlatBuffersUtils {
bb.read(def: Int32.self, position: bb.reader)
}
/// Removes the prefix by duplicating the Flatbuffer
/// Removes the prefix by duplicating the Flatbuffer this call is expensive since its
/// creates a new buffer use `readPrefixedSizeCheckedRoot` instead
/// unless a completely new buffer is required
/// - Parameter bb: Flatbuffer object
public static func removeSizePrefix(bb: ByteBuffer) -> ByteBuffer {
bb.duplicate(removing: MemoryLayout<Int32>.size)