The parser and flatc now allow include directories to be specified.

Bug: 17139854
Change-Id: I0eac65d054951e00a8811ad1d80ba8c37012dbf0
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2014-09-11 17:13:21 -07:00
parent cb58fc6fa1
commit e57b86bb9f
10 changed files with 77 additions and 35 deletions

View File

@@ -37,8 +37,9 @@ int main(int /*argc*/, const char * /*argv*/[]) {
// parse schema first, so we can use it to parse the data after
flatbuffers::Parser parser;
ok = parser.Parse(schemafile.c_str(), "samples/") &&
parser.Parse(jsonfile.c_str(), "samples/");
const char *include_directories[] = { "samples", nullptr };
ok = parser.Parse(schemafile.c_str(), include_directories) &&
parser.Parse(jsonfile.c_str(), include_directories);
assert(ok);
// here, parser.builder_ contains a binary buffer that is the parsed data.