Repository navigation
Expand file tree
/
Copy pathblockstore.cpp
More file actions
87 lines (81 loc) · 1.83 KB
/
Copy pathblockstore.cpp
File metadata and controls
87 lines (81 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include <QDebug>
#include "blockstore.h"
#include "tapedrive.h"
// --------------------------------------------------------------------------
TapeChunk::TapeChunk(long b, long e)
{
beg = b;
end = e;
len = e-b+1;
crc_tape = 0;
crc_data = 0;
hpar_tape = 0;
hpar_data = 0;
fixed = 0;
type = C_NONE;
format = F_NONE;
bytes = 0;
data = NULL;
vpar_err_count = 0;
hpar_err_count = 0;
}
// --------------------------------------------------------------------------
TapeChunk::~TapeChunk()
{
delete[] data;
}
// --------------------------------------------------------------------------
TapeChunk::TapeChunk(const TapeChunk &other)
{
beg = other.beg;
end = other.end;
len = other.len;
crc_tape = other.crc_tape;
hpar_tape = other.hpar_tape;
crc_data = other.crc_data;
hpar_data = other.hpar_data;
fixed = other.fixed;
type = other.type;
format = other.format;
bytes = other.bytes;
if (other.data) {
data = new quint16[bytes];
for (int i=0 ; i<bytes ; i++) {
data[i] = other.data[i];
}
} else {
data = NULL;
}
events = other.events;
hpar_err_count = other.hpar_err_count;
vpar_err_count = other.vpar_err_count;
}
// --------------------------------------------------------------------------
TapeChunk & TapeChunk::operator=(const TapeChunk &other)
{
beg = other.beg;
end = other.end;
len = other.len;
crc_tape = other.crc_tape;
hpar_tape = other.hpar_tape;
crc_data = other.crc_data;
hpar_data = other.hpar_data;
fixed = other.fixed;
type = other.type;
format = other.format;
bytes = other.bytes;
delete[] data;
if (other.data) {
data = new quint16[bytes];
for (int i=0 ; i<bytes ; i++) {
data[i] = other.data[i];
}
} else {
data = NULL;
}
events = other.events;
hpar_err_count = other.hpar_err_count;
vpar_err_count = other.vpar_err_count;
return *this;
}
// vim: tabstop=4 shiftwidth=4 autoindent