summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-04-01Limit formatter to pull requests only (#6540)mustiikhalil1-1/+2
2021-03-29Rust structz (#6539)Casper25-555/+1672
* Rust structz * struct of structs test * swift tmp variables Co-authored-by: Casper Neo <cneo@google.com>
2021-03-29[Kotlin][FlexBuffers] JSON support for Flexbuffers (#6417)Paulo Pinheiro8-40/+1402
* [Kotlin][FlexBuffers] Add JSON support for FlexBuffers * [Kotlin][Flexbuffers] Re-implement JSON parser with a tokenizer.
2021-03-25[grpc] Support latest version of grpc PoC (#6338)Jeong YunWon15-285/+83
* use grpcpp rather than deprecated grpc++ * grpcpp Deserialize take ByteBuffer instead of grpc_byte_buffer * grpc 1.36.0 * Fix to use grpc 1.36.0 * Fix CMakeLists to refer gRPC * add find_package(Threads) * Update bazel deps * Apply workaround about boringssl build error * Install latest cmake for osx on travis-ci Co-authored-by: Yeom Gyusun <omniavinco@gmail.com>
2021-03-25fixed packing structs (#6530)Kamil Rojewski4-8/+15
* fixed packing structs in nested buffers * fixed packing structs
2021-03-18[GO] Tries to add go format to the CI (#6518)mustiikhalil3-1/+55
* Trys to add go format to the CI Adds Gofmt to CI * Adds formatting for go dir in grpc * Small fix
2021-03-18[C++] #6501 - Problem when mapping a native type multiple times (#6514)Michael9-51/+244
* [C++] #6501 - Problem when mapping a native type multiple times - idl.h: added "native_type_pack_name" - flatbuffers.h: added CreateVectorOfNativeStructs variants which receive a pointer to the serialization function - idl_gen_cpp.cpp: adapted code generation in case "native_type_pack_name" attribute is present - extended tests & docs; improved surrounding native_type docs a little * integrated review feedback
2021-03-18[fuzzer] Add `monster_debug` target (#6513)Vladimir Glavnyy4-8/+60
Add the `monster_debug` target for better troubleshooting. Improve oss-fuzz logs.
2021-03-17[Swift] Removes allman rule (#6519)mustiikhalil1-1/+0
2021-03-15[flexbuffers, json] Parse `nan` and `inf` (#6512)Vladimir Glavnyy3-0/+52
2021-03-11fixed packing structs in nested buffers (#6509)Kamil Rojewski5-10/+21
2021-03-11[idl_parser] Add kTokenNumericConstant token (#6432)Vladimir Glavnyy2-38/+83
* [idl_parser] Add kTokenNumericConstant token This commit adds the new token for correct parsing of signed numeric constants. Before this expressions `-nan` or `-inf` were treated as kTokenStringConstant. This was ambiguous if a real string field parsed. For example, `{ "text_field" : -name }` was accepted by the parser as valid JSON object. Related oss-fuzz issue: 6200301176619008 * Add additional positive tests fo 'inf' and 'nan' as identifiers * Rebase to HEAD * Move processing of signed constants to ParseSingleValue method. * Add missed `--cpp-static-reflection` (#6324) to pass CI * Remove `flatbuffers.pc` from repository to unblock CI (#6455). Probably the generated flatbuffers.pc should not be a part of repo. * Fix FieldIdentifierTest()
2021-03-11Remove `flatbuffers.pc` from the repository (#6508)Vladimir Glavnyy2-9/+1
2021-03-09Bump grpc to 1.0.0 (#6507)mustiikhalil3-2/+3
Adds void to keywords
2021-03-08Move Traits struct and Create method out of --cpp-static-reflection. (#6503)dpacbach1-11/+13
2021-03-08Disable x64-specific optimizations for ARM64EC ReadInt64 (#6506)Ben Niu1-1/+1
ARM64EC is a new ARM64 ABI designed by Microsoft to support x64 application emulation on ARM64 CPUs. When compiling for ARM64EC, both the _M_X64 and _M_ARM64EC macros are defined. However, that causes problem in compiling this file, because the __movsb intrinsic, which is lowered to rep movsb, is not supported on ARM64, so the optimization for native x64 should be disabled for ARM64EC.
2021-03-06Add --cpp-static-reflection to generate_code.bat. (#6502)dpacbach1-1/+1
2021-03-05[C++17] Add compile-time reflection for fields. (#6324)David P. Sicilia9-11/+834
* [C++17] Add compile-time reflection for fields. Included in this commit is the following: - The C++ generator has been modified so that, when in C++17 mode, it will emit Table and Struct field traits that can be used at com- pile time as a form of static reflection. This includes field types, field names, and a tuple of field getter results. - Diffs to the cpp17 generated files. No other generated files are affected. - A unit test that also serves as an example. It demonstrates how to use the full power of this reflection to implement a full recursive JSON-like stringifier for Flatbuffers types, but without needing any runtime access to the *.fbs definition files; the computation is done using only static reflection. Tested on Linux with gcc 10.2.0. Fixes #6285. * Fix int-conversion warning on MSVC. * Try to fix std::to_string ambiguity on MSVC. * Fix clang-format diffs. * Fix more clang-format diffs. * Fix last clang-format diff. * Enable C++17 build/test for VC 19 platform in CI. * Forgot to add value to cmake command line variable. * Various fixes/changes in response to @vglavnyy's feedback. * Replace "fields pack" with index-based getters. * Fix MSVC error. * Fix clang-format diffs. * getter_for method returns result instead of address-of-getter. * Next round of reviewer suggestions. * Use type instead of hardcoded struct name. * Fix clang-format diff. * Add test for FieldType since it is not used in the stringify test. * Add fields_number field to Traits struct. * Add --cpp-static-reflection flag and put those features behind it. * Fix clang-format diffs. * Remove <tuple> include.
2021-03-04fixed invalid TS call and added test files (#6495)Kamil Rojewski36-4029/+4185
e581013e3d42af13d2fe37b0ac46a3fd43f3638c broke TS generation - please don't use "replace" to refactor function names :)
2021-03-01disable clippy (#6494)Casper1-3/+7
Co-authored-by: Casper Neo <cneo@google.com>
2021-03-01[idl_parser, JSON] Disable parsing of JSON for incomplete schemes (#6493)Vladimir Glavnyy1-1/+4
This commit disable JSON parsing for an incomplete scheme if JSON object is embedded into one file with the scheme. This should improve the quality of OSS-Fuzz inputs for the parser_fuzzer target.
2021-03-01[idl_parser] Track included files by hash (#6434)Mark Spatz4-36/+35
* [idl_gen] Delete ts::GenPrefixedImport() I don't know what this is for, but it's the only piece of code external to idl_parser.cpp that expects the key of Parser::included_files_ to be a path. And it appears to be unused. * [idl_parser] Track included files by hash Parser::included_files_ is a map whose main purpose is to keep track of which files have already been parsed in order to protect against multiple inclusion. Its key is the path that the file was found at during parsing (or, if it's an in-memory file, just its name). This commit changes the key to be the 64 bit FNV-1a hash of the file's name (just the name, not the complete path) xor'd with the hash of the file's contents (unless it's an in-memory file, then we only hash the name.) This allows multiple include protection to function even in the face of unique per-file include paths (fixes #6425). * Ran tests/generate_code.sh CI told me to do it. * Gracefullt handle case where source_filename == nullptr I just learned source_filename might also be null. In that case, we should exclude it from the hash instead of hashing a zero length string, just like we exclude source when it is null. Presumably nameless files will never be included (they can't, can they?) so this doesn't really matter, but I think it's prettier anyways.
2021-02-25fix for noUncheckedIndexedAccess in ts (#6474)Kamil Rojewski2-1/+2
2021-02-25Working on a python example plus fixing python grpc code (#6456)mustiikhalil15-690/+441
Refactored python grpc code gen Adds example server & client + fixes ci Fixes generated code Making sure we encode the reply string as utf8 Adds Readme details to clarify issue regarding encoding when python is sending/receiving
2021-02-24[rust] Remove debug code (#6475)Colin3-3/+5
* Remove debug code This was added for testing in the recent genericize PR for flexbuffer Reader. * Added alloc tests -> MapReader::{is_empty, index_key, len} * Added , accessible through Deref to deprecation warning
2021-02-23Revert "[C#] Fix truncated ArraySegment<byte> if elementSize != 1 (#6462)" ↵Derek Bailey7-24/+19
(#6488) This reverts commit cbbbaa61b34c31f17773c2fef354c31664e9562e.
2021-02-23[C#] Fix truncated ArraySegment<byte> if elementSize != 1 (#6462)Björn Harrtell7-19/+24
* WIP: Fix returned truncated ArraySegment<byte> if elementSize is not byte * Fix * Regenerated test code
2021-02-23[CI] Adds Code Generation tests on Github Actions (#6482)mustiikhalil8-6/+79
Moves check-grpc-generation to scripts
2021-02-22[CMake] generate pkg-config flatbuffers.pc file (#6455)Millian Poquet2-0/+17
This commit enables CMake to generate a flatbuffers.pc file on install. pkg-config eases the utilization of software libraries by enabling the developers of a library to define how the library should be used. It can be used as a tool by build systems to find and manage dependencies, this is notably the default Meson behavior and optionally used by CMake.
2021-02-20[Swift] Moves grpc example to grpc/examples (#6479)mustiikhalil11-206/+147
Updates generated Code Removes grpc generation code from tests dir Small fix to generate.sh
2021-02-20[TS] Moves grpc code to examples folder (#6476)mustiikhalil11-21/+33
Adds readme
2021-02-19Fixes grammer (#6477)mustiikhalil10-62/+66
Updates docs
2021-02-19Fix sample_binary.py to use latest EndVector without a size. (#6478)Richard A Hofer1-2/+2
2021-02-19updated JS docs to reflect current status (#6436)Kamil Rojewski4-143/+25
2021-02-19[Go] Working on a go example plus fixing go grpc code (#6448)mustiikhalil19-207/+842
Implemented server.go and half implemented client.go Finishes implementation for greeter go example Update grpc code for monster.fbs Adds a couple of cpp methods Adhere to gofmt standards Adds a readme for issues with grpc
2021-02-19[Swift] adds support for default vectors and strings (#6461)mustiikhalil9-37/+254
Small fix Adhere to the new protocol names
2021-02-18Update Building.md (#6473)Arnaud LE CAM1-1/+1
`cmake . -D FLATBUFFERS_CXX_FLAGS="Wno-error"` returns an error (file 'Wno-error' not found)
2021-02-18GetUOffsetT must get value by GetUint32 not GetInt32 (#6072)Thanabodee Charoenpiriyakij1-1/+1
2021-02-17Fix a typo in Swift codegen (#6470)Liu Liu1-2/+3
* Fix a typo in Swift codegen * Fix code formatting.
2021-02-16[rust] Genericize flexbuffer reader (#6450)Colin14-128/+385
* feature/rust-tokio-bytes added feature name for tokio-bytes * Added flexbuffer implementation, TODO: typecast to avoid recurse * Converted codebase to utilize FlexBuffer implementation, need to resolve deserialization issues * Added todo for lifetime issue, may use &'de [u8] for deserializer instead of current method * Added proper &[u8] implementation * Removed unused struct * Added experimental fix to get_slice * Added experimental fix to get_slice * Avoided lifetime issues via ref structs, need to check if this hurts peformance * Updated deserializer implementation to allow for borrowed data from Reader struct * Fixed bug with str * Removed unnecessary generic parameter * Added unsafe to avoid lifetime complaints, current tests pass, need to review alternatives to unsafe * Opinionated: Removed bytes crate as this implementation could be done in a separate crate * Cleaned up flatbuffer * Fixed sample / example * Resolved PR feedback, need to resolve issues with tests * Cleaned up FlexBuffer trait to be an auto impl * Removed TODO * Reverted Deserializer to only support &'de [u8] * Cleaned up / renamed function for clarification * Renamed FlexBuffer -> InternalBuffer for clarification on it's purpose * Fixed issue with key bytes * resolved issues with broken tests, confirming this is a breaking change * Removed FIXME that's solved by splitting String and Key variants * Implemented associated types approach * Fixed backward slice logic * Fixed MapReader compile error * Added from_buffer for deserialization, removed function since it's only needed for deserialization * Removed dead code * Cleaned up buffer, removed AsRef in favor of Deref * Renamed Buffer::as_str -> Buffer::buffer_str * Minor cleanup * Updated documentation, need to fix tests * Removed unnecessary & * Removed unused lifetime * removed unnecessary as_ref * Minor optimization wrap-up * resolved issue with Clone * Added test to verify no deep-copy * Added for optimization * Updated to use empty fn instead of default * Updated comments / test name - plus the 0.3.0 version bump * comment
2021-02-16[Swift] Renaming protocols (#6469)mustiikhalil5-41/+42
* Renaming protocols * Updates Generated code * format code
2021-02-14Update swift docs (#6460)mustiikhalil1-1/+1
2021-02-12Default strings and vectors: Parser + Rust support (#6421)Casper12-100/+403
* Fix tests.cpp * Parser support for vector/string defaults * tests and default empty vectors * addressed comments * Default strings and vectors for Rust * Tested Rust more_defaults * git-clang-format * add more_defaults_test * fixed vector default * removed commented out code * more unreachable Co-authored-by: Casper Neo <cneo@google.com>
2021-02-11[CMake] Renames BUILD files (#6457)mustiikhalil6-5/+7
* Renamed build to build.bazel to stop xcode from complaining about it * Renamed all build to build.bazel * Fixes small ci issue
2021-02-10[Build, cmake] Add -Werror override option (#6429)Vladimir Glavnyy2-0/+28
* [Build, cmake] Add -Werror override option This commit adds FLATBUFFERS_CXX_FLAGS cmake option. This option allows override the -Werror flag (or any other flags). Related issues: #6337, #5930 * Remove CMAKE_CXX_FLAGS replace option
2021-02-10[C++]Fix extra char generation for byte type during json schema generation ↵blueshift1550-0/+0
(#6276) * Fix extra char generation for the byte type * Fix unit tests for JSON
2021-02-10Updating working code (#6441)mustiikhalil10-288/+310
Fixes issues with namespaces in grpc ts Renamed welcome -> models
2021-02-10JSON schema - tailing double quotes for maximum (#6452)tira-misu3-11/+11
* 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 * Add generate of JSON schema to string to lib * option indent_step is supported * Remove unused variables * Fix break in test * Fix style to be consistent with rest of the code * Fix double quotes for (u)int8 in json schema * Fix reference file for JSON schema test * Fix reference file for JSON schema test
2021-02-10[idl_parser] Validate `force_align` on all possible paths (#6430)Vladimir Glavnyy5-14/+39
* [idl_parser] Validate `force_align` on all possible paths - added validation of `force_align` for `Vector`. - added assertion to `flatbuffers::PreAlign` method These changes should resolve following oss-fuzz issues: - 6275816289861632 - 5713529908887552 - 4761242994606080 * size_t problem on Mac * Fix review notes
2021-02-07Implement Rust object API defaults (#6444)Casper8-32/+403
* Implment Rust object API defaults * satisfy return analysis * git clang format Co-authored-by: Casper Neo <cneo@google.com>