[C++] Split flatbuffers.h into separate files (#6868)

* split flatbuffers.h into separate files

* wrong variable in cmakelists for android

* readded two accidentally deleted includes

* created buffer.h and moved buffer related things over
This commit is contained in:
Derek Bailey
2021-11-10 22:26:09 -08:00
committed by GitHub
parent fd4ff23da0
commit 6c8c291559
21 changed files with 3218 additions and 2810 deletions

View File

@@ -17,6 +17,7 @@
#ifndef FLATBUFFERS_REGISTRY_H_
#define FLATBUFFERS_REGISTRY_H_
#include "flatbuffers/base.h"
#include "flatbuffers/idl.h"
namespace flatbuffers {
@@ -40,13 +41,13 @@ class Registry {
bool FlatBufferToText(const uint8_t *flatbuf, size_t len, std::string *dest) {
// Get the identifier out of the buffer.
// If the buffer is truncated, exit.
if (len < sizeof(uoffset_t) + FlatBufferBuilder::kFileIdentifierLength) {
if (len < sizeof(uoffset_t) + kFileIdentifierLength) {
lasterror_ = "buffer truncated";
return false;
}
std::string ident(
reinterpret_cast<const char *>(flatbuf) + sizeof(uoffset_t),
FlatBufferBuilder::kFileIdentifierLength);
kFileIdentifierLength);
// Load and parse the schema.
Parser parser;
if (!LoadSchema(ident, &parser)) return false;