mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 13:00:00 +00:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user