mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 18:00:02 +00:00
Removes Dead code & regenerate code (#7744)
Formats the swift project Update Sample files Update docc documentation Updates swift docs in the website Updates code for Wasm
This commit is contained in:
1
tests/swift/Wasm.tests/.swift-version
Normal file
1
tests/swift/Wasm.tests/.swift-version
Normal file
@@ -0,0 +1 @@
|
||||
wasm-5.7-SNAPSHOT-2022-09-24-a
|
||||
@@ -30,5 +30,5 @@ let package = Package(
|
||||
name: "Wasm"),
|
||||
.testTarget(
|
||||
name: "FlatBuffers.Test.Swift.WasmTests",
|
||||
dependencies: ["FlatBuffers"])
|
||||
dependencies: ["FlatBuffers"]),
|
||||
])
|
||||
|
||||
@@ -1 +1,17 @@
|
||||
/*
|
||||
* Copyright 2023 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
public struct Wasm {}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021 Google Inc. All rights reserved.
|
||||
* Copyright 2023 Google Inc. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -38,7 +38,8 @@ class FlatBuffersMonsterWriterTests: XCTestCase {
|
||||
// swiftformat:disable all
|
||||
XCTAssertEqual(bytes.sizedByteArray, [48, 0, 0, 0, 77, 79, 78, 83, 0, 0, 0, 0, 36, 0, 72, 0, 40, 0, 0, 0, 38, 0, 32, 0, 0, 0, 28, 0, 0, 0, 27, 0, 20, 0, 16, 0, 12, 0, 4, 0, 0, 0, 0, 0, 0, 0, 11, 0, 36, 0, 0, 0, 164, 0, 0, 0, 0, 0, 0, 1, 60, 0, 0, 0, 68, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 1, 88, 0, 0, 0, 120, 0, 0, 0, 0, 0, 80, 0, 0, 0, 128, 63, 0, 0, 0, 64, 0, 0, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 64, 2, 0, 5, 0, 6, 0, 0, 0, 2, 0, 0, 0, 64, 0, 0, 0, 48, 0, 0, 0, 2, 0, 0, 0, 30, 0, 40, 0, 10, 0, 20, 0, 152, 255, 255, 255, 4, 0, 0, 0, 4, 0, 0, 0, 70, 114, 101, 100, 0, 0, 0, 0, 5, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0, 5, 0, 0, 0, 116, 101, 115, 116, 50, 0, 0, 0, 5, 0, 0, 0, 116, 101, 115, 116, 49, 0, 0, 0, 9, 0, 0, 0, 77, 121, 77, 111, 110, 115, 116, 101, 114, 0, 0, 0, 3, 0, 0, 0, 20, 0, 0, 0, 36, 0, 0, 0, 4, 0, 0, 0, 240, 255, 255, 255, 32, 0, 0, 0, 248, 255, 255, 255, 36, 0, 0, 0, 12, 0, 8, 0, 0, 0, 0, 0, 0, 0, 4, 0, 12, 0, 0, 0, 28, 0, 0, 0, 5, 0, 0, 0, 87, 105, 108, 109, 97, 0, 0, 0, 6, 0, 0, 0, 66, 97, 114, 110, 101, 121, 0, 0, 5, 0, 0, 0, 70, 114, 111, 100, 111, 0, 0, 0])
|
||||
// swiftformat:enable all
|
||||
let monster = MyGame_Example_Monster.getRootAsMonster(bb: bytes.buffer)
|
||||
var buffer = bytes.buffer
|
||||
let monster: MyGame_Example_Monster = getRoot(byteBuffer: &buffer)
|
||||
readMonster(monster: monster)
|
||||
mutateMonster(fb: bytes.buffer)
|
||||
readMonster(monster: monster)
|
||||
@@ -69,7 +70,8 @@ class FlatBuffersMonsterWriterTests: XCTestCase {
|
||||
Monster.add(name: name, &fbb)
|
||||
let root = Monster.endMonster(&fbb, start: mStart)
|
||||
fbb.finish(offset: root)
|
||||
let newMonster = Monster.getRootAsMonster(bb: fbb.sizedBuffer)
|
||||
var buffer = fbb.sizedBuffer
|
||||
let newMonster: MyGame_Example_Monster = getRoot(byteBuffer: &buffer)
|
||||
XCTAssertNil(newMonster.pos)
|
||||
XCTAssertEqual(newMonster.name, "Frodo")
|
||||
}
|
||||
@@ -91,7 +93,8 @@ class FlatBuffersMonsterWriterTests: XCTestCase {
|
||||
let root = Monster.endMonster(&fbb, start: mStart)
|
||||
fbb.finish(offset: root)
|
||||
|
||||
let newMonster = Monster.getRootAsMonster(bb: fbb.sizedBuffer)
|
||||
var buffer = fbb.sizedBuffer
|
||||
let newMonster: MyGame_Example_Monster = getRoot(byteBuffer: &buffer)
|
||||
XCTAssertEqual(newMonster.pos!.x, 10)
|
||||
XCTAssertEqual(newMonster.name, "Barney")
|
||||
}
|
||||
@@ -106,7 +109,8 @@ class FlatBuffersMonsterWriterTests: XCTestCase {
|
||||
nameOffset: name,
|
||||
testarrayofboolsVectorOffset: bools)
|
||||
fbb.finish(offset: root)
|
||||
let monster = Monster.getRootAsMonster(bb: fbb.sizedBuffer)
|
||||
var buffer = fbb.sizedBuffer
|
||||
let monster: MyGame_Example_Monster = getRoot(byteBuffer: &buffer)
|
||||
|
||||
let values = monster.testarrayofbools
|
||||
|
||||
@@ -130,9 +134,9 @@ class FlatBuffersMonsterWriterTests: XCTestCase {
|
||||
readFlatbufferMonster(monster: &monster)
|
||||
let unpacked: MyGame_Example_MonsterT? = monster.unpack()
|
||||
readObjectApi(monster: unpacked!)
|
||||
guard let buffer = unpacked?.serialize()
|
||||
guard var buffer = unpacked?.serialize()
|
||||
else { fatalError("Couldnt generate bytebuffer") }
|
||||
var newMonster = Monster.getRootAsMonster(bb: buffer)
|
||||
var newMonster: MyGame_Example_Monster = getRoot(byteBuffer: &buffer)
|
||||
readFlatbufferMonster(monster: &newMonster)
|
||||
}
|
||||
|
||||
@@ -198,7 +202,9 @@ class FlatBuffersMonsterWriterTests: XCTestCase {
|
||||
}
|
||||
|
||||
func mutateMonster(fb: ByteBuffer) {
|
||||
let monster = Monster.getRootAsMonster(bb: fb)
|
||||
var fb = fb
|
||||
|
||||
let monster: Monster = getRoot(byteBuffer: &fb)
|
||||
XCTAssertFalse(monster.mutate(mana: 10))
|
||||
XCTAssertEqual(monster.testarrayoftables(at: 0)?.name, "Barney")
|
||||
XCTAssertEqual(monster.testarrayoftables(at: 1)?.name, "Frodo")
|
||||
|
||||
@@ -685,8 +685,6 @@ public struct MyGame_InParentNamespace: FlatBufferObject, Verifiable, ObjectAPIP
|
||||
|
||||
public static var id: String { "MONS" }
|
||||
public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_InParentNamespace.id, addPrefix: prefix) }
|
||||
public static func getRootAsInParentNamespace(bb: ByteBuffer) -> MyGame_InParentNamespace { return MyGame_InParentNamespace(Table(bb: bb, position: Int32(bb.read(def: UOffset.self, position: bb.reader)) + Int32(bb.reader))) }
|
||||
|
||||
private init(_ t: Table) { _accessor = t }
|
||||
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
||||
|
||||
@@ -739,8 +737,6 @@ public struct MyGame_Example2_Monster: FlatBufferObject, Verifiable, ObjectAPIPa
|
||||
|
||||
public static var id: String { "MONS" }
|
||||
public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example2_Monster.id, addPrefix: prefix) }
|
||||
public static func getRootAsMonster(bb: ByteBuffer) -> MyGame_Example2_Monster { return MyGame_Example2_Monster(Table(bb: bb, position: Int32(bb.read(def: UOffset.self, position: bb.reader)) + Int32(bb.reader))) }
|
||||
|
||||
private init(_ t: Table) { _accessor = t }
|
||||
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
||||
|
||||
@@ -793,8 +789,6 @@ internal struct MyGame_Example_TestSimpleTableWithEnum: FlatBufferObject, Verifi
|
||||
|
||||
internal static var id: String { "MONS" }
|
||||
internal static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_TestSimpleTableWithEnum.id, addPrefix: prefix) }
|
||||
internal static func getRootAsTestSimpleTableWithEnum(bb: ByteBuffer) -> MyGame_Example_TestSimpleTableWithEnum { return MyGame_Example_TestSimpleTableWithEnum(Table(bb: bb, position: Int32(bb.read(def: UOffset.self, position: bb.reader)) + Int32(bb.reader))) }
|
||||
|
||||
private init(_ t: Table) { _accessor = t }
|
||||
internal init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
||||
|
||||
@@ -876,8 +870,6 @@ public struct MyGame_Example_Stat: FlatBufferObject, Verifiable, ObjectAPIPacker
|
||||
|
||||
public static var id: String { "MONS" }
|
||||
public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_Stat.id, addPrefix: prefix) }
|
||||
public static func getRootAsStat(bb: ByteBuffer) -> MyGame_Example_Stat { return MyGame_Example_Stat(Table(bb: bb, position: Int32(bb.read(def: UOffset.self, position: bb.reader)) + Int32(bb.reader))) }
|
||||
|
||||
private init(_ t: Table) { _accessor = t }
|
||||
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
||||
|
||||
@@ -1017,8 +1009,6 @@ public struct MyGame_Example_Referrable: FlatBufferObject, Verifiable, ObjectAPI
|
||||
|
||||
public static var id: String { "MONS" }
|
||||
public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_Referrable.id, addPrefix: prefix) }
|
||||
public static func getRootAsReferrable(bb: ByteBuffer) -> MyGame_Example_Referrable { return MyGame_Example_Referrable(Table(bb: bb, position: Int32(bb.read(def: UOffset.self, position: bb.reader)) + Int32(bb.reader))) }
|
||||
|
||||
private init(_ t: Table) { _accessor = t }
|
||||
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
||||
|
||||
@@ -1125,8 +1115,6 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac
|
||||
|
||||
public static var id: String { "MONS" }
|
||||
public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_Monster.id, addPrefix: prefix) }
|
||||
public static func getRootAsMonster(bb: ByteBuffer) -> MyGame_Example_Monster { return MyGame_Example_Monster(Table(bb: bb, position: Int32(bb.read(def: UOffset.self, position: bb.reader)) + Int32(bb.reader))) }
|
||||
|
||||
private init(_ t: Table) { _accessor = t }
|
||||
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
||||
|
||||
@@ -1344,19 +1332,19 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac
|
||||
@discardableResult public func mutate(longEnumNormalDefault: MyGame_Example_LongEnum) -> Bool {let o = _accessor.offset(VTOFFSET.longEnumNormalDefault.v); return _accessor.mutate(longEnumNormalDefault.rawValue, index: o) }
|
||||
public var nanDefault: Float32 { let o = _accessor.offset(VTOFFSET.nanDefault.v); return o == 0 ? .nan : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
@discardableResult public func mutate(nanDefault: Float32) -> Bool {let o = _accessor.offset(VTOFFSET.nanDefault.v); return _accessor.mutate(nanDefault, index: o) }
|
||||
public var infDefault: Float32 { let o = _accessor.offset(VTOFFSET.infDefault.v); return o == 0 ? +.infinity : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
public var infDefault: Float32 { let o = _accessor.offset(VTOFFSET.infDefault.v); return o == 0 ? .infinity : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
@discardableResult public func mutate(infDefault: Float32) -> Bool {let o = _accessor.offset(VTOFFSET.infDefault.v); return _accessor.mutate(infDefault, index: o) }
|
||||
public var positiveInfDefault: Float32 { let o = _accessor.offset(VTOFFSET.positiveInfDefault.v); return o == 0 ? +.infinity : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
public var positiveInfDefault: Float32 { let o = _accessor.offset(VTOFFSET.positiveInfDefault.v); return o == 0 ? .infinity : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
@discardableResult public func mutate(positiveInfDefault: Float32) -> Bool {let o = _accessor.offset(VTOFFSET.positiveInfDefault.v); return _accessor.mutate(positiveInfDefault, index: o) }
|
||||
public var infinityDefault: Float32 { let o = _accessor.offset(VTOFFSET.infinityDefault.v); return o == 0 ? +.infinity : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
public var infinityDefault: Float32 { let o = _accessor.offset(VTOFFSET.infinityDefault.v); return o == 0 ? .infinity : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
@discardableResult public func mutate(infinityDefault: Float32) -> Bool {let o = _accessor.offset(VTOFFSET.infinityDefault.v); return _accessor.mutate(infinityDefault, index: o) }
|
||||
public var positiveInfinityDefault: Float32 { let o = _accessor.offset(VTOFFSET.positiveInfinityDefault.v); return o == 0 ? +.infinity : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
public var positiveInfinityDefault: Float32 { let o = _accessor.offset(VTOFFSET.positiveInfinityDefault.v); return o == 0 ? .infinity : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
@discardableResult public func mutate(positiveInfinityDefault: Float32) -> Bool {let o = _accessor.offset(VTOFFSET.positiveInfinityDefault.v); return _accessor.mutate(positiveInfinityDefault, index: o) }
|
||||
public var negativeInfDefault: Float32 { let o = _accessor.offset(VTOFFSET.negativeInfDefault.v); return o == 0 ? -.infinity : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
@discardableResult public func mutate(negativeInfDefault: Float32) -> Bool {let o = _accessor.offset(VTOFFSET.negativeInfDefault.v); return _accessor.mutate(negativeInfDefault, index: o) }
|
||||
public var negativeInfinityDefault: Float32 { let o = _accessor.offset(VTOFFSET.negativeInfinityDefault.v); return o == 0 ? -.infinity : _accessor.readBuffer(of: Float32.self, at: o) }
|
||||
@discardableResult public func mutate(negativeInfinityDefault: Float32) -> Bool {let o = _accessor.offset(VTOFFSET.negativeInfinityDefault.v); return _accessor.mutate(negativeInfinityDefault, index: o) }
|
||||
public var doubleInfDefault: Double { let o = _accessor.offset(VTOFFSET.doubleInfDefault.v); return o == 0 ? +.infinity : _accessor.readBuffer(of: Double.self, at: o) }
|
||||
public var doubleInfDefault: Double { let o = _accessor.offset(VTOFFSET.doubleInfDefault.v); return o == 0 ? .infinity : _accessor.readBuffer(of: Double.self, at: o) }
|
||||
@discardableResult public func mutate(doubleInfDefault: Double) -> Bool {let o = _accessor.offset(VTOFFSET.doubleInfDefault.v); return _accessor.mutate(doubleInfDefault, index: o) }
|
||||
public static func startMonster(_ fbb: inout FlatBufferBuilder) -> UOffset { fbb.startTable(with: 62) }
|
||||
public static func add(pos: MyGame_Example_Vec3?, _ fbb: inout FlatBufferBuilder) { guard let pos = pos else { return }; fbb.create(struct: pos, position: VTOFFSET.pos.p) }
|
||||
@@ -1423,13 +1411,13 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac
|
||||
public static func add(longEnumNonEnumDefault: MyGame_Example_LongEnum, _ fbb: inout FlatBufferBuilder) { fbb.add(element: longEnumNonEnumDefault.rawValue, def: 0, at: VTOFFSET.longEnumNonEnumDefault.p) }
|
||||
public static func add(longEnumNormalDefault: MyGame_Example_LongEnum, _ fbb: inout FlatBufferBuilder) { fbb.add(element: longEnumNormalDefault.rawValue, def: 2, at: VTOFFSET.longEnumNormalDefault.p) }
|
||||
public static func add(nanDefault: Float32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: nanDefault, def: .nan, at: VTOFFSET.nanDefault.p) }
|
||||
public static func add(infDefault: Float32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: infDefault, def: +.infinity, at: VTOFFSET.infDefault.p) }
|
||||
public static func add(positiveInfDefault: Float32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: positiveInfDefault, def: +.infinity, at: VTOFFSET.positiveInfDefault.p) }
|
||||
public static func add(infinityDefault: Float32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: infinityDefault, def: +.infinity, at: VTOFFSET.infinityDefault.p) }
|
||||
public static func add(positiveInfinityDefault: Float32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: positiveInfinityDefault, def: +.infinity, at: VTOFFSET.positiveInfinityDefault.p) }
|
||||
public static func add(infDefault: Float32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: infDefault, def: .infinity, at: VTOFFSET.infDefault.p) }
|
||||
public static func add(positiveInfDefault: Float32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: positiveInfDefault, def: .infinity, at: VTOFFSET.positiveInfDefault.p) }
|
||||
public static func add(infinityDefault: Float32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: infinityDefault, def: .infinity, at: VTOFFSET.infinityDefault.p) }
|
||||
public static func add(positiveInfinityDefault: Float32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: positiveInfinityDefault, def: .infinity, at: VTOFFSET.positiveInfinityDefault.p) }
|
||||
public static func add(negativeInfDefault: Float32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: negativeInfDefault, def: -.infinity, at: VTOFFSET.negativeInfDefault.p) }
|
||||
public static func add(negativeInfinityDefault: Float32, _ fbb: inout FlatBufferBuilder) { fbb.add(element: negativeInfinityDefault, def: -.infinity, at: VTOFFSET.negativeInfinityDefault.p) }
|
||||
public static func add(doubleInfDefault: Double, _ fbb: inout FlatBufferBuilder) { fbb.add(element: doubleInfDefault, def: +.infinity, at: VTOFFSET.doubleInfDefault.p) }
|
||||
public static func add(doubleInfDefault: Double, _ fbb: inout FlatBufferBuilder) { fbb.add(element: doubleInfDefault, def: .infinity, at: VTOFFSET.doubleInfDefault.p) }
|
||||
public static func endMonster(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset { let end = Offset(offset: fbb.endTable(at: start)); fbb.require(table: end, fields: [10]); return end }
|
||||
public static func createMonster(
|
||||
_ fbb: inout FlatBufferBuilder,
|
||||
@@ -1487,13 +1475,13 @@ public struct MyGame_Example_Monster: FlatBufferObject, Verifiable, ObjectAPIPac
|
||||
longEnumNonEnumDefault: MyGame_Example_LongEnum = .longone,
|
||||
longEnumNormalDefault: MyGame_Example_LongEnum = .longone,
|
||||
nanDefault: Float32 = .nan,
|
||||
infDefault: Float32 = +.infinity,
|
||||
positiveInfDefault: Float32 = +.infinity,
|
||||
infinityDefault: Float32 = +.infinity,
|
||||
positiveInfinityDefault: Float32 = +.infinity,
|
||||
infDefault: Float32 = .infinity,
|
||||
positiveInfDefault: Float32 = .infinity,
|
||||
infinityDefault: Float32 = .infinity,
|
||||
positiveInfinityDefault: Float32 = .infinity,
|
||||
negativeInfDefault: Float32 = -.infinity,
|
||||
negativeInfinityDefault: Float32 = -.infinity,
|
||||
doubleInfDefault: Double = +.infinity
|
||||
doubleInfDefault: Double = .infinity
|
||||
) -> Offset {
|
||||
let __start = MyGame_Example_Monster.startMonster(&fbb)
|
||||
MyGame_Example_Monster.add(pos: pos, &fbb)
|
||||
@@ -2108,16 +2096,16 @@ extension MyGame_Example_Monster: Encodable {
|
||||
if !nanDefault.isNaN {
|
||||
try container.encodeIfPresent(nanDefault, forKey: .nanDefault)
|
||||
}
|
||||
if infDefault != +.infinity {
|
||||
if infDefault != .infinity {
|
||||
try container.encodeIfPresent(infDefault, forKey: .infDefault)
|
||||
}
|
||||
if positiveInfDefault != +.infinity {
|
||||
if positiveInfDefault != .infinity {
|
||||
try container.encodeIfPresent(positiveInfDefault, forKey: .positiveInfDefault)
|
||||
}
|
||||
if infinityDefault != +.infinity {
|
||||
if infinityDefault != .infinity {
|
||||
try container.encodeIfPresent(infinityDefault, forKey: .infinityDefault)
|
||||
}
|
||||
if positiveInfinityDefault != +.infinity {
|
||||
if positiveInfinityDefault != .infinity {
|
||||
try container.encodeIfPresent(positiveInfinityDefault, forKey: .positiveInfinityDefault)
|
||||
}
|
||||
if negativeInfDefault != -.infinity {
|
||||
@@ -2126,7 +2114,7 @@ extension MyGame_Example_Monster: Encodable {
|
||||
if negativeInfinityDefault != -.infinity {
|
||||
try container.encodeIfPresent(negativeInfinityDefault, forKey: .negativeInfinityDefault)
|
||||
}
|
||||
if doubleInfDefault != +.infinity {
|
||||
if doubleInfDefault != .infinity {
|
||||
try container.encodeIfPresent(doubleInfDefault, forKey: .doubleInfDefault)
|
||||
}
|
||||
}
|
||||
@@ -2403,13 +2391,13 @@ public class MyGame_Example_MonsterT: NativeObject {
|
||||
longEnumNonEnumDefault = .longone
|
||||
longEnumNormalDefault = .longone
|
||||
nanDefault = .nan
|
||||
infDefault = +.infinity
|
||||
positiveInfDefault = +.infinity
|
||||
infinityDefault = +.infinity
|
||||
positiveInfinityDefault = +.infinity
|
||||
infDefault = .infinity
|
||||
positiveInfDefault = .infinity
|
||||
infinityDefault = .infinity
|
||||
positiveInfinityDefault = .infinity
|
||||
negativeInfDefault = -.infinity
|
||||
negativeInfinityDefault = -.infinity
|
||||
doubleInfDefault = +.infinity
|
||||
doubleInfDefault = .infinity
|
||||
}
|
||||
|
||||
public func serialize() -> ByteBuffer { return serialize(type: MyGame_Example_Monster.self) }
|
||||
@@ -2423,8 +2411,6 @@ public struct MyGame_Example_TypeAliases: FlatBufferObject, Verifiable, ObjectAP
|
||||
|
||||
public static var id: String { "MONS" }
|
||||
public static func finish(_ fbb: inout FlatBufferBuilder, end: Offset, prefix: Bool = false) { fbb.finish(offset: end, fileId: MyGame_Example_TypeAliases.id, addPrefix: prefix) }
|
||||
public static func getRootAsTypeAliases(bb: ByteBuffer) -> MyGame_Example_TypeAliases { return MyGame_Example_TypeAliases(Table(bb: bb, position: Int32(bb.read(def: UOffset.self, position: bb.reader)) + Int32(bb.reader))) }
|
||||
|
||||
private init(_ t: Table) { _accessor = t }
|
||||
public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user