When creating a CreateXxx(...) method for a simple table type,
enum-type fields with a non-zero default must have an explicit
cast for the respective argument default value, because in C#,
there is an implicit cast from int to an enum only for 0.
Also, added an example of such type into the example monster_test
type, so that we test this feature.
Also made proper namespacing work for enums.
You can now say namespace.MyTable as the type when declaring
a field that refers to a type in a different namespace.
Previously, it would work just referring to MyTable, however
with the recent commit fixing namespaced types this now
is ambiguous.
Change-Id: Ieaa3f4ac1662b8c4dc1f16e1898ea3cdb02e10fd
Tested: on Linux.
(Java doesn't support unsigned types).
ubyte/ushort return as int
uint returns as long
(all with correct masking)
ulong still returns as long, as before.
Tested: on Linux & Windows.
Bug 17521464
Change-Id: Id6bc8f38fc8c1a2f4e6733c6980dc6b6e322b452
FlatBuffer schema files can now optionally specify a hash attribute that
will allow someone writing json files to enter a string to be hashed
rather than a specific value. The hashing algorithm to use is specified
by the schema.
Currently the only algorithms are fnv1 and fnv1a. There are 32 bit and
64 variatns for each. Additionally, a hashing command line tool was
added so that you can see what a string will hash to without needing to
inspect the flatbuffer binary blob.
Change-Id: I0cb359d0e2dc7d2dc1874b446dc19a17cc77109d
This is such that if you mis-spell an attribute, it doesn't get
silently ignored.
Bug: 18294628
Change-Id: I10013f5b2a21048b7daba2e9410678f528e09761
Tested: on Linux.
Also fixed Go unit tests not being up to date with recent schema
changes.
Change-Id: I42e619f9c5ea05f6f937c68a5c8a92462c46bce3
Tested: on Linux and Windows.
Accessors and constructors now take enum types rather than ints.
Bug: 16570507
Change-Id: I4b50fd64ad2e662ea2481bc0ccea784326fb31c0
Tested: on Linux and Windows.
Looks like MSVC on Windows and like gcc everywhere else.
For enhanced IDE clickability.
Bug: 17208371
Change-Id: Ie3e02658fccd3edfd464b4bacf4bc68c613a8570
Tested: on Linux and Windows.
Allows you to add, and test for the presence of a magic 4-char
string in a FlatBuffer.
Tested: on OS X.
Change-Id: I090692a9e4fb53bed3543279a28563e67132cba0
It was outputting the type instead of the field name, and didn't deal
with NULL fields. Added test case.
Also fixed token enums having the wrong value, resulting in
unreadable error messages.
Change-Id: Icd9b4d22f417bfad5824c0f58e067ce3f2e2dc6f
Tested: on Windows and Linux.
New attribute:
- `id: n` (on a table field): manually set the field identifier to `n`.
If you use this attribute, you must use it on ALL fields of this table,
and the numbers must be a contiguous range from 0 onwards.
Additionally, since a union type effectively adds two fields, its
id must be that of the second field (the first field is the type
field and not explicitly declared in the schema).
For example, if the last field before the union field had id 6,
the union field should have id 8, and the unions type field will
implicitly be 7.
IDs allow the fields to be placed in any order in the schema.
When a new field is added to the schema is must use the next available ID.
Change-Id: I8690f105f3a2d31fdcb75a4fab4130692b12c62f
Tested: on Windows