Implemented the file identifier functionality for Java.

Also fixed flatc not outputting these identifiers for files
compiled on the command-line.

Bug: 16983987
Change-Id: I8b714cfea3a8e144fa52133f62b2f7eda6eb044a
Tested: on Linux
This commit is contained in:
Wouter van Oortmerssen
2014-09-04 16:31:44 -07:00
parent 96592d5dbb
commit 09a2999c66
16 changed files with 113 additions and 17 deletions

View File

@@ -914,7 +914,8 @@ bool Parser::Parse(const char *source, const char *filepath) {
if (builder_.GetSize()) {
Error("cannot have more than one json object in a file");
}
builder_.Finish(Offset<Table>(ParseTable(*root_struct_def)));
builder_.Finish(Offset<Table>(ParseTable(*root_struct_def)),
file_identifier_.length() ? file_identifier_.c_str() : nullptr);
} else if (token_ == kTokenEnum) {
ParseEnum(false);
} else if (token_ == kTokenUnion) {