A feature that officially supports nested FlatBuffers.

Generates convenient accessors for the nested root.

Change-Id: Ic0b1531de7ace475ff2a7b1f430d27f41c838430
Tested: on Windows.
This commit is contained in:
Wouter van Oortmerssen
2014-07-15 17:50:22 -07:00
parent 9143a93312
commit 3e201a99b2
8 changed files with 63 additions and 11 deletions

View File

@@ -262,15 +262,16 @@ public:
iterator end() { return iterator(Data(), length_); }
const_iterator end() const { return const_iterator(Data(), length_); }
// The raw data in little endian format. Use with care.
const uint8_t *Data() const {
return reinterpret_cast<const uint8_t *>(&length_ + 1);
}
protected:
// This class is only used to access pre-existing data. Don't ever
// try to construct these manually.
Vector();
const uint8_t *Data() const {
return reinterpret_cast<const uint8_t *>(&length_ + 1);
}
uoffset_t length_;
};