lsgo/const.go

58 lines
1.1 KiB
Go
Raw Permalink Normal View History

2021-01-03 17:27:26 -08:00
package lsgo
2020-11-12 06:41:45 -08:00
import (
"errors"
"fmt"
)
2020-11-12 06:41:45 -08:00
type FileVersion uint32
const (
2020-11-26 02:16:40 -08:00
// Initial version of the LSF format
2020-11-12 06:41:45 -08:00
VerInitial FileVersion = iota + 1
2020-11-26 02:16:40 -08:00
// LSF version that added chunked compression for substreams
2020-11-12 06:41:45 -08:00
VerChunkedCompress
2020-11-26 02:16:40 -08:00
// LSF version that extended the node descriptors
2020-11-12 06:41:45 -08:00
VerExtendedNodes
2020-11-26 02:16:40 -08:00
// BG3 version, no changes found so far apart from version numbering
2020-11-12 06:41:45 -08:00
VerBG3
2020-11-26 02:16:40 -08:00
// Latest version supported by this library
2020-11-12 06:41:45 -08:00
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 (
2020-11-25 06:57:22 -08:00
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 string
Got []byte
}
func (he HeaderError) Error() string {
return fmt.Sprintf("Invalid LSF signature; expected % X, got % X", he.Expected, he.Got)
}