biff

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTruncated = errors.New("biff: truncated record")

Functions

func DecodeRK

func DecodeRK(encoded uint32) float64

DecodeRK decodes an RK value (30-bit integer + 2 flags).

func ReadBIFF8String

func ReadBIFF8String(data []byte, pos int) (string, int, error)

ReadBIFF8String reads a BIFF8 Unicode string from data starting at pos. Returns the string and new position. Standard BIFF8 flag interpretation.

func ReadBIFF8StringBoundary

func ReadBIFF8StringBoundary(data []byte, pos int, boundaries []int) (string, int, error)

ReadBIFF8StringBoundary reads a BIFF8 Unicode string with CONTINUE boundary awareness. boundaries must be sorted in ascending order, or nil. Each CONTINUE boundary redeclares the compression flag (1 byte).

func ReadBIFF8StringBoundaryWPS added in v0.2.1

func ReadBIFF8StringBoundaryWPS(data []byte, pos int, boundaries []int) (string, int, error)

ReadBIFF8StringBoundaryWPS reads a BIFF8 Unicode string with WPS-compatible flag interpretation. Same boundary awareness as ReadBIFF8StringBoundary.

func ReadShortString

func ReadShortString(data []byte, pos int, unicode bool) (string, int, error)

ReadShortString reads a 1-byte length-prefixed string (BIFF2-7 sheets, BOUNDSHEET name).

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(data []byte) *Reader

func (*Reader) Bytes

func (r *Reader) Bytes(n int) ([]byte, error)

func (*Reader) Err

func (r *Reader) Err() error

func (*Reader) Next

func (r *Reader) Next() (*Record, error)

func (*Reader) NextSkipContinue

func (r *Reader) NextSkipContinue() (*Record, error)

NextSkipContinue returns next non-CONTINUE record, merging CONTINUE data.

func (*Reader) Pos

func (r *Reader) Pos() int

Pos returns current read position.

func (*Reader) Reset

func (r *Reader) Reset(data []byte)

func (*Reader) Seek

func (r *Reader) Seek(pos int)

Seek sets read position.

func (*Reader) U8

func (r *Reader) U8() (byte, error)

func (*Reader) U16

func (r *Reader) U16() (uint16, error)

func (*Reader) U32

func (r *Reader) U32() (uint32, error)

func (*Reader) U64

func (r *Reader) U64() (uint64, error)

type Record

type Record struct {
	Type RecordType
	Data []byte
}

type RecordType

type RecordType uint16
const (
	BOF        RecordType = 0x0809
	EOF        RecordType = 0x000A
	CONTINUE   RecordType = 0x003C
	DATEMODE   RecordType = 0x0022
	BOUNDSHEET RecordType = 0x0085
	SST        RecordType = 0x00FC
	LABELSST   RecordType = 0x00FD
	NUMBER     RecordType = 0x0203
	RK         RecordType = 0x027E
	MULRK      RecordType = 0x00BD
	BOOLERR    RecordType = 0x0205
	FORMULA    RecordType = 0x0006
	STRING     RecordType = 0x0207
	DIMENSION  RecordType = 0x0200
	ROW        RecordType = 0x0208
	XF         RecordType = 0x00E0
	FONT       RecordType = 0x0031
	FORMAT     RecordType = 0x041E
	LABEL      RecordType = 0x0204
	LABELRKY   RecordType = 0x00D6
	INDEX      RecordType = 0x020B
	DBCELL     RecordType = 0x00D7
	MERGECELLS RecordType = 0x00E5
)

func (RecordType) String

func (t RecordType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL