github.com/shakinm/xlsReader@v0.9.12/xls/record/blank.go (about) 1 package record 2 3 import ( 4 "github.com/shakinm/xlsReader/helpers" 5 "reflect" 6 ) 7 8 //BLANK: Cell Value, Blank Cell 9 10 var BlankRecord = []byte{0x01, 0x02} //(201h) 11 12 /* 13 A BLANK record describes an empty cell. The rw field contains the 0-based row 14 number. The col field contains the 0-based column number. 15 16 Record Data 17 Offset Name Size Contents 18 -------------------------------------------- 19 4 rw 2 Row 20 6 col 2 Column 21 8 ixfe 2 Index to the XF record 22 */ 23 24 type Blank struct { 25 rw [2]byte 26 col [2]byte 27 ixfe [2]byte 28 } 29 30 func (r *Blank) GetRow() [2]byte { 31 return r.rw 32 } 33 34 func (r *Blank) GetCol() [2]byte { 35 return r.col 36 } 37 38 func (r *Blank) Read(stream []byte) { 39 copy(r.rw[:], stream[:2]) 40 copy(r.col[:], stream[2:4]) 41 copy(r.ixfe[:], stream[4:6]) 42 } 43 44 func (r *Blank) GetString() (str string) { 45 return str 46 } 47 48 func (r *Blank) GetFloat64() (fl float64) { 49 return fl 50 } 51 func (r *Blank) GetInt64() (in int64) { 52 return in 53 } 54 55 func (r *Blank) GetType() string { 56 return reflect.TypeOf(r).String() 57 } 58 59 func (r *Blank) GetXFIndex() int { 60 return int(helpers.BytesToUint16(r.ixfe[:])) 61 } 62 63 func (r *Blank) Get() *Blank { 64 return r 65 }