mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-03 21:14:13 +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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user