-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilterTreeItem.go
More file actions
46 lines (40 loc) · 801 Bytes
/
filterTreeItem.go
File metadata and controls
46 lines (40 loc) · 801 Bytes
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
package main
import "io"
type filterTreeItem struct {
Left int32
Right int32
Item int32
Or bool
}
func (h *filterTreeItem) loadV6(r io.Reader) {
h.Left = getInt32(r)
h.Right = getInt32(r)
h.Item = getInt32(r)
h.Or = getDword(r) != 0
}
func (h *filterTreeItem) saveV6(w io.Writer) {
saveInt32(w, h.Left)
saveInt32(w, h.Right)
saveInt32(w, h.Item)
uOr := uint32(0)
if h.Or {
uOr = 1
}
saveDword(w, uOr)
}
func (h *filterTreeItem) load(r io.Reader) {
h.Left = int32(unzipDwordBE(r))
h.Right = int32(unzipDwordBE(r))
h.Item = int32(unzipDwordBE(r))
h.Or = getByteBool(r)
}
func (h *filterTreeItem) save(w io.Writer) {
zipDwordBE(w, i2u32(h.Left))
zipDwordBE(w, i2u32(h.Right))
zipDwordBE(w, i2u32(h.Item))
uOr := uint32(0)
if h.Or {
uOr = 1
}
zipDwordBE(w, uOr)
}