#include <registry.h>
Definition at line 29 of file registry.h.
◆ AddIncludeDirectory()
| void flatbuffers::Registry::AddIncludeDirectory |
( |
const char * |
path | ) |
|
|
inline |
Definition at line 86 of file registry.h.
86{ include_paths_.push_back(path); }
◆ FlatBufferToText()
| bool flatbuffers::Registry::FlatBufferToText |
( |
const uint8_t * |
flatbuf, |
|
|
size_t |
len, |
|
|
std::string * |
dest |
|
) |
| |
|
inline |
Definition at line 41 of file registry.h.
41 {
42
43
44 if (len < sizeof(uoffset_t) + kFileIdentifierLength) {
45 lasterror_ = "buffer truncated";
46 return false;
47 }
48 std::string ident(
49 reinterpret_cast<const char *>(flatbuf) + sizeof(uoffset_t),
50 kFileIdentifierLength);
51
53 if (!LoadSchema(ident, &parser)) return false;
54
55 auto err =
GenText(parser, flatbuf, dest);
56 if (err) {
57 lasterror_ =
58 "unable to generate text for FlatBuffer binary: " + std::string(err);
59 return false;
60 }
61 return true;
62 }
const char * GenText(const Parser &parser, const void *flatbuffer, std::string *text)
References flatbuffers::GenText().
◆ 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 33 of file registry.h.
33 {
34 Schema schema;
35 schema.path_ = schema_path;
36 schemas_[file_identifier] = schema;
37 }
◆ 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 67 of file registry.h.
68 {
69
71 if (!LoadSchema(file_identifier, &parser)) return DetachedBuffer();
72
74 lasterror_ =
parser.error_;
75 return DetachedBuffer();
76 }
77
78 return parser.builder_.Release();
79 }
The documentation for this class was generated from the following file: