source: fact/tools/pyscripts/sandbox/dneise/fact_compress/c++/helper.cpp@ 14962

Last change on this file since 14962 was 14268, checked in by neise, 12 years ago
evolving
File size: 802 bytes
Line 
1#include <fstream>
2#include "helper.hxx"
3
4using namespace std;
5
6helper::helper( std::ifstream * in, std::ofstream * out)
7{
8 infile = in;
9 outfile = out;
10}
11
12void helper::copy_ascii_header()
13{
14 // copy first 0x2d00 bytes to new file
15 const int ascii_header_size = 0x2d00;
16 char * memblock = new char [ascii_header_size];
17 infile->seekg(0, ios::beg);
18 infile->read(memblock, ascii_header_size);
19 outfile->write(memblock, ascii_header_size);
20 delete[] memblock;
21}
22
23void helper::copy_event_header()
24{
25 // copy binary header to new file
26 const int bin_header_size = 3390;
27 char * memblock = new char [bin_header_size];
28 event_header_start = infile->tellg();
29 infile->read(memblock, bin_header_size);
30 outfile->write(memblock, bin_header_size);
31 delete[] memblock;
32}
Note: See TracBrowser for help on using the repository browser.