* initial hack to get new Lua generator into flatc
* Starting to output enum defs for Lua
* Continue to work on table generation for Lua
* Finished basic getter access for Lua
* Added ability to get object by index
* Finished struct builder
* aliased reflection to r
* finish table builder generation
* register requiring files
* better generated header info
* Tying up loose ends
* Updated reflection to handle struct padding
* Addd type sizes to reflection
* Fixed some vector indirect issues
* Lua tests passed
* Misc cleanup
* ci fixes 1
* ci fixes 2
* renaming
* up size of type sizes
* manually ran clang-format-11 -i src/idl_parser.cpp
* fixed some windows casting
* remove stupid auto import
* more static_casting
* remove std
* update other build environments
* remove scoped enums
* replaced std::to_string with NumToString
* more win fixes
* more win fixes
* replaced old lua with new
* removed auto import
* review responses
* more style fixes
* refactor bfbs_gen_len to use code +=
* added consts
* fix lambda capture for windows
* remove unused return type
When generating code with --grpc, --cpp and using filename-suffix, the generated grpc files where not including the correct header that had the filename-suffix. As a suffix, they used the default "_generated".
Free functions for these were used to get the suffix. FlatBufFile had such methods, but also needed to be into its base File and use these.
- grpc generated files include the correct message header.
- grpc generated files also have the suffix
- grpc generated cc file does not include initial message header
* removed test/generate_code.{sh|bat}
remove c++0x from generate_code.py
added check generate code script in python
add windows specific call
added flags to generate_code.py
Set c++-0x on BUILD_LEGACY
Skip generating monster_extra if requested
* added option to skip monster extra
* add conditional to skip 2010 check gen
Restore flatbuffers::FlatBufferBuilder::kFileIdentifierLength, which was a documented part of the public API, but the identifier was lost during the refactoring effected by comment commit 6c8c291559.
* Added Google benchmarks (and gtests)
* Separate benchmark CMakeLists.txt to its own file
* Move output directory to target just flatbenchmark
* Reduced from encoding 210ns -> 188ns
* store size_ as uoffset_t
* fixed windows c4267 warning
Detected instability when built `flatbuffers-2.0.0` on `gcc-12`:
[ 75%] Building CXX object CMakeFiles/flattests.dir/tests/test_builder.cpp.o
.../c++/12.0.0/bits/shared_ptr_base.h:397:45: error: 'size' may be used uninitialized [-Werror=maybe-uninitialized]
397 | explicit _Sp_ebo_helper(_Tp&& __tp) : _M_tp(std::move(__tp)) { }
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from flatbuffers/tests/test_builder.cpp:1:
flatbuffers/tests/test_builder.h: In function 'void builder_move_assign_after_releaseraw_test(Builder) [with Builder = flatbuffers::FlatBufferBuilder]':
flatbuffers/tests/test_builder.h:63:10: note: 'size' was declared here
63 | size_t size, offset;
| ^~~~
...
In file included from flatbuffers/tests/test_builder.cpp:1:
flatbuffers/tests/test_builder.h: In function 'void builder_move_assign_after_releaseraw_test(Builder) [with Builder = GrpcLikeMessageBuilder]':
flatbuffers/tests/test_builder.h:63:10: note: 'size' was declared here
63 | size_t size, offset;
| ^~~~
cc1plus: all warnings being treated as errors
Here is the relevant bit of test:
template<class Builder>
void builder_move_assign_after_releaseraw_test(Builder b1) {
auto root_offset1 = populate1(b1);
b1.Finish(root_offset1);
size_t size, offset;
std::shared_ptr<uint8_t> raw(
b1.ReleaseRaw(size, offset), [size](uint8_t *ptr) {
flatbuffers::DefaultAllocator::dealloc(ptr, size);
});
Note how `b1.ReleaseRaw(size, offset)` is expected to populate `size`
and `[size](uint8_t *ptr) {` captures the result. But both are parameters
to the same function call and thus evaluation order is unspecified.
* chore: make flatc artifacts from CI executable
* chore: prepare dart 2.0.0 release
* refactor: update description in pubspec.yaml to make pub.dev happy
"The package description is too long.
Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters."
* Added Google benchmarks (and gtests)
* Default building benchmarks to OFF as it requires c++11
* Separate benchmark CMakeLists.txt to its own file
* Move output directory to target just flatbenchmark
* split flatbuffers.h into separate files
* wrong variable in cmakelists for android
* readded two accidentally deleted includes
* created buffer.h and moved buffer related things over
* Keep methods with struct name and switch them to default
This PR can help fix the following two issues:
1): A set of simplified API (without struct name) was added in
https://github.com/google/flatbuffers/pull/6336. It causes name
conflict when merging all generated python file into a single one
(the primary usage senario in Google).
2): Flatbuffers 2.0 generates absolute import path, which may cause
name space conflicts. See more details in
https://github.com/google/flatbuffers/issues/5840.
The solution for both is to generate the merged Python code, similar
C++. The merged code will not contain the simplied API, but only the
method with struct name. For issue (1), it will mimic the exactly
usage pattern for Google internal. For issue (2), users can generate
the merged flatbuffer code, without worrying about the imports.
The above idea will be implemented in the following steps:
Step 1 (this PR): revert changes in https://github.com/google/flatbuffers/pull/6336
that set the simplified API as default. Remove statements that the
original API will be deprecated, and reset the original API as default.
Step 2 (the following PR): create a flag to generate the merged code.
The Simplified API will be removed from the merged code, otherwise it
will cause name conflict.
* Update the generated sample code
* Update the generated example code
* Reverst the changes of GetRootAs
* Update examples from grpc/example/generate.sh
It seems like `--conform` already works for vectors of unions - there is
just a spurious check that prevents it from running. Fixes#6882
Also, if schemas do not conform, `flatc` no longer prints out the usage
(since the error is not due to bad usage). Fixes#6496
* CPP Default Value Generation in Mutators
If the mutator is for a value that is compatible with having a default value, then the single parameter becomes a default parameter. With this, a value can be mutated to it's default value without storing the default value, as that will be stored with the mutate function.
Fixed Casting When Generating Default for Enum Value
Added support for typecasting an int default value into the correct enum type in the default parameter. This fixed the issue of trying to use set a strongly typed enum parameter to an int which fails type checking.
Fixed Boolean Edge Case
Boolean types generate 0 != 0 when generating the underlying type which appears to be unique to the boolean type so it is now checked and the proper default value generated. It may be beneficial to check if it is instead an enum type, however the seeming edge case nature is why boolean was chosen to be checked.
Updated Generated Files
Regenerated the auto generated files to reflect the new changes.
Updated Remaining Files
Should fix auto generated header files that were not updated.
* Unified Repeated Code
Relocated identical append code to outside of conditional. Also changed 'casted' default value name from FIELD to INTERFACE to more accurately describe it.
* Moved Field Name Outside Conditional
Removed duplicate _{{FIELD_NAME}} and moved to unified append.
Finished documenting flatbuffersbuilder
Replaces swift 5.5 with 5.2 packages
Starts building the tutorial for xcode 13
Finishes building the tutorial for xcode 13
Removes docc files from old swift versions
Updates swift style guide
* added --bfbs-builtins
* update generate_code.bat
* forgot the .
* updated checking scripts
* added bypass for the monster_test.bfbs and arrays_test.bfbs diff issue
* removed check on windows for now
Updates the `files` globs in package.json to include subdirectories in order to also include the flexbuffers directory in the published npm package.
Updates .gitignore to include the tsc-generated JS files.
* Update idl_gen_csharp.cpp
Change csharp generator to use "global::" for it's qualifying_start_ to disambiguate namespaces
* regenerate testing files
regenerate testing files
* Missed TableInC.cs
updated with global prefix
* Remove "global::" from qualifying_start_ for csharp generator
* C# global alias
* Tests and docs for --cs-global-alias
Add tests for --cs-global-alias to demonstrate use case for why it's needed.
Add documentation to Compiler.md
* Add also to help text
Add also to help text