| 23 | } |
| 24 | |
| 25 | int main(int argc, const char* argv[]) |
| 26 | { |
| 27 | fmt::print("<!-- FORMATSSTART -->\n"); |
| 28 | fmt::print( |
| 29 | "<!-- This section is automatically generated. Do not edit. -->\n"); |
| 30 | fmt::print("\n"); |
| 31 | fmt::print("| Profile | Format | Read? | Write? | Filesystem? |\n"); |
| 32 | fmt::print("|:--------|:-------|:-----:|:------:|:------------|\n"); |
| 33 | |
| 34 | for (auto [name, config] : formats) |
| 35 | { |
| 36 | if (config->is_extension()) |
| 37 | continue; |
| 38 | |
| 39 | std::set<std::string> filesystems; |
| 40 | auto addFilesystem = [&](const FilesystemProto& fs) |
| 41 | { |
| 42 | if (fs.type() != FilesystemProto::NOT_SET) |
| 43 | { |
| 44 | const auto* descriptor = |
| 45 | FilesystemProto::FilesystemType_descriptor(); |
| 46 | auto name = |
| 47 | (std::string)descriptor->FindValueByNumber(fs.type()) |
| 48 | ->name(); |
| 49 | |
| 50 | filesystems.insert(name); |
| 51 | } |
| 52 | }; |
| 53 | |
| 54 | addFilesystem(config->filesystem()); |
| 55 | for (const auto& group : config->option_group()) |
| 56 | { |
| 57 | for (const auto& option : group.option()) |
| 58 | addFilesystem(option.config().filesystem()); |
| 59 | } |
| 60 | for (const auto& option : config->option()) |
| 61 | addFilesystem(option.config().filesystem()); |
| 62 | |
| 63 | std::stringstream ss; |
| 64 | for (auto& fs : filesystems) |
| 65 | ss << fs << " "; |
| 66 | |
| 67 | fmt::print("| [`{0}`](doc/disk-{0}.md) | {1} | {2} | {3} | {4} |\n", |
| 68 | name, |
| 69 | config->shortname() + ": " + config->comment(), |
| 70 | supportStatus(config->read_support_status()), |
| 71 | supportStatus(config->write_support_status()), |
| 72 | ss.str()); |
| 73 | } |
| 74 | |
| 75 | std::cout << "{: .datatable }\n\n"; |
| 76 | return 0; |
| 77 | } |
nothing calls this directly
no test coverage detected