FlatBuffers: Memory Efficient Serialization Library
Go to file
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
.appveyor Add support for fixed-size arrays (#5313) 2019-06-18 00:15:13 +02:00
.bazelci Don't test on Ubuntu 14.04 (#5302) 2019-04-24 10:28:35 -07:00
.github Deleted old stale bot 2020-06-15 13:39:46 -07:00
.travis Add CMake 'generated_code' target to simplify resolution of build dependencies (#5697) 2020-01-06 15:26:41 -08:00
CMake Fix RPM install conflict (#6003) 2020-06-25 15:33:58 -07:00
android Removed code_generators.cpp from library targets 2020-01-02 08:50:39 -08:00
bazel Manage grpc dependency in Bazel's WORKSPACE file. (#5995) 2020-06-26 15:39:23 -07:00
conan Update Conan version Automatically (#5027) 2018-11-12 08:49:42 -08:00
dart [Dart] Adding FlexBuffers support (#5853) 2020-05-18 07:50:39 -07:00
docs TypeScript/JavaScript docs improvements (#5984) 2020-06-18 10:23:32 -07:00
go [Go] Implements a SharedStrings function (#5733) 2020-01-24 09:57:34 -08:00
grpc Adds bool support in structs + updates grpc support + CI upgrades (#5943) 2020-06-04 09:14:18 -07:00
include/flatbuffers [C++] Updates real_path to be truly portable (#5787) 2020-06-25 14:40:10 -07:00
java/com/google/flatbuffers [FlexBuffer][Java] ReadWriteBuf and ReadBuf interface public (#5948) 2020-06-08 09:35:51 -07:00
js [TS] Add Obj API (#5788) 2020-04-09 09:53:16 -07:00
lobster Lobster: added builder API for tables 2019-05-22 19:42:13 -07:00
lua Lua cleanup (#5624) 2019-11-14 15:46:46 -08:00
net/FlatBuffers [C#] Thread safe reads of Double and Float values from a ByteBuffer (#5900) 2020-05-07 14:33:29 -07:00
php Performance improvement to generated+supporting PHP (#5080) 2018-12-20 16:10:20 -08:00
python Implement flexbuffers in python (#5880) 2020-05-07 14:26:33 -07:00
reflection Add static asserts to ensure that reflection API arrays are kept in sync (#5934) 2020-06-02 09:50:56 -07:00
rust [Rust] Flexbuffers dependency cleanup and fixes (#5998) 2020-06-25 17:12:10 -07:00
samples [Swift] FlatBuffers createMonster method doesn't treat struct properly (#5992) 2020-06-28 12:36:55 +03:00
snap [snap] Fix versioning (#5727) 2020-02-13 08:05:21 -08:00
src [Swift] FlatBuffers createMonster method doesn't treat struct properly (#5992) 2020-06-28 12:36:55 +03:00
swift [Swift] Initialize memory when clear ByteBuffer (#5982) 2020-06-25 15:11:38 -07:00
tests [Swift] FlatBuffers createMonster method doesn't treat struct properly (#5992) 2020-06-28 12:36:55 +03:00
.clang-format Made all C++ files clang-formatted. 2017-12-21 11:45:02 -08:00
.editorconfig Unify line ending rules in '.editorconfig' and '.gitattributes' (#5231) 2019-03-18 12:47:07 -07:00
.gitattributes Unify line ending rules in '.editorconfig' and '.gitattributes' (#5231) 2019-03-18 12:47:07 -07:00
.gitignore fixed mutating inline values (#5942) 2020-06-04 09:08:41 -07:00
.travis.yml Add `--clean-first` to the cmake-build command (travis) (#5574) 2019-10-21 10:11:32 -07:00
BUILD Split Bazel targets into multiple packages (#5640) 2019-12-02 14:14:48 -08:00
CMakeLists.txt [CMake] : Add precompiled header support with FLATBUFFERS_ENABLE_PCH (#5827) 2020-03-27 08:35:44 -07:00
CONTRIBUTING.md Fixed link to Google C++ Style Guide. 2017-02-08 16:37:25 -08:00
LICENSE.txt Fixed Apache license not using canonical version. 2019-11-04 17:15:56 -08:00
WORKSPACE Manage grpc dependency in Bazel's WORKSPACE file. (#5995) 2020-06-26 15:39:23 -07:00
appveyor.yml [CMake] : Add precompiled header support with FLATBUFFERS_ENABLE_PCH (#5827) 2020-03-27 08:35:44 -07:00
build_defs.bzl [Bazel] Add support for compatible_with and restricted_to (#5681) 2019-12-26 09:58:48 -08:00
composer.json (PHP) add experimental support for PHP language. 2015-11-18 00:26:39 +09:00
conanfile.py Update Conan version Automatically (#5027) 2018-11-12 08:49:42 -08:00
package.json pre-tag version bump for 1.12 2020-03-12 15:33:39 -07:00
pom.xml updated maven build files 2020-03-16 11:33:42 -07:00
readme.md Minor doc updates: FlexBuffers C#, Discord, CppUsage. 2019-12-26 12:36:41 -08:00

readme.md

logo FlatBuffers

Build Status Build status Join the chat at https://gitter.im/google/flatbuffers Discord Chat Twitter Follow

FlatBuffers is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility.

Go to our landing page to browse our documentation.

Supported operating systems

  • Windows
  • MacOS X
  • Linux
  • Android
  • And any others with a recent C++ compiler.

Supported programming languages

  • C++
  • C#
  • C
  • Dart
  • Go
  • Java
  • JavaScript
  • Lobster
  • Lua
  • PHP
  • Python
  • Rust
  • TypeScript

and more in progress...

Contribution

To contribute to this project, see CONTRIBUTING.

Licensing

Flatbuffers is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.