summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-02-15Only use absl headers if C++14 is available. (#7824)Even Rouault1-1/+1
If flatbuffers is built in C++11 mode, but there is a recent version of absl which requires C++14, the build will fail. Cf https://github.com/MapServer/MapServer/issues/6822 for the use case that triggered this.
2023-02-06fixed bad math for --annotate-sparse-vectorsDerek Bailey1-4/+4
2023-02-06Sample adjusted for Python3 (#7819)chrismue1-6/+6
Co-authored-by: chrismue <chrismue.gitlab@gmail.com> Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-02-06[Annotated Buffers] Improve efficiency (#7820)Derek Bailey4-85/+107
* AnnotatedBinaryTextGen switch to ofstream instead of building giant string * Add --annotate-sparse-vectors to reduce AFB size
2023-02-06Simplify and fix TypeScript compilation output (#7815)Björn Harrtell5-18/+8
* Simplify and fix TypeScript compilation output * Revert deps upgrade
2023-02-05use switch statements for BASE_TYPE_ lookups (#7813)Derek Bailey5-49/+56
2023-02-03explicitly declare enum values (#7811)Derek Bailey2-22/+25
2023-02-02proto_test.cpp don't warn about gapsDerek Bailey1-0/+10
2023-02-02Fixed vtable duplication for binary annotator (#7809)Derek Bailey28-6753/+6772
2023-02-01Parsing from proto should keep field ID. (fixes #7645) (#7655)Saman25-162/+1139
* Parsing from proto should keep field ID. (fixes #7645) * Fix failed tests * Fix windows warning * Improve attribute generation in proto to fbs * Check if id is used twice. fix Some clang-format problems * Test if fake id can solve the test problem * Validate proto file in proto -> fbs generation. * Fix error messages * Ignore id in union * Add keep proto id for legacy and check gap flag have been added. Reserved id will be checked. * Add needed flags * unit tests * fix fromat problem. fix comments and error messages. * clear * More unit tests * Fix windows build * Fix include problems * Fake commit to invoke rebuild * Fix buzel build * Fix some issues * Fix comments, fix return value and sort for android NDK * Fix return type * Break down big function * Place todo --------- Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-31Final refactor for bfsb_generator* and text generator (#7806)Khanh Nguyen30-223/+358
* Refactor BfbsGenerator to use CodeGenerator interface * Update * Refactor bfbs generator * Refactor bfbs generator for lua and nim. Remove old code that use Generator interface. * Update import * Update CMakeLists * Update BUILD file * Update BUILD file for src * Remove from Android CMakeLists and add error message * Update * Add generate root file function to Code Generator interface * Update * Update * Minor format fix
2023-01-30Fix std::span autodetection (#7805)Bernie Innocenti1-8/+11
The current detection method fails on GCC 12.2 with -std=c++20 because the __cpp_lib_span macro is undefined. As per https://en.cppreference.com/w/cpp/utility/feature_test , __cpp_lib_span requires including either <version> or <span>. Since both these headers were added in C++20, checking for C++20 is sufficient (and simpler than using the library feature-test macro). Signed-off-by: Bernie Innocenti <bernie@codewiz.org> Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-30Rename LICENSE.txt to LICENSE (#7808)CodeMaster70003-2/+2
* Update PackageDebian.cmake * Rename LICENSE.txt to LICENSE * Update readme.md --------- Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-29Supported cmake 3.8 (#7801)Ilya Lavrenov5-833/+23
2023-01-28Refactor usage message (#7803)Khanh Nguyen3-141/+95
* Update usage string formation * Rework help message to use code generator interface * update * refactor
2023-01-26Code generator refactor bug fix (#7802)Khanh Nguyen1-1/+1
* Swift should use swift generator * Swift should use swift generator Co-authored-by: Mo (Khanh) Nguyen <khhn@google.com>
2023-01-25Clean up extra white spaces (#7800)Wen Sun2-7/+7
* Clean up extra white spaces * update Co-authored-by: Wen Sun <sunwen@google.com> Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-25Refactor languages to use CodeGenerator interface. (#7797)Khanh Nguyen35-7/+1269
* Refactor to use CodeGenerator interface. - Move code to its own header file to be included in flatc_main.cpp - Refactor code to use CodeGenerator interface for all languages * Format all files * remove lua code generator since it doesn't support bfbs generator * Update CMakeLists file with new idl_gen_*.cpp and idl_gen_*.h files * Add idl_gen_swift header file * Add idl_gen_swift header file and update bazel file * Remove CodeGenerator interface for idl_gen_text.*. Remove comments and extern declaration * Reorder header and implementation files in CMakeLists.txt * Add idl_gen_* header files to implementation files * Update CMakeLists and remove unused import Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-24[C++] Enable using struct and array of struct as key (#7741)Wen Sun7-37/+853
* add unit tests for support struct as key * make changes to parser and add helper function to generate comparator for struct * implement * add more unit tests * format * just a test * test done * rerun generator * restore build file * address comment * format * rebase * rebase * add more unit tests * rerun generator * address some comments * address comment * update * format * address comment Co-authored-by: Wen Sun <sunwen@google.com> Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-21FlatBuffers Version 23.1.21 (#7796)Derek Bailey163-217/+222
2023-01-21[TS/JS] Entry point per namespace and reworked 1.x compatible single file ↵Björn Harrtell249-15901/+11504
build (#7510) * [TS/JS] Entry point per namespace * Fix handling of outputpath and array_test * Attempt to fix generate_code * Fix cwd for ts in generate_code * Attempt to fixup bazel and some docs * Add --ts-flat-files to bazel build to get bundle * Move to DEFAULT_FLATC_TS_ARGS * Attempt to add esbuild * Attempt to use npm instead * Remove futile attempt to add esbuild * Attempt to as bazel esbuild * Shuffle * Upgrade bazel deps * Revert failed attempts to get bazel working * Ignore flatc tests for now * Add esbuild dependency * `package.json` Include esbuild * `WORKSPACE` Add fetching esbuild binary * Update WORKSPACE * Unfreeze Lockfile * Update WORKSPACE * Update BUILD.bazel * Rework to suggest instead of running external bundler * Add esbuild generation to test script * Prelim bundle test * Run test JavaScriptTest from flatbuffers 1.x * Deps upgrade * Clang format fix * Revert bazel changes * Fix newline * Generate with type declarations * Handle "empty" root namespace * Adjust tests for typescript_keywords.ts * Separate test procedure for old node resolution module output * Fix rel path for root level re-exports * Bazel support for esbuild-based flatc Unfortunately, we lose typing information because the new esbuild method of generating single files does not generate type information. The method used here is a bit hack-ish because it relies on parsing the console output of flatc to figure out what to do. * Try to fix bazel build for when node isn't present on host * Auto formatting fixes * Fix missing generated code Co-authored-by: Derek Bailey <derekbailey@google.com> Co-authored-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
2023-01-21Flatbuffers Version 23.1.20 (#7794)Michael Le164-220/+224
* Flatbuffers Version 23.1.20 * Fix warnings * Fix warnings
2023-01-19Use CMAKE_CURRENT_SOURCE_DIR in benchmark cpp path (#7781)liu1-1/+1
Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-18Remove go.mod to resolve ambiguous import issue (#7783)Michael Le1-3/+0
2023-01-10Fix binary output different in different platform (#7718)Saman7-69/+52
* Fix binary output different in different platform, due to the nan serialization * Add check generated code on windows ci * Remove resdundant script * Fix eof, and check script * Minor bug in gen code script * Fix windows script, remove redundant scripts * Undelete redundante codes * Fix github action * Ignore eof generate grpc Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-10Fix some identity/equality confusion in Python tests (#7768)Ben Beasley1-4/+4
Comparing short strings, small integers, and Booleans by identity (memory address) can work due to optimizations in the Python interpreter, but it is neither formally correct nor reliable. Use equality comparisons instead. Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-10Stop using deprecated imp package in Python tests (#7769)Ben Beasley1-11/+2
It is deprecated in favour of importlib and slated for removal in Python 3.12. Since the return value of imp.find_module('numpy') is unused, the only effect of calling this function is to raise an ImportError when numpy is not available; importing numpy directly is already sufficient to do this. The imp package is still used in python/flatbuffers/compat.py, but only on Python 2, where it is not deprecated and will not be removed. Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-10[TS]: builder, Fix requiredField(). Verity that the field is present in the ↵José Luis Millán8-2/+163
vtable (#7739) (#7752) * [TS]: Fix vtable creation for consecutive required fileds (#7739) * handle feedback * comment the schema * comment change in builder.ts * [TS]: builder, Fix requiredField() Verifty that the field is present in the vtable. * restore monsterdata binary file Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-10Fix Python host-endianness dependencies (#7773)Ben Beasley3-23/+23
* In Python tests, use host-endian-independent dtypes * Fix host endianness dependence in Python flexbuffers Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-10[Kotlin] Control the generation of reflection with --reflect-names (#7775)Anton Bobukh35-6/+74
* [Kotlin] Control the generation of reflection with --reflect-names. Tested: ``` $ cmake -G "Unix Makefiles" && make && ./tests/flatc/main.py ... KotlinTests.EnumValAttributes [PASSED] KotlinTests.EnumValAttributes_ReflectNames [PASSED] KotlinTests: 2 of 2 passsed ... 35 of 35 tests passed ``` * [Kotlin] Fix SampleBinary by converting Byte to UByte for ubyte fields. * [Kotlin] Annotate all generated classes with kotlin.ExperimentalUnsignedTypes.
2023-01-10Use full project version as SOVERSION for the shared library (#7777)Michał Górny2-14/+10
Since flatbuffers is using calendar versioning and does not provide any ABI stability guarantees, use the complete version as SOVERSION for the shared library rather than just the major component. This prevents breaking reverse dependencies on incompatible upgrades. Fixes #7759
2023-01-09Fix a typo in a Python test name (#7774)Ben Beasley1-1/+1
2023-01-08Defined CodeGenerator Interface and implement C++ (#7771)Derek Bailey7-14/+243
2023-01-08Refactor FlatC to receive `FlatCOptions` (#7770)Derek Bailey4-147/+224
* Refactor FlatC to receive `FlatCOptions` * switch to c++11 unique_ptr
2023-01-07Minor improvement (#7766)Saman4-7/+7
2023-01-07Add ts-no-import-ext flag (#7748)Chris13-5/+812
Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-07Fix [C#] Object API - Invalid Property Name used in UnPackTo for unio… (#7751)Stefan F5-4/+362
* Fix [C#] Object API - Invalid Property Name used in UnPackTo for union fieldhttps://github.com/google/flatbuffers/issues/7750, also fixes invalid Code generated in WriteJson for Unions named Value. * Test added: new schema union_value_collision.fbs with a Union named Value and a union field named value. The generated C# code now compiles when NetTest.bat. The Code generated with an older flatc.exe didn't compile because of a mismatch of the property name (Value vs. Value_). * branch was not up-to-date with master * BASE_OPTS + CPP_OPTS removed and union_value_collision_generated.h deleted Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-07Increase float to string precision to 17Derek Bailey1-1/+1
2023-01-07emit global scoped ::flatbuffers in c++ (#7764)Derek Bailey22-5235/+5236
2023-01-07Annotated Binaries emit field names instead of type names (#7763)Derek Bailey20-255/+262
2023-01-07[C++] Add Command-Line Flag to Suppress MIN and MAX Enums (#7705)jalitriver4-2/+14
Add the --no-minmax-values flag to prevent flatc from generating C++ enums with MIN and MAX enumerated values that otherwise would be set to the inclusive lower and upper bound respectively of the enum. This command-line flag is needed to avoid collisions when an enum that is being ported to FlatBuffers already has a MIN or MAX enumerated value. It is also needed to work around a long-standing problem with magic_enum that causes magic_enum to not see enumerated values that are not unique. For example, if FlatBuffers sets MIN = FOO and MAX = BAR, MIN and FOO share the same underlying value so they are not unique. The same is true of MAX and BAR. This prevents magic_enum from converting FOO and BAR to and from strings as well as causing magic_enum to return a count of enumerated values that is two fewer than it should be. Co-authored-by: Paul Serice <paul@serice.net>
2023-01-06Ensure that empty modules can build in TypeScript isolatedModules mode (#7726)Max Burke1-0/+7
2023-01-06Removes Dead code & regenerate code (#7744)mustiikhalil61-243/+277
Formats the swift project Update Sample files Update docc documentation Updates swift docs in the website Updates code for Wasm
2023-01-06[Kotlin] Improve field nullability based on (required) (#7658)Florian Wagner3-10/+49
* [Kotlin] Only generate nullable return types if the field is not required * [Kotlin] Fix generated code formatting according to kotlin style guide Co-authored-by: Derek Bailey <derekbailey@google.com> Co-authored-by: Paulo Pinheiro <paulovictor.pinheiro@gmail.com>
2023-01-05Fix operator==() generated for field of fixed sized array (#7749)Saman5-9/+69
* Fix operator==() generated for field of fixed sized array * Compare address * noexcept * Grammer Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-05Expand wildcard imports in the generated Kotlin files. (#7757)Anton Bobukh29-59/+408
Tested: ``` $ cmake -G "Unix Makefiles" && make && ./flattests ... [ 99%] Linking CXX executable flatsamplebinary [100%] Built target flatsamplebinary ALL TESTS PASSED ``` Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-05Update Readme.md for versioningDerek Bailey1-0/+4
Updated the front readme doc about the non-semver versioning so that the rationale is more apparent to users.
2023-01-05Add pointer reference to sibling union field on FieldDef (#7755)Paulo Pinheiro2-1/+16
To make it simple to map between a union field and its union type field we are adding a pointer to FieldDef to point to each other. For all other types the pointer will be nullptr. Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-04FlatBuffers Version 23.1.4 (#7758)Derek Bailey163-269/+287
2023-01-04Fix go.mod name (#7756)Michael Le1-1/+1