mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-12 07:50:59 +00:00
Schemas now support include files.
Bug: 15521443 Change-Id: I2e1ef97e7225a1a0ecf2ca65e31d49d443003747 Tested: on Linux.
This commit is contained in:
@@ -249,11 +249,16 @@ class Parser {
|
||||
|
||||
// Parse the string containing either schema or JSON data, which will
|
||||
// populate the SymbolTable's or the FlatBufferBuilder above.
|
||||
bool Parse(const char *_source);
|
||||
// filepath indicates the file that _source was loaded from, it is
|
||||
// used to resolve any include statements.
|
||||
bool Parse(const char *_source, const char *filepath);
|
||||
|
||||
// Set the root type. May override the one set in the schema.
|
||||
bool SetRootType(const char *name);
|
||||
|
||||
// Mark all definitions as already having code generated.
|
||||
void MarkGenerated();
|
||||
|
||||
private:
|
||||
void Next();
|
||||
bool IsNext(int t);
|
||||
@@ -295,6 +300,7 @@ class Parser {
|
||||
|
||||
std::vector<std::pair<Value, FieldDef *>> field_stack_;
|
||||
std::vector<uint8_t> struct_stack_;
|
||||
std::map<std::string, bool> included_files_;
|
||||
};
|
||||
|
||||
// Utility functions for generators:
|
||||
|
||||
Reference in New Issue
Block a user