repdecoder

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package repdecoder implements decoding StarCraft Brood War replay files (*.rep).

SC BW replays are basically divided into 2 types:

- modern (starting from 1.18)

- legacy (pre 1.18)

The type detection and utilization of the proper decoder is automatic and transparent to the package user.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMismatchedSection is returned if the section size is not the expected one
	ErrMismatchedSection = errors.New("mismatched section")
)

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	// NewSection must be called between sections.
	NewSection() error

	// Section decodes a section of the given size.
	Section(size int32) (data []byte, err error)

	// Close closes the decoder, releases any associated resources.
	io.Closer
}

Decoder wraps a Section method for decoding a section of a given size.

func New

func New(repData []byte) Decoder

New creates a new Decoder that reads and decompresses data from the given byte slice.

func NewFromFile

func NewFromFile(name string) (d Decoder, err error)

NewFromFile creates a new Decoder that reads and decompresses data form a file.

Jump to

Keyboard shortcuts

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