Refactor FlatC to receive FlatCOptions (#7770)

* Refactor FlatC to receive `FlatCOptions`

* switch to c++11 unique_ptr
This commit is contained in:
Derek Bailey
2023-01-08 13:29:00 -08:00
committed by GitHub
parent 5638a6a900
commit 641fbe4658
4 changed files with 222 additions and 145 deletions

View File

@@ -158,5 +158,11 @@ int main(int argc, const char *argv[]) {
params.error_fn = Error;
flatbuffers::FlatCompiler flatc(params);
return flatc.Compile(argc, argv);
// Create the FlatC options by parsing the command line arguments.
const flatbuffers::FlatCOptions &options =
flatc.ParseFromCommandLineArguments(argc, argv);
// Compile with the extracted FlatC options.
return flatc.Compile(options);
}