- 19 Jan, 2020 1 commit
-
-
Max Burke authored
* Bugfix for Rust generation of union fields named with language keywords Looking at ParseField, it appears that in the case of unions, an extra field with a `UnionTypeFieldSuffix` is added to the type definition, however, if the name of this field is a keyword in the target language, it isn't escaped. For example, if generating code for rust for a union field named `type`, flatc will generate a (non-keyword escaped) field named `type_type` for this hidden union field, and one (keyword escaped) called `type_` for the actual union contents. When the union accessors are generated, they refer to this `type_type` field, but they will escape it mistakenly, generating code like this: ``` #[inline] #[allow(non_snake_case)] pub fn type__as_int(&self) -> Option<Int<'a>> { if self.type__type() == Type::Int { self.type_().map(|u| Int::init_from_table(u)) } else { None } } ``` Which will fail to build because the field is called `self.type_type()`, not `self.type__type()`. * [Rust] Add crate-relative use statements for FBS includes. At present if a flatbuffer description includes a reference to a type in another file, the generated Rust code needs to be hand-modified to add the appropriate `use` statements. This assumes that the dependencies are built into the same crate, which I think is a reasonable assumption? * Revert "[Rust] Add crate-relative use statements for FBS includes." This reverts commit d554d79fecf5afd6da6fb993b30b4cd523a5889a. * Add updated generated test files. * Fixing Rust test harness to handle new includes. Test binaries need to add references to generated code that's transitively included. This also has the knock-on in that this code (which is referenced by include directives directly in the flatbuffer schema files) also needs to be generated, hence the changes to generate_code.sh. * Test harnesses expect test data to be checked in. Put include_test2 files into the same directory as the include_test2 schema definition. Update all code generation scripts (forgot the batch file from last time). Path updates in Rust test. * Include updated generated code * Address comments raised in PR * Fix failing Rust tests. * Previous merge clobbered this branch change. * Add updated imports to benchmarks. * Clarifying comment per PR request * Update documentation comments per feedback * Remove non-Rust generated files for include tests, per feedback from @rw/@aardappel * Broken code generation batch file * Fix typo * Add TODO for tidying up use declaration traversal sometime in the future * Update test files.
-
- 17 Jan, 2020 1 commit
-
-
Somo authored
* go: replace objAPI-generated Pack func with method See discussion at https://github.com/google/flatbuffers/issues/5668 * go: replace generated union type UnPack func with method Similar to discussion https://github.com/google/flatbuffers/issues/5668 But signature: ``` func AnyUnPack(t Any, table flatbuffers.Table) *AnyT ``` Becomes, ``` func (rcv Any) UnPack(table flatbuffers.Table) *AnyT ```
-
- 16 Jan, 2020 2 commits
-
-
Vladimir Glavnyy authored
* Add test-case for testing of the future Color in json (output_enum_identifiers = true) * Refactoring of idl_gen_text.cpp. Fix for printing of bit-enum with active output_enum_identifiers=1. * Move GenerateText implementation into class * Remove unnecessary code from flatbuffers.h
-
vkill authored
* [Swift] Support create long string * [Swift] Move the test case to correct dir
-
- 13 Jan, 2020 1 commit
-
-
mustiikhalil authored
Fixed the create functions and updated the test cases in swift Removes unneeded code Updated documentation
-
- 09 Jan, 2020 3 commits
-
-
🎉 🎉 mustiikhalil authored* Implemented the swift version of Flatbuffers Implemented serailzing, reading, and mutating data from object monster Fixes mis-aligned pointer issue Fixes issue when shared strings are removed from table Adds swift enum, structs code gen Fixed namespace issues + started implementing the table gen Added Mutate function to the code generator Generated linux test cases Fixed an issue with bools, and structs readers in table writer Swift docker image added Updated the test cases, and removed a method parameters in swift Fixed createVector api when called with scalars Fixed issues with scalar arrays, and fixed the code gen namespaces, added sample_binary.swift Cleaned up project Added enum vectors, and their readers Refactored code Added swift into the support document Added documentation in docs, and fixed a small issue with Data() not being returned correctly Fixes Lowercase issue, and prevents generating lookups for deprecated keys * Made all the required funcs to have const + removed unneeded code + fix lowercase func * Removed transform from lowercased and moved it to function * Fixes an issue with iOS allocation from read * Refactored cpp code to be more readable * casts position into int for position * Fix enums issue, moves scalar writer code to use memcpy * Removed c_str from struct function * Fixed script to generate new objects when ran on travis ci: fix * Handles deallocating space allocated for structs * Updated the test cases to adhere to the fileprivate lookup, no mutation for unions, and updated the names of the vector functions
-
Wouter van Oortmerssen authored
StringToNumber will correctly use locale-insensitive functions when available. Change-Id: I6bde11039a541634186f8f791012af2eb0d86b8d
-
-
- 06 Jan, 2020 3 commits
-
-
Vladimir Glavnyy authored
-
Michael Beardsworth authored
This change allows for the generation of fbs files (from proto) that don't contain name collisions with the protobuf generated C++ code, allowing both the proto and fbs message types to be linked into the same binary.
-
dreifachstein authored
StandardCharsets.UTF_8 is already used in FlexBuffersBuilder.
-
- 02 Jan, 2020 3 commits
-
-
Robert Winslow authored
Rare failures occur on AppVeyor in these functions; the failures appear spurious.
-
David P. Sicilia authored
* Include flattests_cpp17 in unit tests when C++17 build is enabled. * [C++17] Generate generic table factory function. 1. For each table, generate a convenient free-standing factory function that allows creating the table in a generic way by specifying only the type. This is the first change in a series of changes to make Flatbuffers generated C++ code more friendly to code bases that make use of C++ template metaprogramming techniques to manage the serialization process. Example: Before :( // The name of the Flatbuffers type (and namespace) must // be hard-coded when writing the factory function. auto monster = MyGame::Example::CreateMonster(fbb, ...); After :) using type_to_create = MyGame::Example::Monster; // No namespace needed on CreateByTagType. auto monster = CreateByTagType((type_to_create*)nullptr, fbb, ...); This feature requires building with C++14 or greater, and thus it is guarded behind --cpp-std >= c++17 in the flatbuffers C++ generator. 2. Fix a CMake bug to include C++17 unit tests in test suite. * [C++17] Replace standalone variadic factory function with type_traits. Add a `type_traits` to each table class. This `type_traits` can be populated with various compile-time info about the table. Initially, we have the Create* function and type, but is extensible in the future. * Remove empty line and fix stale comments. * Rename type_traits to Traits and move fwd declaration. * Fix parameter evaluation order issue and use lambda for scope.
-
Wouter van Oortmerssen authored
Change-Id: Ia6e032a77983bf1838b8675f51d1c910acc991d8
-
- 31 Dec, 2019 1 commit
-
-
Max Burke authored
* Bugfix for Rust generation of union fields named with language keywords Looking at ParseField, it appears that in the case of unions, an extra field with a `UnionTypeFieldSuffix` is added to the type definition, however, if the name of this field is a keyword in the target language, it isn't escaped. For example, if generating code for rust for a union field named `type`, flatc will generate a (non-keyword escaped) field named `type_type` for this hidden union field, and one (keyword escaped) called `type_` for the actual union contents. When the union accessors are generated, they refer to this `type_type` field, but they will escape it mistakenly, generating code like this: ``` #[inline] #[allow(non_snake_case)] pub fn type__as_int(&self) -> Option<Int<'a>> { if self.type__type() == Type::Int { self.type_().map(|u| Int::init_from_table(u)) } else { None } } ``` Which will fail to build because the field is called `self.type_type()`, not `self.type__type()`. * [Rust] Add crate-relative use statements for FBS includes. At present if a flatbuffer description includes a reference to a type in another file, the generated Rust code needs to be hand-modified to add the appropriate `use` statements. This assumes that the dependencies are built into the same crate, which I think is a reasonable assumption? * Revert "[Rust] Add crate-relative use statements for FBS includes." This reverts commit d554d79fecf5afd6da6fb993b30b4cd523a5889a. * Address comments raised in PR * Update documentation comments per feedback * Fix typo * [rust] Make enum variant names public. * Update generated test files * Add test for public enum names
-
- 30 Dec, 2019 1 commit
-
-
Michael Beardsworth authored
4d1a9f8d9eab9fc6762e03cd862576965a0c6920 inverted the logic around keeping the include prefix. This change fixes the error.
-
- 27 Dec, 2019 1 commit
-
-
lu-wang-g authored
Add the support to pack using numpy for scalar vectors when numpy is available.
-
- 26 Dec, 2019 6 commits
-
-
Austin Schuh authored
* Add Builder and Table typedefs This gives us a way to use templates to go from a builder to a table and back again without having to pass both types in. * Fix tests/cpp17/generated_cpp17/monster_test_generated.h
-
Wouter van Oortmerssen authored
Change-Id: Ie34ff580eb2f41ff35f85271b10865f4a14d0dca
-
Austin Schuh authored
This should help with #5672 if I'm reading the report back from buildkite properly.
-
Austin Schuh authored
Incompatible flag --incompatible_load_cc_rules_from_bzl will break FlatBuffers once Bazel 1.2.1 is released. Fixes #5671
-
Austin Schuh authored
For C++11 platforms, absl::string_view is sometimes available. This can be used for string_view when std::string_view is not available.
-
Austin Schuh authored
* Add support for compatible_with and restricted_to These attributes have been available in Bazel for years. Pass them through so the flatbuffer rules can be used with them. They let you constrain which target platform is used. While we are here, fix gen_reflections to work with bazel. * Add docs
-
- 24 Dec, 2019 3 commits
-
-
Robert Winslow authored
* New Docker tests for Python with numpy * print numpy status in test suite
-
Wouter van Oortmerssen authored
"'this' object cannot be used before all of its fields are assigned to" Change-Id: Icccdcc0d0be0fe0b87abe0eb28fe1cc91116fcfb
-
Wouter van Oortmerssen authored
- Missing return statement <- bug! - Missing hashCode function. Change-Id: I6333cac72adf8ead92ab2e6c7215650ce4571a73
-
- 23 Dec, 2019 6 commits
-
-
Wouter van Oortmerssen authored
Change-Id: Ia6c3bf5d7da795db46c0baa8e9c7591de3400517
-
Wouter van Oortmerssen authored
Change-Id: Iaf64bec068d03dd1b75670e9a28dde7392ebddb5
-
Vladimir Glavnyy authored
* Add flatc '--cpp_std' switch and sandbox for C++17 code generator - Added 'flac --cpp_std legacy' for compatibility with old compilers (VS2010); - Added experimental switch 'flac --cpp_std c++17' for future development; - Added C++17 sandbox test_cpp17.cpp; - C++ code generator generates enums with explicit underlying type to avoid problems with the forward and backward schema compatibility; - Adjusted CMakeLists.txt, CI and generate code scripts to support of introduced '--cpp_std'; * Fix --cpp_std values: c++0x, c++11, c++17 * Add 'cpp::CppStandard' enum * Add testing engine into test_cpp17 * Rebase to upstream/master * Set default '--cpp-std C++0x' * Fix code generation (--cpp_std C++11) in CMakeLists.txt - Fix dependency declaration of grpctest target * Revert --cpp-std for the tests from explicit C++11 to flatc default value (C++0x)
-
Wouter van Oortmerssen authored
For details, test.cpp/FlexBuffersDeprecatedTest(), and also https://github.com/google/flatbuffers/issues/5627 Change-Id: I6e86e1138a5777e31055cfa2f79276d44732efbc
-
stefan301 authored
* Added missing EndTable() call to VerifyObject() VerifyObject called VerifyTableStart() but not EndTable(). This made Verifier::VerifyComplexity() increase depth_ with each table, not with the depth of tables. https://groups.google.com/forum/#!topic/flatbuffers/OpxtW5UFAdg * Added Check to VerifyAlignment https://stackoverflow.com/questions/59376308/flatbuffers-verifier-returns-false-without-any-assertion-flatbuffers-debug-veri
-
Michael Beardsworth authored
* Keep include prefix when converting from proto. This change preserves the include prefix when generating flatbuffers from proto (with FBS_GEN_INCLUDES) defined. * Improve handling of imports in proto conversion. Previously, there was no runtime flag to make proto->fbs conversion keep the import structure of a collection of files. This change makes proto conversion respect the --no-gen-includes flag and skip the output of "generated" symbols.
-
- 18 Dec, 2019 1 commit
-
-
Light Lin authored
* Fix prepare space for writeListInt64 and writeListUint64 * Fix align issues
-
- 17 Dec, 2019 2 commits
-
-
Matt Brubeck authored
* Make Rust constants public Otherwise they cannot be accessed by code that consumes the generated bindings. * Re-generate test code * Add a test for enum constants
-
cryptocode authored
-
- 15 Dec, 2019 1 commit
-
-
Max Burke authored
* Bugfix for Rust generation of union fields named with language keywords Looking at ParseField, it appears that in the case of unions, an extra field with a `UnionTypeFieldSuffix` is added to the type definition, however, if the name of this field is a keyword in the target language, it isn't escaped. For example, if generating code for rust for a union field named `type`, flatc will generate a (non-keyword escaped) field named `type_type` for this hidden union field, and one (keyword escaped) called `type_` for the actual union contents. When the union accessors are generated, they refer to this `type_type` field, but they will escape it mistakenly, generating code like this: ``` #[inline] #[allow(non_snake_case)] pub fn type__as_int(&self) -> Option<Int<'a>> { if self.type__type() == Type::Int { self.type_().map(|u| Int::init_from_table(u)) } else { None } } ``` Which will fail to build because the field is called `self.type_type()`, not `self.type__type()`. * [Rust] Add crate-relative use statements for FBS includes. At present if a flatbuffer description includes a reference to a type in another file, the generated Rust code needs to be hand-modified to add the appropriate `use` statements. This assumes that the dependencies are built into the same crate, which I think is a reasonable assumption? * Revert "[Rust] Add crate-relative use statements for FBS includes." This reverts commit d554d79fecf5afd6da6fb993b30b4cd523a5889a. * Address comments raised in PR * Update documentation comments per feedback * Fix typo
-
- 13 Dec, 2019 1 commit
-
-
FujiZ authored
-
- 09 Dec, 2019 2 commits
-
-
Gautham B A authored
The line where the MessageBuilder was constructed was commented out (perhaps an oversight).
-
Björn Harrtell authored
-
- 06 Dec, 2019 1 commit
-
-
cryptocode authored
The rationale for this option is that JSON clients typically want empty arrays (i.e [] in the JSON) instead of missing properties, but not empty strings when the value isn't set. --force-empty is kept as-is, i.e. it will force both empty strings and vectors. Closes #5652
-