-
Notifications
You must be signed in to change notification settings - Fork 2
/
filter.go
44 lines (33 loc) · 843 Bytes
/
filter.go
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
package s9
import (
"bytes"
"os"
"github.com/baranovskis/bmd-converter/bmd"
)
type Filter struct {
bmd.BaseBmdAdapter // inherits methods
}
func (f *Filter) GetStruct() interface{} {
type bmdStruct struct {
Text string `csv:"text" size:"20"` // set fixed string size
}
return &bmdStruct{}
}
func (f *Filter) GetVersion(data *[]byte) (res int16, err error) {
return -1, nil
}
func (f *Filter) GetRowsCount(data *[]byte) (res int32, err error) {
return -1, nil
}
func (f *Filter) GetCrcValue(data *[]byte) (res int32, err error) {
return bmd.GetCrcValue(data)
}
func (f *Filter) SetVersion(file *os.File) error {
return nil
}
func (f *Filter) SetRowsCount(file *os.File, count int) error {
return nil
}
func (f *Filter) SetCrcValue(file *os.File, buff bytes.Buffer) error {
return bmd.SetCrcValue(file, buff, 0x3E7D)
}