blob: 2e081f37f50e2af24dc4d5b79f7ccea3c9e829d2 [file] [log] [blame]
James Kuszmaulf5eb4682023-09-22 17:16:59 -07001#include "flatbuffers/reflection_generated.h"
2
3#include "aos/flatbuffers.h"
4#include "aos/flatbuffers/static_flatbuffers.h"
5#include "aos/init.h"
6#include "aos/json_to_flatbuffer.h"
7#include "aos/util/file.h"
8
9DEFINE_string(reflection_bfbs, "", "Path to the .bfbs reflection file.");
10DEFINE_string(output_file, "", "Path to the output header to write.");
11
12namespace aos::fbs {
13int Main() {
14 aos::FlatbufferVector<reflection::Schema> schema =
15 aos::FileToFlatbuffer<reflection::Schema>(FLAGS_reflection_bfbs);
16 aos::util::WriteStringToFileOrDie(
17 FLAGS_output_file, GenerateCodeForRootTableFile(&schema.message()));
18 return EXIT_SUCCESS;
19}
20} // namespace aos::fbs
21int main(int argc, char *argv[]) {
22 aos::InitGoogle(&argc, &argv);
23 return aos::fbs::Main();
24}