Versions in this module Expand all Collapse all v0 v0.1.0 Jan 6, 2021 Changes in this version + var ErrFormat = errors.New("lsgo: unknown format") + func RegisterFormat(name, magic string, decode func(io.ReadSeeker) (Resource, error)) + func SupportedFormat(signature []byte) bool type Resource + func Decode(r io.ReadSeeker) (Resource, string, error) v0.0.1 Jan 4, 2021 Changes in this version + var ErrInvalidNameKey = errors.New("invalid name key") + var ErrKeyDoesNotMatch = errors.New("key for this node does not match") + var ErrVectorTooBig = errors.New("the vector is too big cannot marshal to an xml element") + var LSFSignature = [4]byte + var Logger log.Logger = log.NewNopLogger() + func Decompress(compressed io.Reader, uncompressedSize int, compressionFlags byte, ...) io.ReadSeeker + func LimitReadSeeker(r io.ReadSeeker, n int64) io.ReadSeeker + func MakeCompressionFlags(method CompressionMethod, level CompressionLevel) int + func NewFilter(f map[string][]string, l log.Logger) log.Logger + func ReadCString(r io.Reader, length int) (string, error) + func ReadNames(r io.ReadSeeker) ([][]string, error) + type AttributeEntry struct + Long bool + NameHashTableIndex uint32 + NextAttributeIndex int32 + NodeIndex int32 + Offset uint32 + TypeAndLength uint32 + func (ae *AttributeEntry) Read(r io.ReadSeeker) error + func (ae AttributeEntry) Len() int + func (ae AttributeEntry) NameIndex() int + func (ae AttributeEntry) NameOffset() int + func (ae AttributeEntry) TypeID() DataType + type AttributeInfo struct + DataOffset uint + Length uint + NameIndex int + NameOffset int + NextAttributeIndex int + TypeID DataType + V2 bool + type CompressionLevel int + const DefaultCompression + const FastCompression + const MaxCompression + func CompressionFlagsToLevel(flags byte) CompressionLevel + type CompressionMethod int + const CMInvalid + const CMLZ4 + const CMNone + const CMZlib + func CompressionFlagsToMethod(flags byte) CompressionMethod + type DataType int + const DTBool + const DTByte + const DTDouble + const DTFixedString + const DTFloat + const DTIVec2 + const DTIVec3 + const DTIVec4 + const DTInt + const DTInt64 + const DTInt8 + const DTLSString + const DTLSWString + const DTLong + const DTMat2 + const DTMat3 + const DTMat3x4 + const DTMat4 + const DTMat4x3 + const DTMax + const DTNone + const DTPath + const DTScratchBuffer + const DTShort + const DTString + const DTTranslatedFSString + const DTTranslatedString + const DTUInt + const DTULongLong + const DTUShort + const DTUUID + const DTVec2 + const DTVec3 + const DTVec4 + const DTWString + func (dt *DataType) MarshalXMLAttr(name xml.Name) (xml.Attr, error) + func (dt DataType) GetColumns() (int, error) + func (dt DataType) GetRows() (int, error) + func (dt DataType) String() string + type FileVersion uint32 + const MaxVersion + const VerBG3 + const VerChunkedCompress + const VerExtendedNodes + const VerInitial + type HeaderError struct + Expected []byte + Got []byte + func (he HeaderError) Error() string + type IdentifierDictionary map[int]string + func ReadLSBDictionary(r io.ReadSeeker, endianness binary.ByteOrder) (IdentifierDictionary, error) + type Ivec []int + func (i Ivec) String() string + type LSBHeader struct + Endianness uint32 + Signature [4]byte + Size uint32 + Unknown uint32 + Version LSMetadata + func (lsbh *LSBHeader) Read(r io.ReadSeeker) error + type LSFHeader struct + AttributesSizeOnDisk uint32 + AttributesUncompressedSize uint32 + CompressionFlags byte + EngineVersion uint32 + Extended uint32 + NodesSizeOnDisk uint32 + NodesUncompressedSize uint32 + Signature [4]byte + StringsSizeOnDisk uint32 + StringsUncompressedSize uint32 + Unknown2 byte + Unknown3 uint16 + ValuesSizeOnDisk uint32 + ValuesUncompressedSize uint32 + Version FileVersion + func (lsfh *LSFHeader) Read(r io.ReadSeeker) error + func (lsfh LSFHeader) IsCompressed() bool + type LSMetadata struct + Build uint32 + Major uint32 + Minor uint32 + Revision uint32 + Timestamp uint64 + type LimitedReadSeeker struct + N int64 + R io.ReadSeeker + func (l *LimitedReadSeeker) Read(p []byte) (n int, err error) + func (l *LimitedReadSeeker) Seek(offset int64, whence int) (int64, error) + type Mat mat.Dense + func (m Mat) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type Node struct + Attributes []NodeAttribute + Children []*Node + Name string + Parent *Node + RegionName string + func ReadNode(r io.ReadSeeker, ni NodeInfo, names [][]string, attributeInfo []AttributeInfo, ...) (Node, error) + func ReadRegions(r io.ReadSeeker, names [][]string, nodeInfo []NodeInfo, ...) ([]*Node, error) + func (n *Node) AppendChild(child *Node) + func (n Node) ChildCount() (sum int) + func (n Node) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type NodeAttribute struct + Name string + Type DataType + Value interface{} + func ReadAttribute(r io.ReadSeeker, name string, DT DataType, length uint, l log.Logger) (NodeAttribute, error) + func ReadLSBAttr(r io.ReadSeeker, name string, dt DataType, endianness binary.ByteOrder, ...) (NodeAttribute, error) + func ReadLSFAttribute(r io.ReadSeeker, name string, dt DataType, length uint, version FileVersion, ...) (NodeAttribute, error) + func (na *NodeAttribute) FromString(str string) error + func (na NodeAttribute) GetColumns() (int, error) + func (na NodeAttribute) GetRows() (int, error) + func (na NodeAttribute) IsNumeric() bool + func (na NodeAttribute) MarshalXML(e *xml.Encoder, start xml.StartElement) error + func (na NodeAttribute) String() string + type NodeEntry struct + FirstAttributeIndex int32 + Long bool + NameHashTableIndex uint32 + NextSiblingIndex int32 + ParentIndex int32 + func (ne *NodeEntry) Read(r io.ReadSeeker) error + func (ne NodeEntry) NameIndex() int + func (ne NodeEntry) NameOffset() int + type NodeInfo struct + FirstAttributeIndex int + NameIndex int + NameOffset int + ParentIndex int + type Resource struct + Metadata LSMetadata + Regions []*Node + func ReadLSB(r io.ReadSeeker) (Resource, error) + func ReadLSBRegions(r io.ReadSeeker, d IdentifierDictionary, endianness binary.ByteOrder, ...) (Resource, error) + func ReadLSF(r io.ReadSeeker) (Resource, error) + func (r *Resource) Read(io.Reader) + type TranslatedFSString struct + Arguments []TranslatedFSStringArgument + func ReadTranslatedFSString(r io.ReadSeeker, version FileVersion) (TranslatedFSString, error) + type TranslatedFSStringArgument struct + Key string + String TranslatedFSString + Value string + type TranslatedString struct + Handle string + Value string + Version uint16 + func ReadTranslatedString(r io.ReadSeeker, version FileVersion, engineVersion uint32) (TranslatedString, error) + func (ts TranslatedString) MarshalXML(e *xml.Encoder, start *xml.StartElement) error + type Vec []float64 + func (v Vec) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type XMLMarshaler interface + MarshalXML func(e *xml.Encoder, start *xml.StartElement) error