| 41 | } |
| 42 | |
| 43 | bool ParseFile(flatbuffers::Parser *parser, const std::string &filename, |
| 44 | const std::string &contents) { |
| 45 | std::vector<const char *> include_directories; |
| 46 | auto local_include_directory = flatbuffers::StripFileName(filename); |
| 47 | include_directories.push_back(local_include_directory.c_str()); |
| 48 | include_directories.push_back(nullptr); |
| 49 | if (!parser->Parse(contents.c_str(), include_directories.data(), |
| 50 | filename.c_str())) { |
| 51 | fprintf(stderr, "Failed to parse flatbuffer schema '%s'\n", |
| 52 | contents.c_str()); |
| 53 | return false; |
| 54 | } |
| 55 | return true; |
| 56 | } |
| 57 | |
| 58 | // Checks to make sure current schema in current code does not cause an |
| 59 | // incompatibility. |