mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 23:17:27 +00:00
The parser and flatc now allow include directories to be specified.
Bug: 17139854 Change-Id: I0eac65d054951e00a8811ad1d80ba8c37012dbf0 Tested: on Linux.
This commit is contained in:
@@ -268,9 +268,12 @@ class Parser {
|
||||
|
||||
// Parse the string containing either schema or JSON data, which will
|
||||
// populate the SymbolTable's or the FlatBufferBuilder above.
|
||||
// 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);
|
||||
// include_paths is used to resolve any include statements, and typically
|
||||
// should at least include the project path (where you loaded source_ from).
|
||||
// include_paths must be nullptr terminated if specified.
|
||||
// If include_paths is nullptr, it will attempt to load from the current
|
||||
// directory.
|
||||
bool Parse(const char *_source, const char **include_paths = nullptr);
|
||||
|
||||
// Set the root type. May override the one set in the schema.
|
||||
bool SetRootType(const char *name);
|
||||
@@ -320,6 +323,7 @@ class Parser {
|
||||
|
||||
std::vector<std::pair<Value, FieldDef *>> field_stack_;
|
||||
std::vector<uint8_t> struct_stack_;
|
||||
|
||||
std::map<std::string, bool> included_files_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user