Line | |
---|
1 | #include <fstream>
|
---|
2 | #include "helper.hxx"
|
---|
3 |
|
---|
4 | using namespace std;
|
---|
5 |
|
---|
6 | helper::helper( std::ifstream * in, std::ofstream * out)
|
---|
7 | {
|
---|
8 | infile = in;
|
---|
9 | outfile = out;
|
---|
10 | }
|
---|
11 |
|
---|
12 | void 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 |
|
---|
23 | void 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.