Replace filenames in reflection with filenames+includes. (#6703)

* Replace filenames in reflection with filenames+includes.

This is needed for some use cases and may be just useful metadata.

* deser files_included_per_file_

* check project_root

* fix bazel

* git clang format

Co-authored-by: Casper Neo <cneo@google.com>
This commit is contained in:
Casper
2021-06-19 19:21:33 -04:00
committed by GitHub
parent acce4ac3f0
commit 06fd6d640c
8 changed files with 802 additions and 657 deletions

View File

@@ -116,6 +116,16 @@ enum AdvancedFeatures : ulong (bit_flags) {
DefaultVectorsAndStrings,
}
/// File specific information.
/// Symbols declared within a file may be recovered by iterating over all
/// symbols and examining the `declaration_file` field.
table SchemaFile {
/// Filename, relative to project root.
filename:string (required, key);
/// Names of included files, relative to project root.
included_filenames:[string];
}
table Schema {
objects:[Object] (required); // Sorted.
enums:[Enum] (required); // Sorted.
@@ -126,7 +136,7 @@ table Schema {
advanced_features:AdvancedFeatures;
/// All the files used in this compilation. Files are relative to where
/// flatc was invoked.
fbs_files:[string];
fbs_files:[SchemaFile]; // Sorted.
}
root_type Schema;