- Feb 13, 2020
-
-
Omer Akram authored
* fix snap versioning * no need to install git as build packages
-
- Feb 12, 2020
-
-
Joseph Pyott authored
-
xtrm0 authored
Previously UnPack would allocate data with new and assign it to a raw pointer. This behavior makes it possible for the pointer to be leaked in case of OOM. This commit defaults to use the user specified pointer (which needs to implement a move constructor, a .get() and a .release() operators), thus preventing these leaks.
-
- Feb 11, 2020
-
-
Joseph Pyott authored
-
David P. Sicilia authored
* [C++] Use strong enum type for vectors when scoped-enums is on. These changes only apply when scoped-enums is on, and thus only the C++17 tests show diffs. This may break users who use 1) use scoped-enums and 2) use vectors of enums. However, it seems that this change should have been made originally when scoped-enums were added. Fixes #5285 * [C++] Put strong enum change also behind C++17 flag. It actually only needs C++11 technically, but this is being done to avoid breaking any existing users. Tests were rerun, but produced no additional diffs, as expected. * [C++] Forgot one location in which C++17 guard needs to go. This commit produces no additional diffs in generated code. * Use g_only_fixed_enums instead of scoped_enums.
-
mugisoba authored
* support json serialization * fix invalid json format. * string must be written with double quotes. * remove commma after the last object member. * fix indent * Revert "fix invalid json format." This reverts commit d6820ed50c8e3d3cda3aa1849b3079f853608619. * quated string value. * add cs-gen-json-serializer flag. * fix preprocessor indent * ENABLE_JSON_SERIALIZATION -> ENABLE_JSON_SERIALIZATION_TEST * share TestBuffer method * remove ENABLE_JSON_SERIALIZATION * remove duplicated test data * [windows] add nuget restore and copy test data. * [docker mono] share msbuild settings with windows. add nuget restore and copy test data. * add some note for json api.
-
- Feb 06, 2020
-
-
Wouter van Oortmerssen authored
This means data written with older versions of this code has potentially misaligned data, which we'll need to support. This isn't a problem on most architectures, but could be on older ARM chips. To support them properly may require swapping out uses of `flatbuffers::ReadScalar` with a version that does a memcpy internally. Change-Id: Ib352aab4a586f3a8c6602fb25488dcfff61e06e0
-
- Jan 30, 2020
-
-
Robert Winslow authored
-
mugisoba authored
* [C#] support Object API * fix sign-compare * fix indent * add new line before for loop. * using auto whenever possible * reduce the amout of blank lines. * wip: support vectors of union * done: support unions of vectors * set C# version to 4.0 * remove null propagation operator * remove auto property initializer * remove expression-bodied method * remove pattern matching * add Example2 to NetTest.sh * separate JavaUsage.md and CsharpUsage.md from JavaCsharpUsage.md * add C# Object based API notes. * support vs2010. * remove range based for loop. * remove System.Linq * fix indent * CreateSharedString to CreateString * check shared attribute * snake case
-
- Jan 27, 2020
-
-
mustiikhalil authored
-
Dan Field authored
* vs2019 * another attempt * syntax * fewer * fix dart
-
- Jan 24, 2020
-
-
mustiikhalil authored
-
sjoblom65 authored
* Added the code to embed the binary schema to the source. This is pulled forward from a old PR #5162 that will be closed. * Update idl_gen_cpp.cpp Added a small comment to trigger a new build. The build was failing in a strange location and doesn't look like it has anything to do with the code. * Moved the EscapeAndWrapBuffer to util.cpp and did some formating. * One more camelCases removed and renamed some variables. * wrapped_line_xxx should have been passed as a const reference in the first place. * Moved the bfbs embed sample to it's own file. * Missed moving the namespace back. * Moved the embedded bfbs to test.cpp instead of using a sample. * Missed adding the generation of embedded bfbs to the build. * See if this makes the build happier. * Fixed a in-compatable cpp output of the generated header. * Did some changes to reflect the code review comments. 1. Update the EscapeAndWrapBuffer to BufferToHexText and fixed a variable name. 2. Moved the include of the embedded binary schema to all the other includes. * Moved some code to inline the instead of using a local variable. * Moved the BufferToHexText back to be a inline function in util.h
-
Paulo Pinheiro authored
* [Java][FlexBuffers] Deprecate typed vector strings due to design flaw It will still be possible to read buffers with this type, but the elements will be treated as FBT_KEY and will be read as null-terminated string. Trying to build a vector of strings as typed will throw an exception. More information on https://github.com/google/flatbuffers/issues/5627 Also, fix another bug on strings, where long strings were not properly aligned. * [Java][FlexBuffers] Make FBT_VECTOR_STRING_DEPRECATED considered typed. The logic for FlexBuffers.isVectorType() was changed to not consider FBT_VECTOR_STRING_DEPRECATED a typed vector, but that can lead to missinterpretation for existing serialized data. So we are reverting.
-
mustiikhalil authored
* Adds the sharedstring implementation for go * Reimplemented testcase according to request
-
vkill authored
* [Swift] Fix padding function overflow when bufSize is 0 [Swift] Generate linuxmain * [Swift] Using the overflow addition operator to resolve integer overflow
-
- Jan 23, 2020
- Jan 21, 2020
-
-
Max Burke authored
* [typescript/javascript] Size-prefixed root accessor needs to account for the size prefix. * [typescript] Add parentheses after "new" expression. * Update generated test files
-
- Jan 19, 2020
-
-
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.
-
- Jan 17, 2020
-
-
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 ```
-
- Jan 16, 2020
-
-
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
-
- Jan 13, 2020
-
-
mustiikhalil authored
Fixed the create functions and updated the test cases in swift Removes unneeded code Updated documentation
-
- Jan 09, 2020
-
-
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
-
-
- Jan 06, 2020
-
-
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.
-
- Jan 02, 2020
-
-
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
-
- Dec 31, 2019
-
-
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
-
- Dec 30, 2019
-
-
Michael Beardsworth authored
4d1a9f8d9eab9fc6762e03cd862576965a0c6920 inverted the logic around keeping the include prefix. This change fixes the error.
-
- Dec 27, 2019
-
-
lu-wang-g authored
Add the support to pack using numpy for scalar vectors when numpy is available.
-
- Dec 26, 2019
-
-
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
-