+ delete writer;
+ delete out;
+}
+
+void DataTool::do_pack()
+{
+ Packer packer(*this);
+ for(vector<string>::const_iterator i=in_fns.begin(); i!=in_fns.end(); ++i)
+ packer.pack_file(*i);
+ packer.create_pack(out_fn);
+}
+
+IO::Base *DataTool::open_output(const string &fn)
+{
+ if(fn=="-")
+ return new IO::Buffered(IO::cout);
+ else
+ return new IO::BufferedFile(fn, IO::M_WRITE);
+}
+
+IO::Base *DataTool::open_input(const string &fn)
+{
+ if(fn=="-")
+ return new IO::Buffered(IO::cin);
+ else
+ return new IO::BufferedFile(fn, IO::M_READ);