X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=blobdiff_plain;f=tool%2Ftool.cpp;fp=tool%2Ftool.cpp;h=5f9febeedda26d87a749551de4035d7ee6e07a30;hp=4e6608766a8e7cbacb47900e337ba0c80436e6f6;hb=19179a622c1de88de5ed7047643eec79f285bf2a;hpb=e0af585ed57bdb5b1ea4f4a415fda13b5d99d2dc diff --git a/tool/tool.cpp b/tool/tool.cpp index 4e66087..5f9febe 100644 --- a/tool/tool.cpp +++ b/tool/tool.cpp @@ -15,11 +15,13 @@ DataTool::DataTool(int argc, char **argv): in_fn("-"), out_fn("-"), binary(false), - compile(false) + compile(false), + float_size(0) { GetOpt getopt; getopt.add_option('b', "binary", binary, GetOpt::NO_ARG); getopt.add_option('c', "compile", compile, GetOpt::NO_ARG); + getopt.add_option('f', "float-size", float_size, GetOpt::REQUIRED_ARG); getopt.add_option('o', "output", out_fn, GetOpt::REQUIRED_ARG); getopt(argc, argv); @@ -49,6 +51,8 @@ int DataTool::main() DataFile::Writer writer(out_buf); if(binary) writer.set_binary(true); + if(float_size) + writer.set_float_precision(float_size); if(compile) {