Add new c++ helpers to ease usage of size prefixed FlatBuffers (#4626)

It was missing some helpers when we choose to use
size prefixed FlatBuffers.

* Add general helper : GetPrefixedSize
* Add generated helpers :
 * GetSizePrefixedXXX
 * VerfifySizePrefixedXXXBuffer
 * FinishSizePrefixedXXXBuffer
This commit is contained in:
desqaz
2018-02-22 18:19:08 +01:00
committed by Wouter van Oortmerssen
parent 19c81b11b3
commit 132e6a8220
8 changed files with 86 additions and 14 deletions

View File

@@ -2069,6 +2069,9 @@ inline const uint8_t *GetBufferStartFromRootPointer(const void *root) {
return nullptr;
}
/// @brief This return the prefixed size of a FlatBuffer.
inline uoffset_t GetPrefixedSize(const uint8_t* buf){ return ReadScalar<uoffset_t>(buf); }
// Base class for native objects (FlatBuffer data de-serialized into native
// C++ data structures).
// Contains no functionality, purely documentative.