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
crate::ix!();
pub struct FlatFilePos {
pub n_file: i32,
pub n_pos: u32,
}
lazy_static!{
}
impl Default for FlatFilePos {
fn default() -> Self {
Self {
n_file: -1,
n_pos: 0,
}
}
}
impl PartialEq<FlatFilePos> for FlatFilePos {
#[inline] fn eq(&self, other: &FlatFilePos) -> bool {
self.n_file == other.n_file
&& self.n_pos == other.n_pos
}
}
impl Eq for FlatFilePos {}
impl FlatFilePos {
pub fn new(
n_file_in: i32,
n_pos_in: u32) -> Self {
Self {
n_file: n_file_in,
n_pos: n_pos_in,
}
}
pub fn set_null(&mut self) {
self.n_file = -1;
self.n_pos = 0;
}
pub fn is_null(&self) -> bool {
self.n_file == -1
}
pub fn to_string(&self) -> String {
format!{
"FlatFilePos(nFile={}, nPos={})",
self.n_file,
self.n_pos
}
}
}