* Adds implementation flag for swift
Forces internal flag when using @_implementationOnly in swift
Fixes access type for verifier functions & encoder functions
Updates generated code
* Addresses PR comments & adds a code gen dir within the swift tests
* Adds test case for no-include
* Fixes code gen script
Removes prefix
* Started to migrate to target_compile_options
* combined compile options together. Added Mac CI builds
* remove arm build (not supported). Fixed old-style-casts
* moved to using a ProjectConfig interface library to specify options
* remove the explicit CMAKE_CXX_STANDARD
* code gen flexbuffer verifier
* remove verify nested flexbuffers from flexbuffers
* made function static, and placed higher in file
* moved function to own header
* Typo in flatc options (warning-as-errors instead of warnings-as-errors)
* VerifySizePrefixed (reflection::Schema) and GetAnySizePrefixedRoot added
* some review comments
* more review comments
* Fix for https://github.com/google/flatbuffers/issues/7209
* Fixes [C++] flatc generates invalid Code for union field accessors, when --cpp-field-case-style is used #7210
* Add overloads to Add/Put for ArraySegment and IntPtr
In order to allow using code to reduce memory allocations, add overloads to ByteBuffer's and FlatBuffersBuilder's Put/Add methods that take ArraySegment<T> or IntPtr respectively.
Also, adaptions to the c# code generator in flatc to emit corresponding CreateVectorBlock() overloads
* Add missing files generated with generate_code.py
The previous commit changed the C# code generate, but didn't contain the updated generated test files.
* Incorporate review findings
(1) Adhere to 80 characters limit.
(2) In FlatBufferBuilder.Add(IntPtr,int), move zero length check topmost and add sanity check against negative input
* Started applying Namer to Java.
- Java didn't previously have keyword escaping
- Added prefixes and suffixes to the Namer methods
- TODO: migrate previous namer applications to using pre/suffixes
- Java methods / functions are interesting, it's mostly camel case
except when it involves a struct/enum name. That section is Keep case
- I changed the casing for some internal arguments/variables. This
violates the "don't change genfiles" rule that I've been using but it
shouldn't break user code.
- LegacyJavaMethod2 is interesting. Basically, Java has a "mixed" case
convention where it's camel case, except for the type/variant name
itself, which is keep case. So a type foo_bar would become getfoo_bar
instead of getFooBar.
* small fix
* Namer for Namespaces
* removed unused parameter, add const everywhere
* Remove unused argument
* More unused args
* Use mutable reference out parameters
* Made more strings const and inlined const empty strings
* remove do not submit
Co-authored-by: Casper Neo <cneo@google.com>
* 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
* [TS] Fix reserved words as arguments (#6955)
* [TS] Fix generation of reserved words in object api (#7106)
* [TS] Fix generation of object api
* [TS] Fix MakeCamel -> ConvertCase
* [C#] Fix collision of field name and type name
* [TS] Add test for struct of struct of struct
* Update generated files
* Add missing files
* [TS] Fix query of null/undefined fields in object api
* Add example for type field name collision
* [swift] Add bazel configuration for Swift
This change adds a simple bazel BUILD file for consuming the Swift
support. This also bumps the platforms bazel repo to fix support for M1s
and bazel 5.1+ https://github.com/bazelbuild/bazel/issues/15099#issuecomment-1075368289
The rules_swift inclusion here must happen before gRPC to ensure we
don't pull in an older version.
* Add CC=clang which is a requirement for Swift on Linux
* Add Swift to PATH
* Apply Namer to Dart.
- Also refactor idl_gen_dart a bit
- to use more const and references
- out parameters should be the last argument
* Add keyword test
* minor fixes
* fix merge
* extra 's'
* move dart keyord into dart dir
* Address comments
* Use $ for escaping keywords
* Outparameters for namespace_map
* Escape dollar in toString
* Escape dollar in toString2
* Use UpperCamelCase for types and variants
* try to fix ToString
* namer Type fixes
* Remove path prefixing in imports
* gen code
Co-authored-by: Casper Neo <cneo@google.com>
* Handle invalid root offset
* Handle vtable offset invalidation
* Added script generator. Add more cases through vtable ref table size
* review responses
* vtable offset validation
* Moved padding insertion to the end. Tests invalid field lenghts
* table offsets validated. Added type after field
* validate string length
* add todo
* invalid vector length
* invalid structs
* general cleanup
* reworded invalid offsets
* example for vector of structs
* invalid vector of tables
* invalid vector of strings
* invalid vector of scalars
* vector of unions
* validate union type value
* invalid vector union type values
* 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
* [TS] Fix reserved words as arguments (#6955)
* [TS] Fix generation of reserved words in object api (#7106)
* [TS] Fix generation of object api
* [TS] Fix MakeCamel -> ConvertCase
* [TS] Add test for struct of struct of struct
* Update generated files
* Add missing files
* [TS] Fix query of null/undefined fields in object api
* Typo in flatc options (warning-as-errors instead of warnings-as-errors)
* VerifySizePrefixed (reflection::Schema) and GetAnySizePrefixedRoot added
* some review comments
* more review comments
* Apply Namer to Lua bfbs code gen
* refactor namer into IdlNamer to keep idl includes separate
* remove commented out code
* added bfbs_namer
* remove Enum case
* add to bazel
* Allow suppression of including <optional> via macro
* Combine preprocessor conditions
* Make inclusion of header <optional> opt-in
* Make inclusion of <optional> opt-out via macro
* Auto-detect C++17+ when defining macro
* Enclose macro expression in parentheses
* Check value of macro, not whether it's defined
* Fix parentheses
* Don't define macro with expression using other macros
The preprocessor doesn't seem to like it.
* Fix parentheses
* Define and use Namer overloads
* more
* NamespacedType needs a public string-like overload
* Move Rust FieldOffsetName to Namer LegacyRustFieldOffsetName
* Started swift
* More Namer updates
* Remove more usage of the variable 'name' which was semantically overloaded
* unshadow varible
* Make ptr to bool explicit
Co-authored-by: Casper Neo <cneo@google.com>
* Define and use Namer overloads
* more
* NamespacedType needs a public string-like overload
* Move Rust FieldOffsetName to Namer LegacyRustFieldOffsetName
Co-authored-by: Casper Neo <cneo@google.com>
The headline here is adding a flatbuffer_ts_library rule for generating
typescript code in bazel. This entails some non-trivial other changes,
but ideally none are user-visible.
In particular:
* Added a --ts-flat-file flag that generates a single *_generated.ts
file instead of separate files for each typescript type. This makes
bazel much happier.
* Import the bazel rules_nodejs stuff needed to support building
typescript in bazel
* Move flatbuffers.ts to index.ts because I wasn't sure how to make
bazel comprehend the "main" attribute of the package.json. Happy
to take another stab at figuring that out if really needed.
* Fix another couple keyword escaping spots in typescript...
* Refactor out a class from Rust Codegen
* Convert GenerateRustModuleRootFile
* git-clang-format
* unused variable
* parenthesis
* update BUILD file
* buildifier
* Delete bfbs_gen_rust.h
* Delete bfbs_gen_rust.cpp
* Addressed some comments
* Namer::EnumVariant
* Remove do not submit; Add Namespace vector overload
* Unshadow variable
* removed redundant variables
* Apply Namer to Python
* Use more variables a bit
* Apply const a bunch
* More variables
* Fix ObjectTypes
* git clang format
* small thing
* Simplified code around nested flatbuffers
* Make more methods const.
* Python files are kKeep case
* Address DO NOT SUBMIT in SaveType
* ensure dir exists before saving files
* clang format
Co-authored-by: Casper Neo <cneo@google.com>
* Refactor out a class from Rust Codegen
* Convert GenerateRustModuleRootFile
* git-clang-format
* unused variable
* parenthesis
* update BUILD file
* buildifier
* Delete bfbs_gen_rust.h
* Delete bfbs_gen_rust.cpp
* Addressed some comments
* Namer::EnumVariant
* Remove do not submit; Add Namespace vector overload
* Unshadow variable
* removed redundant variables
* Apply Namer to Python
* Use more variables a bit
* Apply const a bunch
* More variables
* Fix ObjectTypes
* git clang format
* small thing
* Simplified code around nested flatbuffers
* Make more methods const.
* Python files are kKeep case
* Address DO NOT SUBMIT in SaveType
* ensure dir exists before saving files
* fix space
Co-authored-by: Casper Neo <cneo@google.com>
* Add Object to the list of reserved keywords.
* Properly escape keywords in type names.
* Properly escape keywords in enum names.
* Properly escape keywords in enum field names.
* Fix 64-bit default numeric enum values in typescript
If you had a default value that wasn't a valid enum value (e.g., a zero
if you used a bit_flag setting, like you get with AdvancedFeatures
in reflection.fbs), we weren't using BigInt.
* Run generate_code.py
* [DART] Handle deprecated fields & invalid enum defaults
* Update .NET test