3 This file is part of libmspdatafile
4 Copyright © 2008 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #include <msp/core/getopt.h>
9 #include <msp/io/buffered.h>
10 #include <msp/io/console.h>
11 #include <msp/io/file.h>
12 #include <msp/datafile/parser.h>
13 #include <msp/datafile/statement.h>
14 #include <msp/datafile/writer.h>
20 DataTool::DataTool(int argc, char **argv):
25 getopt.add_option('o', "output", out_fn, GetOpt::REQUIRED_ARG);
26 getopt.add_option('b', "binary", binary, GetOpt::NO_ARG);
29 const vector<string> &args=getopt.get_args();
40 in=new IO::File(in_fn);
46 out=new IO::File(out_fn, IO::M_WRITE);
49 IO::Buffered in_buf(*in);
50 DataFile::Parser parser(in_buf, in_fn);
51 IO::Buffered out_buf(*out);
52 DataFile::Writer writer(out_buf);
54 writer.set_binary(true);
58 DataFile::Statement st=parser.parse();
75 Application::RegApp<DataTool> DataTool::reg;