#include <registry.h>
Definition at line 30 of file registry.h.
◆ AddIncludeDirectory()
void flatbuffers::Registry::AddIncludeDirectory |
( |
const char * |
path | ) |
|
|
inline |
Definition at line 92 of file registry.h.
92{ include_paths_.push_back(path); }
◆ FlatBufferToText()
bool flatbuffers::Registry::FlatBufferToText |
( |
const uint8_t * |
flatbuf, |
|
|
size_t |
len, |
|
|
std::string * |
dest |
|
) |
| |
|
inline |
Definition at line 44 of file registry.h.
45 {
46
47
49 {
50 lasterror_ = "buffer truncated";
51 return false;
52 }
53 std::string ident(reinterpret_cast<const char *>(flatbuf) + sizeof(uoffset_t),
55
57 if (!LoadSchema(ident, &parser))
58 return false;
59
61 {
62 lasterror_ = "unable to generate text for FlatBuffer binary";
63 return false;
64 }
65 return true;
66 }
static const size_t kFileIdentifierLength
The length of a FlatBuffer file header.
bool GenerateText(const Parser &parser, const void *flatbuffer, std::string *text)
References flatbuffers::GenerateText(), and flatbuffers::FlatBufferBuilder::kFileIdentifierLength.
◆ GetLastError()
const std::string & flatbuffers::Registry::GetLastError |
( |
| ) |
|
|
inline |
◆ Register()
void flatbuffers::Registry::Register |
( |
const char * |
file_identifier, |
|
|
const char * |
schema_path |
|
) |
| |
|
inline |
Definition at line 35 of file registry.h.
36 {
37 Schema schema;
38 schema.path_ = schema_path;
39 schemas_[file_identifier] = schema;
40 }
◆ SetOptions()
void flatbuffers::Registry::SetOptions |
( |
const IDLOptions & |
opts | ) |
|
|
inline |
◆ TextToFlatBuffer()
DetachedBuffer flatbuffers::Registry::TextToFlatBuffer |
( |
const char * |
text, |
|
|
const char * |
file_identifier |
|
) |
| |
|
inline |
Definition at line 71 of file registry.h.
72 {
73
75 if (!LoadSchema(file_identifier, &parser))
76 return DetachedBuffer();
77
79 {
80 lasterror_ =
parser.error_;
81 return DetachedBuffer();
82 }
83
84 return parser.builder_.Release();
85 }
The documentation for this class was generated from the following file: