Packer::Packer(DataTool &t):
tool(t),
tmp_file(tempfile()),
- tmp_buf(new IO::Buffered(*tmp_file)),
dir_alloc(0)
{ }
-IO::File *Packer::tempfile()
+IO::BufferedFile *Packer::tempfile()
{
FS::Path tmpdir;
const char *tmp_env = getenv("TMPDIR");
try
{
FS::Path filename = tmpdir/format("mspdatatool.%d", i);
- IO::File *file = new IO::File(filename.str(), IO::M_RDWR, IO::File::C_NEW);
+ IO::BufferedFile *file = new IO::BufferedFile(filename.str(), IO::M_RDWR, IO::File::C_NEW);
FS::unlink(filename.str());
return file;
}
Packer::~Packer()
{
- delete tmp_buf;
delete tmp_file;
}
if(raw)
transfer_raw(in, *tmp_file);
else
- {
- transfer_datafile(in, fn, *tmp_buf, objects);
- tmp_buf->flush();
- }
+ transfer_datafile(in, fn, *tmp_file, objects);
unsigned length = tmp_file->tell()-offset;
typedef std::list<Object> ObjectList;
DataTool &tool;
- Msp::IO::File *tmp_file;
- Msp::IO::Buffered *tmp_buf;
+ Msp::IO::BufferedFile *tmp_file;
std::list<Msp::DataFile::Statement> directory;
unsigned dir_alloc;
public:
Packer(DataTool &);
private:
- static Msp::IO::File *tempfile();
+ static Msp::IO::BufferedFile *tempfile();
public:
~Packer();