Documentation ¶
Overview ¶
Package mpq provides golang bindings to the StormLib library to read MPQ archives.
Example ¶
package main import ( "fmt" "io/ioutil" "github.com/nielsAD/gowarcraft3/file/mpq" ) func main() { archive, err := mpq.OpenArchive("./test.mpq") if err != nil { fmt.Println(err) return } defer archive.Close() hello, err := archive.Open("hello.txt") if err != nil { fmt.Println(err) return } raw, err := ioutil.ReadAll(hello) if err != nil { fmt.Println(err) return } fmt.Print(string(raw)) }
Output: Hello
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadFormat = errors.New("mpq: Bad format") ErrArchiveOpen = errors.New("mpq: Could not open archive") ErrArchiveClose = errors.New("mpq: Could not close archive") ErrFileOpen = errors.New("mpq: Could not open subfile") ErrFileClose = errors.New("mpq: Could not close subfile") ErrFileRead = errors.New("mpq: Could not read subfile") )
Errors
Functions ¶
This section is empty.
Types ¶
type Archive ¶
type Archive struct {
// contains filtered or unexported fields
}
Archive stores a handle to an opened MPQ archive
func OpenArchive ¶
OpenArchive opens fileName as MPQ archive
func (*Archive) StrongSigned ¶
StrongSigned checks and verifies the archive against its strong signature if present
func (*Archive) WeakSigned ¶
WeakSigned checks and verifies the archive against its weak signature if present
Click to show internal directories.
Click to hide internal directories.