* forbid enum values that are out of range
Enum values that are out of range can lead to generated C++ code that does
not compile. Also forbid boolean enums.
* update enum and union documentation slightly
* Refactoring of numbers parser
More accurate parse of float and double.
Hexadecimal floats.
Check "out-of-range" of uint64 fields.
Check correctness of default values and metadata.
* Remove locale-independent code strtod/strtof from PR #4948.
* small optimization
* Add is_(ascii) functions
* is_ascii cleanup
* Fix format conversation
* Refine number parser
* Make code compatible with Android build
* Remove unnecessary suppression of warning C4127
Allow tables to be mapped to native types directly. For example, a table
representing a vector3 (eg. table Vec3 { x:float; y:float; z:float; }) can
be mapped to a "mathfu::vec3" native type in NativeTables. This requires
users to provide Pack and UnPack functions that convert between the
Table and native types. This is done by adding the "native_type" attribute
to the table definition.
To support user-defined flatbuffers::Pack and flatbuffers::UnPack functions,
support a "native_include" markup that will generate a corresponding
Also add an UnPackTo function which allows users to pass in a pointer to
a NativeTable object into which to UnPack the Table. The existing UnPack
function is now simply:
NativeTable* UnPack() {
NativeTable* obj = new NativeTable();
Table::UnPackTo(obj);
return obj;
}
Finally, allow native types to be given a default value as well which are
set in the NativeTable constructor. This is done by providing a
"native_default" attribute to the member of a table.
Change-Id: Ic45cb48b0e6d7cfa5734b24819e54aa96d847cfd
This allows hashed string fields to be used for lookup of any
C++ objects, a pointer to which are then stored in the object
besides the original hash for easy access.
Change-Id: I2247a13c349b905f1c54660becde2c818ad23e97
Tested: on Linux.
Bug: 30204449
This is the first step in RPC support. Actual code generation
to follow.
Change-Id: I96c40fec3db671d100dd9eb509a71c5cbe55bfb2
Tested: on Linux.
Bug: 20122696
Adding an API reference for the supported languages.
General docs cleanup, including a new `tutorial` section that
supports all of the supported languages.
Added samples for each supported language to mirror the new
tutorial page.
Cleaned up all the links by making them `@ref` style links,
instead of referencing the names of the generated `.html` files.
Removed all generated files that were unnecessarily committed.
Also fixed the C# tests (two were failing due to a missing file).
Bug: b/25801305
Tested: Tested all samples on Ubuntu, Mac, and Android. Docs were
generated using doxygen and viewed on Chrome.
Change-Id: I2acaba6e332a15ae2deff5f26a4a25da7bd2c954
This is such that if you mis-spell an attribute, it doesn't get
silently ignored.
Bug: 18294628
Change-Id: I10013f5b2a21048b7daba2e9410678f528e09761
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
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
This is a breaking change, anyone having schema files with enums
that do not specify a type will get a specialized error:
must specify the underlying integer type for this
enum (e.g. ': short', which was the default).
All of the samples and docs already had a type specified,
so hopefully this will affect very few people.
Bug: 15777205
Change-Id: I9b8d7c0827867f7efb6c217346db7e402695eff0
Tested: on Windows