Fixes#7320.
I realize that Rust doesn't really follow the Namer convention, since
it uses Field case for methods... that's a future problem.
Co-authored-by: Casper Neo <cneo@google.com>
* Add explicit return types to lobster generated code
* Add support for optional fields.
Convert to bool explicitly from int8 to match type signature
Fix whitespace
I think these changes reflect the current state, but I found it hard to
track the state of some of the planned work. Hence why it'd be good to
have it documented :)
I also expanded some sections that I found misleading, as somebody
familiar with Rust and FlatBuffers separately. Parts of these pages seem
to be aimed at people familiar with FlatBuffers (ie via the other
documentation pages) but not each language, which I'm trying to
preserve. However, Rust does some things differently, and as somebody
with expectations about how typical Rust APIs work the discussion of
threading made me wonder what was different.
std::span lacks these; make the flatbuffers STL emulation and tests
match. This fixes a compile error in C++20 mode when using std::span.
Bug: chromium:1284275
* Set an explicit 2018 edition for Rust tests
* Replace all `std` usage with `core` and `alloc` in Rust code generator
* Update the generated files
* Make Rust tests actually use no_std when the corresponding feature is enabled
* Keep the underlying storage capacity when clearing the FlatBufferBuilder. Gives a significant performance boost for serialisation of many small messages.
* Use Googles Swift benchmark library for more consistent results and dynamic number of iterations, simplification of tests as result.
Co-authored-by: Joakim Hassila <hassila@users.noreply.github.com>
Since CreateVectorOfStrings() takes a templated container, make sure that
the default template deduction from just an initializer list will
still work.
Signed-off-by: Henner Zeller <hzeller@google.com>
* [Java] Fix key lookup returning null clashing with default value
A field with key attribute must always be written on the message so it
can be looked up by key. There is a edge case where inserting a key
field with same value as default would prevent it to be written on
the message and later cannot be found when searched by key.
* [Kotlin] Fix key lookup returning null clashing with default value
A field with key attribute must always be written on the message so it
can be looked up by key. There is a edge case where inserting a key
field with same value as default would prevent it to be written on
the message and later cannot be found when searched by key.
Co-authored-by: Derek Bailey <derekbailey@google.com>
A field with key attribute must always be written on the message so it
can be looked up by key. There is a edge case where inserting a key
field with same value as default would prevent it to be written on
the message and later cannot be found when searched by key.
Any string type that is supported by CreateString(), e.g.
const char* or string_view will now also work.
Signed-off-by: Henner Zeller <hzeller@google.com>
* [Kotlin] Update gradle to 7.4.1 and simplify config files.
* [Kotlin] Add wrapper-validation-action to Kotlin Linux
* [Kotlin] Remove benchmark actions to reduce CI time
* [Kotlin] Move CI js test to Linux action, to increase Mac action speed
* [Kotlin] Generate gradle wrapper in order to be validate
Gradle wrapper from 3.3 to 4.0 are not verifiable because those files
were dynamically generated by Gradle in a non-reproducible way.
So they are now regenerated and will be checked using gitlab action:
gradle/wrapper-validation-action@v1
* 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