mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-04 17:01:11 +00:00
[swift] Moves code to use VTablesStorage (#5888)
* Moves the code to use _vtablestorage Rebuilt the test to confirm to the new API Adds documentation + generates code for grpc Reverts indentation v0.4.0 Updated swift/readme.md Updates VtableStorage to ensure space instead of reallocating each time Fixes str count not being correct * Fixes issue with boolean constant not being set + removes unused function
This commit is contained in:
@@ -106,14 +106,14 @@ struct VPointerVec {
|
||||
|
||||
static func createVPointer(b: inout FlatBufferBuilder, o: Offset<UOffset>) -> Offset<UOffset> {
|
||||
let s = VPointerVec.startVPointer(b: &b)
|
||||
b.add(structOffset: 0)
|
||||
b.add(structOffset: 4)
|
||||
return VPointerVec.finish(b: &b, s: s)
|
||||
}
|
||||
}
|
||||
|
||||
enum Color: UInt32 { case red = 0, green = 1, blue = 2 }
|
||||
|
||||
private let VPointerVectorVecOffsets: (color: VOffset, vector: VOffset) = (0, 1)
|
||||
private let VPointerVectorVecOffsets: (color: VOffset, vector: VOffset) = (4, 6)
|
||||
|
||||
struct VPointerVectorVec {
|
||||
|
||||
@@ -179,9 +179,9 @@ struct VPointerVec2 {
|
||||
|
||||
static func createVPointer(b: inout FlatBufferBuilder, o: Offset<UOffset>, type: Test) -> Offset<UOffset> {
|
||||
let s = VPointerVec2.startVPointer(b: &b)
|
||||
b.add(structOffset: 0)
|
||||
b.add(element: type.rawValue, def: Test.none.rawValue, at: 1)
|
||||
b.add(offset: o, at: 2)
|
||||
b.add(structOffset: 4)
|
||||
b.add(element: type.rawValue, def: Test.none.rawValue, at: 6)
|
||||
b.add(offset: o, at: 8)
|
||||
return VPointerVec2.finish(b: &b, s: s)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user