lsgo/const.go
lordwelch 2f87df40d6 Move LSF and LSB decoding into their own packages
Adapt format.go from the image package
Change the only package level state variable to a function parameter
Load entire files into memory for performance
2021-01-06 01:08:20 -08:00

58 lines
1.1 KiB
Go

package lsgo
import (
"errors"
"fmt"
)
type FileVersion uint32
const (
// Initial version of the LSF format
VerInitial FileVersion = iota + 1
// LSF version that added chunked compression for substreams
VerChunkedCompress
// LSF version that extended the node descriptors
VerExtendedNodes
// BG3 version, no changes found so far apart from version numbering
VerBG3
// Latest version supported by this library
MaxVersion = iota
)
type CompressionMethod int
const (
CMInvalid CompressionMethod = iota - 1
CMNone
CMZlib
CMLZ4
)
type CompressionLevel int
const (
FastCompression CompressionLevel = 0x10
DefaultCompression CompressionLevel = 0x20
MaxCompression CompressionLevel = 0x40
)
var (
ErrVectorTooBig = errors.New("the vector is too big cannot marshal to an xml element")
ErrInvalidNameKey = errors.New("invalid name key")
ErrKeyDoesNotMatch = errors.New("key for this node does not match")
)
type HeaderError struct {
Expected []byte
Got []byte
}
func (he HeaderError) Error() string {
return fmt.Sprintf("Invalid LSF signature; expected %v, got %v", he.Expected, he.Got)
}