Documentation ¶
Overview ¶
Package rbxl implements a decoder and encoder for Roblox's binary file format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrXML = errors.New("unexpected XML format")
ErrXML indicates the unexpected detection of the legacy XML format.
Functions ¶
This section is empty.
Types ¶
type ChunkError ¶ added in v0.4.0
type ChunkError struct { // Index is the position of the chunk within the file. Index int // Sig is the signature of the chunk. Sig sig Cause error }
ChunkError indicates an error that occurred within a chunk.
func (ChunkError) Error ¶ added in v0.4.0
func (err ChunkError) Error() string
func (ChunkError) Unwrap ¶ added in v0.4.0
func (err ChunkError) Unwrap() error
type CodecError ¶ added in v0.4.0
type CodecError struct {
Cause error
}
CodecError wraps an error that occurred while encoding or decoding a binary format model.
func (CodecError) Error ¶ added in v0.4.0
func (err CodecError) Error() string
func (CodecError) Unwrap ¶ added in v0.4.0
func (err CodecError) Unwrap() error
type DataError ¶ added in v0.4.0
type DataError struct { // Offset is the byte offset where the error occurred. Offset int64 Cause error }
DataError wraps an error that occurred while encoding or decoding byte data.
type Decoder ¶
type Decoder struct { // Mode indicates which type of format is decoded. Mode Mode // If NoXML is true, then the decoder will not attempt to decode the legacy // XML format for backward compatibility. NoXML bool // If not nil, stats will be set while decoding. Stats *DecoderStats }
Decoder decodes a stream of bytes into an rbxfile.Root.
func (Decoder) Decode ¶
Decode reads data from r and decodes it into root according to the rbxl format.
func (Decoder) Decompress ¶ added in v0.4.0
Decompress reencodes the compressed chunks of the binary format as uncompressed. The format is decoded from r, then encoded to w.
Returns ErrXML if the the data is in the legacy XML format.
type DecoderStats ¶ added in v0.6.2
type DecoderStats struct { XML bool // Whether the format is XML. Version uint16 // Version of the format. ClassCount uint32 // Number of classes reported by the header. InstanceCount uint32 // Number of instances reported by the header. Chunks int // Total number of chunks. ChunkTypes map[string]int // Number of chunks per signature. }
DecoderStats contains statistics generated while decoding the format.
type Encoder ¶
type Encoder struct { // Mode indicates which type of format is encoded. Mode Mode // Uncompressed sets whether compression is forcibly disabled for all // chunks. Uncompressed bool }
Encoder encodes a rbxfile.Root into a stream of bytes.
type ValueError ¶ added in v0.4.0
ValueError is an error that is produced by a Value of a certain Type.
func (ValueError) Error ¶ added in v0.4.0
func (err ValueError) Error() string
func (ValueError) Unwrap ¶ added in v0.4.0
func (err ValueError) Unwrap() error