Age | Commit message (Collapse) | Author | Files | Lines |
|
- add a new method ParseJson to minimize failures during fuzzing
- add default (conditional) move-constructor for Parser
- add a new monster_fuzzer
- switch fuzzers to C++17 and `test/cpp17` generated code
|
|
|
|
* Add --require-explicit-ids to require explicit ids
We just got bit by a well intentioned developer forgetting that field
order by default is the field index. 3 people missed it in review.
I'm looking at ways to make it harder to mess up. We are requesting
that developers explicitly id all fields in tables. Automatic (opt in
for others) enforcement of this will help the effort succeed. This
patch adds a command line flag which lets the user require ids on all
fields in tables.
* Added docs to Compiler.md as well
|
|
* idl_gen_json_schema.cpp: Changed generation of array element types
#6175
* idl_gen_json_schema.cpp: Simplified indent generation as suggested by @vglavnyy
#6175
|
|
* Formats files & adds licence
* Revert arrays
* Keeps array indentation as is
* Adds licence to code formatter
* Updates code generators
|
|
|
|
* Remove _POSIX_C_SOURCE and _XOPEN_SOURCE definitions when compiling on OpenBSD
* Only define _POSIX_C_SOURCE and _XOPEN_SOURCE for mingw/cygwin platforms
* Only define POSIX statements for mingw/cygwin/qnx platforms
|
|
* 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
* Add GetStringView (Convenience function to get string_view from a String returning an empty string_view on null pointer) like GetString, GetCstring
* flatc should warn, when an attribute is attached more than once.
flatc.exe -b duplicate.fbs
warning: duplicate.fbs(5, 36): warning: attribute already found: priority
duplicate.fbs:
namespace MyGame;
attribute "priority";
table Monster (priority:1, priority:2) {
}
root_type Monster;
* flatc should support --binary --schema with optional scalar fields.
This fixes 'error: Optional scalars are not yet supported in at least one the of the specified programming languages.' when calling flatc.exe --binary --schema with a schema containing optional scalars.
|
|
* Union As Accessors for C#
* Changed loop to be compatible with older compilers
* errant change fix
|
|
Co-authored-by: Casper Neo <cneo@google.com>
|
|
|
|
* [C#] Optional Scalars
* Moved scalar optional check to avoid null enum conversion
|
|
* Refactor idl_gen_rust to a ForAllX continuation pattern.
* Removed unneeded SetValue and updated sample rust gencode
* Make Rust flatbuffers print right
* Generated code and removed unnecessary trait constraint
* bumped rust version. Release required
* removed an unwrap in Rust Debug-print unions
* Tested formatting flatbuffers in rust.
* Set float precision in flaky debug-print test
* impl Debug for structs too
Co-authored-by: Casper Neo <cneo@google.com>
|
|
* optional scalars for ts/js
* removed range based for
* removed range based for
|
|
Java implementation of optional scalars, following issue #6014.
|
|
definitions (#6204)
|
|
* Refactor idl_gen_rust to a ForAllX continuation pattern.
* Updated rust sample code
Co-authored-by: Casper Neo <cneo@google.com>
|
|
* Updated SupportsAdvancedUnionFeatures to look out for string
* Mass refactoring to use BASE_TYPE helper functions.
Co-authored-by: Casper Neo <cneo@google.com>
|
|
Co-authored-by: Casper Neo <cneo@google.com>
|
|
* Rework enums in rust.
They're now a unit struct, rather than an enum. This is a
backwards incompatible change but the previous version had UB
and was also backwards incompatible so...
* Update and test sample rust flatbuffers
* Use bitflags crate to properly support rust enums.
Previously, the bitflags attribute was just ignored. This is a breaking change
as the bitflgs API is not like a normal rust enum (duh).
* variant_name() -> Option<_>
* repr transparent
* Reexport bitflags from flatbuffers
* Make bitflags constants CamelCase, matching normal enums
* Deprecate c-style associated enum constants
Co-authored-by: Casper Neo <cneo@google.com>
|
|
* idl_gen_json_schema.cpp: Fixed generation of arrays of enums
#6175
* Fixed failing unit tests
* GenBaseType generate "integer".
Fixes #6066
* Ran tests/generate_code.
* Removed modern R"()" strings
* changed std::to_string to NumToString
|
|
* 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
|
|
* Add option to not generate direct copy methods.
The direct copy methods generated by flatc utilize std::vector which isn't allowed on some embedded systems. Permit users of the compiler to not generate these methods so they don't have to be stubbed out.
* Update docs for no-cpp-direct-copy option.
|
|
- add flatbuffers::span
- add new constructor for `struct` with `array`
- add some test for flatbuffers::span and 'arrays_test.fbs'
|
|
* Fixed rust nested flatbuffers for tables other than self
* replaced lifetimes
* Use WrapInNameSpace and also update samples
Co-authored-by: Casper Neo <cneo@google.com>
|
|
* GRPC implementation for Typescript
* Fixes a couple of issues
* Finished implementing the typescript support for grpc
* Updated generated code
* Fixes CI
|
|
* Moved C++ to optional_scalars2 and added some tests.
Also deleted unused optional_scalars_generated.lobster
* Fixed whitespece in C++ gencode & fixed BUILD file
* Moved C++ onto optional_scalars2 in the .bat file
Co-authored-by: Casper Neo <cneo@google.com>
|
|
UnpackTo copies vector elements one-by-one, which can be very inefficient depending on the quality of the compiler optimizations performed. This change updates the operation for vectors of bytes that aren't enums to use 'std::copy', which is usually highly optimized.
vectors of types that are more than one byte can't be optimized in this way because of the endianness of the serialized bytes vs. the target architecture endianness.
vectors of enums can't be optimized because they are required to be static_cast into the appropriate enum type when stored in the vector.
vectors of bools can be optimized in most cases, but since the standard
allows std::vector<bool> template specialization for space-savings,
std::copy doesn't work on every implementation (looking at you
Microsoft). Thus, this optimization is skipped for vector<bool>.
For a specific example, this improves the latency of unpacking large buffers on the Hexagon DSP by about 10x.
Co-authored-by: Matthew Markwell <markwell@google.com>
|
|
[Swift] Enables optional enums
|
|
* Rust support for optional enums
* make optional_scalars2 for languages that support optional enums
Co-authored-by: Casper Neo <cneo@google.com>
|
|
|
|
(#6146)
* 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
* Add GetStringView (Convenience function to get string_view from a String returning an empty string_view on null pointer) like GetString, GetCstring
* flatc should warn, when an attribute is attached more than once.
flatc.exe -b duplicate.fbs
warning: duplicate.fbs(5, 36): warning: attribute already found: priority
duplicate.fbs:
namespace MyGame;
attribute "priority";
table Monster (priority:1, priority:2) {
}
root_type Monster;
|
|
* [Python] Codegen SizeOf classmethod for structs
This codegens a `SizeOf()` classmethod for all structs since we can't
determine the size of a FlatBuffer generated struct from Python otherwise.
* [JS/TS] Codegen sizeOf static method for structs
This codegens a `sizeOf()` static method for all structs since we can't
determine the size of a FlatBuffer generated struct from JavaScript or
TypeScript otherwise.
|
|
* CMakeLists: also really generate optional_scalars as needed by test elsewhere
* [C++] Handle fixed-length array in minireflection
Fixes #6128
|
|
This commit adds replacement of `::tolower` and `::toupper`.
Added CharToLower and CharToUpper routines reduce the number of cast operators
that required for correct usage of standard C/C++ `::tolower/toupper` routines.
|
|
|
|
More information on #6014
|
|
This optionally generates a static `getFullyQualifiedName()` function to get
the fully-qualified name of a type in JavaScript and TypeScript in a similar
fashion to the C++ codegen.
|
|
* Migrates struct write APIS to in place APIS
* Fixes indentation in grpc swift
|
|
* Optional scalars in reflection
* fixed name collision
* Remove code duplicated by merge
Co-authored-by: Casper Neo <cneo@google.com>
|
|
Co-authored-by: Casper Neo <cneo@google.com>
|
|
|
|
This commit performs refactoring (Extract Method) of the C++ code generator.
It extracts code generation of a table getter/mutator into separated methods.
|
|
Fixes accessor in greeter.swift
Small fix for ci
|
|
|
|
* Attach JvmStatic annotation to each method of companion object
Kotlin does not have static accessor so companion object used instead of static.
It's so natural. But when use kotlin companion object methods on java it is very inconvenient.
```java
GeneratedClassByFlatBuffer.Companion.someMethod()
```
If use @JvmStatic annotation it can be shorten like below.
```java
GeneratedClassByFlatBuffer.someMethod()
```
* Formatting by Idea Google C++ style
* Add comments - Commit for missing cla
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Add comments - Commit for missing cla
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Reset code formatting except modified lines
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Pass missing flag to validateVersion method
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Add annotations to missing method in companion object
* addVector
* createVector
* endVector
* tableCreator
And also I tried add compiler option for generate annotation who don't like this operation.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Modify unmatched option name in compiler usage
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Add missing operation for finishSizePrefixed and finishStructBuffer method.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Add compiled example with --kotlin-gen-jvmstatic option.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Fix Compiler.md
Change option name from --gen-jvm-static-annotation to --kotlin-gen-jvmstatic
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Use IDLOptions reference instead of bool parameter.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Change option name - kotlin_gen_jvmstatic to gen_jvmstatic
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Use IDLOptions reference instead of bool parameter and missing process @JvmStatic as suffix.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Add code generation for --gen-jvmstatic option
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Miss typo directory for including.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Miss typo variable suffix for including.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Fix camel case to snake case.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Rollback generate code for gen_jvmstatic option.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Delete generated test files.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* add missing new line at end of file.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
* Remove generated test file by command line.
Signed-off-by: Yoon KyongSik <sam1287@gmail.com>
Co-authored-by: sam <sam@jennifersoft.com>
|
|
* Adds a serialize helper function to native table
* Updated version
|
|
* [TS] Fix four bugs with imported types in TypeScript.
* When a type had a vector of imported enums:
1) the enum type's file wasn't added to the generated code's list of
imports; and
2) the enum wasn't prefixed with the NS<hash> prefix and wasn't getting
resolved; but
3) non-enum types (ie, "flatbuffers.Offset") were getting the NS<hash>
prefix when they weren't.
* Also, type name prefixes weren't properly attributed with imported
structs in unions because the source definition passed to the typename
prefixing method was for the union, not for the location of the imported
struct.
* clang fmt
* Use of enum_def / struct_def for prefixing types needs to have the files
added to imported files when not generating all types.
* clang fmt
|
|
* [Swift] Append namespace for Swift Grpc implementation
* Separate ServiceName from ServiceQualifiedName.
|
|
Co-authored-by: Kamil Rojewski <kamil.rojewski@gmail.com>
Co-authored-by: Wouter van Oortmerssen <aardappel@gmail.com>
|