Added nested FlexBuffer parsing

Change-Id: I918b66eb5646d035e3aae675f745802eb54b03ea
This commit is contained in:
Wouter van Oortmerssen
2017-06-02 16:41:22 -07:00
parent 0a81eb6463
commit dddd0865cb
16 changed files with 326 additions and 22 deletions

View File

@@ -128,6 +128,16 @@ A description of how FlexBuffers are encoded is in the
[internals](Internals.md#flexbuffers) document.
# Nesting inside a FlatBuffer
You can mark a field as containing a FlexBuffer, e.g.
a:[ubyte] (flexbuffer);
A special accessor will be generated that allows you to access the root value
directly, e.g. `a_flexbuffer_root().AsInt64()`.
# Efficiency tips
* Vectors generally are a lot more efficient than maps, so prefer them over maps

View File

@@ -302,6 +302,9 @@ Current understood attributes:
(which must be a vector of ubyte) contains flatbuffer data, for which the
root type is given by `table_name`. The generated code will then produce
a convenient accessor for the nested FlatBuffer.
- `flexbuffer` (on a field): this indicates that the field
(which must be a vector of ubyte) contains flexbuffer data. The generated
code will then produce a convenient accessor for the FlexBuffer root.
- `key` (on a field): this field is meant to be used as a key when sorting
a vector of the type of table it sits in. Can be used for in-place
binary search.