Implement code generation and self-contained runtime library for Python.
The test suite verifies:
- Correctness of generated Python code by comparing output to that of
the other language ports.
- The exact bytes in the Builder buffer during many scenarios.
- Vtable deduplication correctness.
- Edge cases for table construction, via a fuzzer derived from the Go
implementation.
- All code is simultaneously valid in Python 2.6, 2.7, and 3.4.
The test suite includes benchmarks for:
- Building 'gold' data.
- Parsing 'gold' data.
- Deduplicating vtables.
All tests pass on this author's system for the following Python
implementations:
- CPython 2.6.7
- CPython 2.7.8
- CPython 3.4.2
- PyPy 2.5.0 (CPython 2.7.8 compatible)
This commit contains the first step in providing mutable FlatBuffers,
non-const accessors and mutation functions for existing fields generated
from --gen-mutable.
Change-Id: Iebee3975f05c1001f8e22824725edeaa6d85fbee
Tested: on Linux.
Bug: 15777024
(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
People sometimes accidentally inherit from these types.
Bug: 18224703
Change-Id: Ia09489a834ac4941f9b4a46f240cbdcf456f03a1
Tested: on Windows and 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.
Since part of it is based on the filename, which may contain
characters that are not legal identifiers.
Change-Id: I62b8fe228a434a2040fd4ce47d220fc4d3398b41
Tested: on Linux.
This would cause double definition linker errors when included in
multiple compilation units.
Change-Id: Ie6fd4af018055a099343182a92a7776f2fea4725
Tested: on Linux.
Theoretically, an attacker could construct a FlatBuffer with the
sole purpose of making verification really expensive, essentially
DOS-ing a server that uses verification on FlatBuffers. This adds
a max table depth and max table amount at which point the
verifier declares the buffer malformed.
Bug: 16301336
Change-Id: I6b098c31d030d24c19e852b33609110658e66aa9
Tested: on OS X
Previously, it would ignore the fact that the type comes from a
different namespace. Now they are pre-declared in their own namespace,
and referenced with a qualified name if necessary.
Bug: 16851682
Change-Id: I5cb625b86d28e7436b9e93c70a0fa16a600d9884
Tested: on Linux
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