Age | Commit message (Collapse) | Author | Files | Lines |
|
Respects the 'shared' field attribute when reading data with Parser.
|
|
|
|
* Adds Object-api support to swift
* Fixed indentation issues
* Removed indentation within namespaces
|
|
* [CMake] : Add precompiled header support with FLATBUFFERS_ENABLE_PCH
FLATBUFFERS_ENABLE_PCH enable precompile headers support for 'flatbuffers' and 'flatc'. Default if OFF.
You need to set it to ON to make it work. 'cmake -DFLATBUFFERS_ENABLE_PCH=ON ..'
This will only work if CMake version is >= 3.16, because target_precompile_headers is used.
If CMake doesn't have target_precompile_headers, then nothing will happen.
This can speed up compilation time.
Precompiled header file for 'flatbuffers' is 'pch.h'
Precompiled header file for 'flatc' is 'flatc_pch.h'
* Enable FLATBUFFERS_ENABLE_PCH for VC 2017 and VS2019 builds
* [CMake]: Fix error in FLATBUFFERS_ENABLE_PCH description
* Add a function add_pch_to_target to avoid copy and pasting the same code like add_fsanitize_to_target
Move pch.h and flatc_pch.h from include/flatbuffers to include/flatbuffers/pch
Make flatc_pch.h depends on pch.h since it extend it
|
|
Number of elements on the stack shouldn't affect the calculation
of ElemWidth(). Variable 'start' needs to be subtracted from the
loop variable 'i' to make indexing zero-based.
There is an additional unit test to pack nested vectors. Size of
the packed buffer *without* this fix is 798 and only 664 bytes
*with* the fix.
|
|
For example:
include/flatbuffers/reflection.h:365:8: error: definition of implicit copy
constructor for 'pointer_inside_vector<flatbuffers::Table, unsigned char>'
is deprecated because it has a user-declared copy assignment operator
[-Werror,-Wdeprecated-copy]
void operator=(const pointer_inside_vector &piv);
^
It's unclear why the old code wanted to declare a public `operator=`
without defining it; that just seems like a misunderstanding of the C++03 idiom
for deleting a member function. And anyway, we don't *want* to delete the
assignment operator; these are polymorphic types that do not follow value
semantics and nobody should ever be trying to copy them. So the simplest fix
is just to go back to the Rule of Zero: remove the declaration of `operator=`
and let the compiler do what it wanted to do originally anyway.
"The best code is no code."
Also, update the generated .h files.
Fixes #5649.
|
|
* 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
* [C++] Add max_depth and max_tables parameters to reflection::Verify
Co-authored-by: Felkel <stefan@eas.local>
Co-authored-by: stefan301 <Stefan.Felkel@de.Zuken.com>
|
|
* Parser reject "nan(n)" string as it does with nan(n)
* Adjust scalar fuzzer to ignore '$schema' substrings
- Scalar fuzzer ignores '$schema' substrings at the input
- Added 'scalar_debug' target to simplify research of fuzzed cases
* Improve formatting of './tests/fuzzer/CMakeLists.txt'
|
|
Change-Id: I84a9365e9d8a1afe333b1df85058401ffe0a6b7c
|
|
Change-Id: I8e74d6fddf91fe955fffc572af9d671160325731
|
|
* Fixed refractoring issue in reflection/generate_code.sh. Also, mv deletes the original file, so I don't need to clean it up manually in that case.
* Added --filename-suffix and --filename-ext to flatc
* Fixed typo and added example generation of suffix and extension for C++
* Removed extra ;
* Removed clang-format block from a region that didn't need it. Fixed an auto format of another clang-format block
* Added docs, fixed pointer alignment, removed suffix test file
|
|
* Adds the basic structure for required to add grpc support
Added the message implementation
Updated the code to confirm to the protocol flatbuffersobject
Adds an example for Swift flatbuffers GRPC
Started implementing the swift GRPC code Gen
Generator generates protocols now
Fixing ci issues
Migrated the logic to use grpc_generator::File instead of string
Refactored swift project
Implemented GRPC in swift
Finished implementing GRPC in swift
Fixes issues
Adds contiguousBytes initializer to swift
Adds documentation + fixes buffer nameing in tables + structs
Adds documentation + fixes buffer nameing in tables + structs
Updated tests
* Updated version
|
|
* 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.
|
|
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
|
|
(#5701)
* 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
|
|
* 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
|
|
* 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
|
|
StringToNumber will correctly use locale-insensitive functions
when available.
Change-Id: I6bde11039a541634186f8f791012af2eb0d86b8d
|
|
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.
|
|
* 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
|
|
For C++11 platforms, absl::string_view is sometimes available. This can
be used for string_view when std::string_view is not available.
|
|
* 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)
|
|
For details, test.cpp/FlexBuffersDeprecatedTest(), and also
https://github.com/google/flatbuffers/issues/5627
Change-Id: I6e86e1138a5777e31055cfa2f79276d44732efbc
|
|
* 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
|
|
|
|
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
|
|
'TableKeyComparatoris deprecated #5649 (#5650)
|
|
class` type. (#5630)
|
|
|
|
|
|
|
|
#4705 (#5613)
* Support for python grpc
* add few fixes
* Fixes build
* Fix python generator
* Add tests
* Fix grpc python test
* Fix tests and add incomplete python generator
* Fix python generator
* Add python generator methods
* Fix Appveyor build
* grpc python support v0.1
* Update tests
* update grpctest
* Remove duplicated code and fix a brace
* tests for flatbuffers grpc python
* Updated tests + removed SerializeToString, From String
* remove pickle import
* include missing files in ci - BUILD and generated test result
|
|
|
|
* Cloned idl_gen_general.cpp to idl_gen_csharp.cpp and removed java references
* Java generator changes
|
|
|
|
* Automatic refractor of C++ headers to Google C++ style guide
* Automatic refractor of C++ source to Google C++ style guide
* Automatic refractor of C++ tests to Google C++ style guide
* Fixed clang-format issues by running clang-format twice to correct itself. Kotlin was missing clang-format on after turning it off, so it was changed,
|
|
Older clang versions raise:
```
./flatbuffers/base.h:365:1: error: unknown attribute 'no_sanitize' ignored [-Werror,-Wattributes]
__supress_ubsan__("alignment")
^
./flatbuffers/base.h:246:50: note: expanded from macro '__supress_ubsan__'
#define __supress_ubsan__(type) __attribute__((no_sanitize(type)))
^
```
Comparing https://releases.llvm.org/3.6.0/tools/clang/docs/AttributeReference.html
with https://releases.llvm.org/3.7.0/tools/clang/docs/AttributeReference.html
shows that __attribute__((no_sanitize(type))) is available since 3.7.0
|
|
types (#5599)
* Skip generation of mutable union types
* Removed C# and Java unit tests that mutated a Union type
|
|
Fixes following clang -Wdocumentation warning:
```
flatbuffers.h:1762:17: error: parameter ']' not found in the function declaration [-Werror,-Wdocumentation]
/// @param[in]] v A const reference to the `std::vector` of structs to
```
|
|
Found by the https://github.com/OSGeo/gdal/blob/master/gdal/scripts/fix_typos.sh
script on the internal copy of flatbuffers inside GDAL
|
|
* Avoid intentional unsigned integer overflow getting caught by sanitizers
* Adapt from suggested compiler compatible solution
* And a third way :)
|
|
(#5546)
* Fix C/C++ Create<Type>Direct with sorted vectors
If a struct has a key the vector has to be sorted. To sort the vector
you can't use "const".
* Changes due to code review
* Improve code readability
|
|
|
|
Alongside --binary and --json, an additional
switch (--flexbuffers) can be passed to convert
data using FlexBuffers
|
|
* Draft with Array specialization (#5508)
* Array specialization + SFINAE to fold copy-paste (#5508)
* Add implicit specialization of Array<scalar> and Array<struct> (#5508)
- Tag dispatching is used for implicit specialization
- Array<scalar> and Array<struct> have different iterators and accessors
- Array<scalar> and Array<struct> have different Mutate() methods
* Add implicit specialization of Array<scalar> and Array<struct> (#5508)
- Tag dispatching is used for implicit specialization
- Array<scalar> and Array<struct> have different iterators and accessors
- Array<scalar> and Array<struct> have different Mutate() methods
|
|
|
|
Change-Id: Ie94386ff8e10fd2a964bd9155139b50953746a37
|
|
Together with @Nullable, this allows users to use static analysis tools
like CheckerFramework to catch NPEs caused by unset fields.
|
|
|
|
(see comments in the code).
Change-Id: I5603abb0db436145739653692644bbcfd3c946e3
|