17 #include "fltHeader.h"
28 set_program_brief(
"describe the contents of a MultiGen .flt file");
29 set_program_description
30 (
"This program reads a MultiGen OpenFlight (.flt) file and reports "
31 "some interesting things about its contents.");
34 add_runline(
"[opts] input.flt");
38 "List the hierarchy in the flt file.",
39 &FltInfo::dispatch_none, &_list_hierarchy);
52 nout << "Reading " << _input_filename << "\n";
53 FltError result = header->read_flt(_input_filename);
54 if (result != FE_ok) {
55 nout <<
"Unable to read: " << result <<
"\n";
59 if (header->check_version()) {
60 nout <<
"Version is " << header->get_flt_version() / 100.0 <<
"\n";
63 if (_list_hierarchy) {
64 list_hierarchy(header, 0);
75 list_hierarchy(
FltRecord *record,
int indent_level) {
77 record->
write(cout, indent_level);
89 nout <<
"You must specify the .flt file to read on the command line.\n";
92 }
else if (args.size() != 1) {
93 nout <<
"You must specify only one .flt file to read on the command line.\n";
97 _input_filename = args[0];
103 int main(
int argc,
char *argv[]) {
virtual void parse_command_line(int argc, char **argv)
Dispatches on each of the options on the command line, and passes the remaining parameters to handle_...
The base class for all kinds of records in a MultiGen OpenFlight file.
virtual void write(ostream &out, int indent_level=0) const
Writes a multiple-line description of the record and all of its children.
A program to read a flt file and report interesting things about it.