Commit Graph

1831 Commits

Author SHA1 Message Date
Michael Seifert 4eb3efc221 [flatc][docs] Document rounding behavior of floats in JSON output (#5397)
* [docs] Added an example on how to convert a FlatBuffer binary to JSON
Slightly adjusted section on "Using flatc as a conversion tool".

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* [docs] Updated obsolete JSON data in example showing how to convert JSON to FlatBuffer binaries.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
2019-06-12 12:35:39 +02:00
Will Stott a807fa9567 Remove out-dated -S option from the flatc syntax. (#5398)
Looks like it's an older syntax for --strict-json which was long-ago removed in d38b9af243
2019-06-09 20:30:10 +01:00
jean-airoldie b80ad7e439 [rust] Use read_scalar_at where possible (#5385)
This slightly improves readability.
2019-06-07 14:06:20 -07:00
jean-airoldie 16aef8ac0d [rust] Derive Eq + PartialEq on FieldLoc and FlatBufferBuilder (#5394) 2019-06-06 14:09:58 -07:00
Ashwin Ramaswami b59a1ca2f8 fix typo (#5384)
* fix typo

* fix typo
2019-06-05 19:24:29 +01:00
mugisoba 4fdfe0d468 [bfbs] fix deserializing nested struct (#5383) 2019-06-02 12:49:27 -07:00
Vladimir Glavnyy 95004218f7 Fix multi-line comments for cpp enums (#5345) (#5346)
- fix CSharp comments generation
- fix Python comments generation
- fix Lua comments generation
- fix PHP comments generation
- fix Dart comments generation
- add brief description of Color enum
- add multi-line comments to the Monster:Color
2019-06-02 12:36:49 -07:00
Alexander Gallego bc7ede8fb3 c++: Add command line option to add extra includes to gen files (#5360)
* c++: Add command line option to add extra includes to gen files

Fixes #5351
We have an ability to pass custom types for strings, allocators, etc
but have no way to tell the generator to include the classes in gen code

* c++: remove std::strtok for std::string methods. passes msvc compile

* generate_code.sh: add --cpp-includes to the test gen script

* tests:generate.bat: update code gen scripts w/ --cpp-includes

* cpp: use command line parsing for extra includes

s/--cpp-includes/--cpp-include/g
Simplify command line parsing of includes by using a std::vector.

* cpp: idl.h: move std::vector for cpp_includes as the last member

msvc does not understand initalization list on our CI server

* cpp:msvc: CI fails on for-range loops

* cpp:codegen: fix error reporting on flatcc

* as per code review: remove unwated --cpp-include in the
tests/generate_code.{sh,bat}
2019-05-31 13:43:30 -07:00
Wouter van Oortmerssen b652fcc3a7 Break internal Java/C# APIs
This is done on purpose, to avoid API version mismatches that
can cause bad decoding results, see:
https://github.com/google/flatbuffers/issues/5368

Change-Id: I2c857438377e080caad0e2d8bcc758c9b19bd6ec
2019-05-31 13:00:55 -07:00
Wouter van Oortmerssen c978b9ef1f Enforce matching version in Java and C#.
Change-Id: I7f1f12f2f97e5227e0dabc2965ce66a6d41c229c
2019-05-31 12:15:19 -07:00
360 CodeSafe 3a88e1031b Dereference of null pointer #5353 (#5376)
add an assert to make sure that `key_field` is not a null pointer.
2019-05-30 17:50:21 -07:00
mugisoba 51dd733ba4 [C#] add FlatBuffersBuilder.CreateSharedString (#5372) 2019-05-30 16:15:50 -07:00
emkornfield 79f0df3dfc [C++] Fix Undefined behavior for zero length vectors (#5355)
* Fix Undefined behavior for zero length vectors

* Change fix for UBSan
2019-05-30 16:13:34 -07:00
iceboy 9d92fd92e1 Rename AnyUniqueAliases.T to AnyUniqueAliases.TS to avoid naming conflict (#5362) 2019-05-30 16:02:57 -07:00
Marc Butler 93f74c0363 Generate FlagsAttribute for Csharp (#5370)
For schema enums with the bit_flags attribute, generate the
corresponding System.FlagsAttribute in generated Csharp code.
2019-05-30 15:57:41 -07:00
aardappel 43dbac5d25 Lobster: added builder API for tables 2019-05-22 19:42:13 -07:00
aardappel 53ea1ab1bd Lobster documentation fixes 2019-05-22 16:01:51 -07:00
aardappel b10b050ab9 Made Lobster builder offsets strongly typed 2019-05-22 15:55:28 -07:00
aardappel 563dcd6893 Made Lobster API use strongly typed enums 2019-05-22 15:28:16 -07:00
aardappel 30ac512a54 Fixed Lobster implementation to work with latest language features 2019-05-22 11:48:10 -07:00
aardappel b04736f9bd Fixed warnings in idl_gen_go.cpp 2019-05-21 18:54:26 -07:00
Siddhartha Bagaria bc240b3004 [Go] Public visibility for gazelle default target (#5361) 2019-05-21 14:48:51 -07:00
jonsimantov 0f7e7fd209
Change usage of std::string's .at() to more widely-compatible []. (#5365) 2019-05-21 14:40:33 -07:00
Siddhartha Bagaria 766ed04422 Go bazel default target for gazelle (#5358) 2019-05-20 17:16:48 -07:00
David Reiss c5e2d37337 [Go] Change two more sites to use enum types (#5359)
Fixes #5357 (regression introduced by #5235)
2019-05-20 14:46:36 -07:00
David Cowan fe83b68ac6 Added a CPP UnPackSizePrefixed<struct_name> generated helper function (#5350)
* Added a cpp  UnPackSizePrefixed<struct_name> generated helper function

Missing helper function added to the cpp API generator for unpacking size prefixed structures

* Added generated test files
2019-05-20 14:01:44 -07:00
David Reiss 718ddea558 [Go] Make enums into real types, add String() (#5235)
* [Go] Make enums into real types, add String()

This changes the generated code for enums: instead of type aliases,
they're now distinct types, allowing for better type-checking. Some
client code may have to be changed to add casts.

Enum types now have a String() method, so they implement fmt.Stringer.

An EnumValues map is now generated, in addition to the existing
EnumNames map, to easily map strings to values.

Generated enum files are now gofmt-clean.

Fixes #5207

* use example.ColorGreen explicitly

* use valid enum value in mutation test, add new test for "invalid" enum

* add length check and comment
2019-05-17 12:41:39 -07:00
Siarhei Fiedartsou 8d86b5347f Add support for IAR compiler (#5347) 2019-05-16 11:56:22 -07:00
mmoscicki2 39bd667fd0 Fix reverse_iterator in Vector and tests (#5344)
Before this commit tests for iterators passed, even if the code inside
the loop has not been executed.
2019-05-16 11:49:01 -07:00
Björn Harrtell 0bb3ce6935 [JS/TS] Size prefix support (#5326)
* WIP size prefix support

* Consider size prefix in overloaded variant

* Work on code gen

* Disabled helper functions in code gen

* Enabled helper functions in code gen

* Fix size prefixed test

* Fix bad function call

* Add SIZE_PREFIX_LENGTH

* Fix review comments
2019-05-16 11:43:31 -07:00
iceboy b56d60f058 [Go] Generate imports with fixed order (#5340)
* use fixed order for golang imports

* grumble
2019-05-13 10:10:14 -07:00
Vladimir Glavnyy bff7ffbc51 Add detection of strtoull_l function (#5333) (#5337) 2019-05-09 10:15:29 -07:00
Vladimir Glavnyy 107c08988a Set default CRTReportMode for the `flatc` target (#5336)
* Set default CRTReportMode for the `flatc` target

* Add util.cpp to GRPC test target

* Fix path to util.h
2019-05-09 10:10:10 -07:00
Vladimir Glavnyy f9ebfcb9c4 Make Monster's Color unsigned (#5318)
- update C++ monster_test::Color to unsigned type
- update Go Color:ubyte in the go_test.go
- add workaround for unsigned enum in java test
- sync generate.bat and generate.sh
2019-05-09 10:07:38 -07:00
Vladimir Glavnyy b701c7d56e Fix out-of-range error (MSVC2010) in idl_gen_dart.cpp (#5335)
-- MSVC2010 doesn't support indexed access to \0-terminator.
2019-05-09 10:05:21 -07:00
Will Stott 103f61b685 [Python PyPI] Added classifiers and more links. Fixes typo and #5215 (#5272) 2019-05-08 12:42:20 -07:00
Malthe Borch e47ca7ab40 Use a hash table to index existing vtables (#5314)
* Use a hash table to index existing vtables

This allows for quick deduplication even in situations where there
might be thousands of vtables due to 'combinatoric explosion'.

This fixes issue #5301.

* Refactor 0-offset trimming

* Improve deduplication benchmark

The routine now generates a set of realistic logical layouts and
uses a timer function that randomly picks a layout for each iteration.

The benchmark runs in batches of # of logical layouts = 1, 10, 100, 1000.

(Note that due to alignment, the actual number of vtables is usually slightly
higher.)
2019-05-06 15:00:02 -07:00
Vladimir Glavnyy d79f4e9717 Add monster_extra files to Bazel cc_test section (#5321)
- add monster_extra.fbs
- add monsterdata_extra.json
2019-05-06 12:27:04 -07:00
Lee Mracek 5d67693e8f Fix typo in build_defs.bzl (#5320) 2019-05-06 12:10:11 -07:00
Vladimir Glavnyy af74f87ccd Make MonsterExtra table a root table (#5315)
- MonsterExtra table a root table
- add mosterdata_extra.json
2019-05-02 15:12:58 -07:00
Vladimir Glavnyy b8ef8c1521 Fix issues with uint64 enums (#5265)
* Fix issues with uint64 enums

- hide the implementation of enums from code generators
- fix uint64 the issue in the cpp-generator
- fix #5108
- new tests
- enums with bit_flags attribute should be unsigned

* Refine objectives of EnumDef's FindByValue and ReverseLookup methods

- move EnumDef::ReverseLookup implementation to idl_parser.cpp
- fix typos

* Make the IsUInt64 method private
2019-05-02 13:57:58 -07:00
László Csomor 6cc30b3272 [BUILD] Fix Bazel test target //:flatbuffers_test (#5311) 2019-04-29 10:01:23 -07:00
jean-airoldie e5b6125fa2 Added common rust traits to FlatBufferBuilder (#5307)
* Added Clone, Debug and Default
2019-04-26 18:40:10 -07:00
Wouter van Oortmerssen ac14c8906f Update GRPC Java generated file.
Change-Id: I57ccbe0b9ccbbec65ca04f9db3cbd62243480d92
2019-04-24 12:34:42 -07:00
Wouter van Oortmerssen 9936adf473 [maven-release-plugin] prepare for next development iteration
Change-Id: I402d857eef9f3e5f3765427c5d3b868ed5a3a22e
2019-04-24 12:09:50 -07:00
Wouter van Oortmerssen bf9eb67ab9 [maven-release-plugin] prepare release 1.11.0
Change-Id: I716f6b915adfa6682b5d864857abf7d491d788b5
2019-04-24 12:09:44 -07:00
Wouter van Oortmerssen 9e7e8cbe9f Bumped version to 1.11.0
Change-Id: I0c87ad2cf8f8768cf40c5b7abea0add087a5518a
2019-04-24 11:34:53 -07:00
Clément Julliard b72a75f87d Doc: use correct ref types for flatcc string creation. (#5305)
Some string definitions were typed as ns(Weapon_ref_t) while they should
be flatbuffers_string_ref_t. Note that the former was also compiling &
running correctly as both ref types boil down to the same underlying ref
type.
2019-04-24 10:34:21 -07:00
Philipp Wollermann 6cfcd8628a Don't test on Ubuntu 14.04 (#5302)
Ubuntu 14.04 is about to be end-of-life and Bazel CI will stop supporting it shortly afterwards.

Context: https://groups.google.com/d/msg/bazel-dev/_D6XzfNkQQE/8TNKiNmsCAAJ
2019-04-24 10:28:35 -07:00
Damien Lespiau ddb12c0192 [Javascript] Remove newly introduced trailing whitespace in flatbuffer.js (#5300)
* Remove newly introduced trailing whitespace in flatbuffer.js

The newly introduced clear function has some trailing white space in an
otherwise whitespace clean file. Remove it.

* Remove spurious new line in the BytesBuffer construction

Another spurious white space introduced by the clear() PR.
2019-04-22 11:48:56 -07:00