Commit Graph

17 Commits

Author SHA1 Message Date
Wouter van Oortmerssen f57d012a21 Non-alpha-numeric characters are filtered out of include guards
Since part of it is based on the filename, which may contain
characters that are not legal identifiers.

Change-Id: I62b8fe228a434a2040fd4ce47d220fc4d3398b41
Tested: on Linux.
2014-09-05 11:27:03 -07:00
Wouter van Oortmerssen f5e343efba A generated C++ function was missing "inline".
This would cause double definition linker errors when included in
multiple compilation units.

Change-Id: Ie6fd4af018055a099343182a92a7776f2fea4725
Tested: on Linux.
2014-09-05 10:56:16 -07:00
Wouter van Oortmerssen 11b743688c Improved the verifier to be even more resilient.
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
2014-08-22 14:14:32 -07:00
Wouter van Oortmerssen c2ba7fd251 Referring to types from other namespaces in C++ now works correctly.
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
2014-08-19 17:20:08 -07:00
Wouter van Oortmerssen 293a8110c4 Fixed "unused private field" warning for clang.
Bug: 17095037
Change-Id: Iedbe56f6ddc0ba7876896b0bb7ed9da8e6a85f7e
Tested: on Linux & OS X.
2014-08-19 14:25:55 -07:00
Wouter van Oortmerssen 0b47e69d4d Parser now allows empty tables in JSON
Bug: 16870719
Change-Id: Ia5fdce49a67b1aa621ab1e37a815e2a3293257b6
Tested: on Linux
2014-08-13 11:44:20 -07:00
Wouter van Oortmerssen 5da7bda826 File identifier feature.
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
2014-08-12 14:37:06 -07:00
Wouter van Oortmerssen 7057033116 Enum definitions are generated without a trailing comma (-pedantic).
Change-Id: I07cd28e5915a0526614db85f894f27a5bd27f3bb
Tested: on Windows.
2014-07-28 17:03:08 -07:00
Alex Ames 3f53f73c63 Corrected the order of the comments on namespace close parens
Also removed the semicolon on the bracket. It makes -pedanic unhappy.

Bug: 16399323
Change-Id: I16ec0d67af13c3ca0bc6285741f5a95658d262bd
2014-07-21 17:14:34 -07:00
Wouter van Oortmerssen 127d35085a Added a `bit_flags` attribute to enum declarations that 1<<N every value.
Change-Id: Ib9ec0cb3ddec60b1ca124eaf815fb1ae0cc53e1c
Tested: on Windows and Linux
Bug: 16186562
2014-07-21 16:40:39 -07:00
Wouter van Oortmerssen 3e201a99b2 A feature that officially supports nested FlatBuffers.
Generates convenient accessors for the nested root.

Change-Id: Ic0b1531de7ace475ff2a7b1f430d27f41c838430
Tested: on Windows.
2014-07-21 16:40:39 -07:00
Wouter van Oortmerssen d1efa95369 The generated CreateX() calls now come with default values for args.
bug: 15777627
Change-Id: I9389de46ea883ab0ef1beab9370e5c8e96b4d0b5
Tested: on Windows and Linux
2014-07-10 17:26:28 -07:00
Wouter van Oortmerssen 75349ae8c3 Fixed incorrect verifier code for nested tables.
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.
2014-07-09 17:13:03 -07:00
Wouter van Oortmerssen 9140144d51 Added functionality to assign field ids manually in a schema
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
2014-07-08 11:12:33 -07:00
Wouter van Oortmerssen a0b6ffc25b Add buffer verification functionality to FlatBuffers
Bug: 15732628
Change-Id: I0b7cb65982d6b8957d5a899cca7d2b5d2ef53206
Tested: On Windows, OS X and Linux
2014-07-01 17:52:16 -07:00
Wouter van Oortmerssen 59043114ac Generated C++ headers now have include guards.
Bug: 15700355
Change-Id: Iceccb5b344e394e399092ffaa81f9cad2f0418ab
Tested: on Windows
2014-06-23 17:06:16 -07:00
Wouter van Oortmerssen 26a30738a4 Initial commit of the FlatBuffers code.
Change-Id: I4c9f0f722490b374257adb3fec63e44ae93da920
Tested: using VS2010 / Xcode / gcc on Linux.
2014-06-10 13:53:28 -07:00