flatbuffers/samples
Liu Liu e810635eaa
[Swift] FlatBuffers createMonster method doesn't treat struct properly (#5992)
* [Swift] FlatBuffers createMonster method doesn't treat struct properly

This PR fixed a issue where a struct is not treated properly when use
create inside.

A example would be the pos inside Monster. The createMonster method
takes an Offset for pos. However, FlatBuffersBuilder.add(struct:)
doesn't really take Offset argument. That means we don't really add a
struct at all for Monster.

It will show up as the pos never set.

This doesn't show up in FlatBuffersMonsterWriterTests.swift because it
implements its own createMonster method, which happens do the dance
properly (i.e. first call create(struct) and then immediately call
add:).

This PR modified the `add(pos:)` interface such that it takes the
UnsafeMutableRawPointer directly, calling `create(struct:)` under the hood.

I can add unit tests once the direction of this PR approved.

* Fix object api pack method codegen.

* Add unit tests that uses Monster.createMonster method to serialize.

* Updated sample_binary.swift
2020-06-28 12:36:55 +03:00
..
android Android: remove app_dummy() calls 2019-08-23 14:33:16 -07:00
lua/MyGame/Sample
android_sample.sh
csharp_sample.sh
dart_sample.sh
go_sample.sh
java_sample.sh
javascript_sample.sh
kotlin_sample.sh Fixed missing generated code. 2019-08-19 17:57:23 -07:00
monster.bfbs
monster.fbs
monster_generated.h [C++] Got rid of memset's in constructors (#5938) 2020-06-01 17:58:52 -07:00
monster_generated.lobster Lobster: added builder API for tables 2019-05-22 19:42:13 -07:00
monster_generated.rs
monsterdata.json [docs] typo: updates monsterdata.json to be valid json (#5978) 2020-06-17 22:35:24 -07:00
php_sample.sh
python_sample.sh
sample_bfbs.cpp Ran src/clang-format-all.sh (#5617) 2019-11-11 09:29:37 -08:00
sample_binary.cpp Ran src/clang-format-all.sh (#5617) 2019-11-11 09:29:37 -08:00
sample_binary.go
sample_binary.lobster Lobster: added builder API for tables 2019-05-22 19:42:13 -07:00
sample_binary.lua
sample_binary.py
sample_binary.rs
sample_binary.swift [Swift] FlatBuffers createMonster method doesn't treat struct properly (#5992) 2020-06-28 12:36:55 +03:00
sample_flexbuffers.rs Rust Flexbuffers Documentation update (#5979) 2020-06-18 00:01:48 -07:00
sample_flexbuffers_serde.rs Rust Flexbuffers (#5669) 2020-05-07 14:11:26 -07:00
sample_text.cpp Ran src/clang-format-all.sh (#5617) 2019-11-11 09:29:37 -08:00
sample_text.lobster Fixed Lobster implementation to work with latest language features 2019-05-22 11:48:10 -07:00
SampleBinary.cs
SampleBinary.java Java: Added access object for vector of struct and vector of tables. (#5233) 2019-09-23 09:22:43 -07:00
samplebinary.js
SampleBinary.kt Add basic Kotlin support (#5409) 2019-07-22 16:05:15 -07:00
SampleBinary.php