pfs

package
v1.4.220 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 9 Imported by: 2

Documentation

Overview

eqg is a pfs archive for EverQuest

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileEntry

type FileEntry struct {
	// contains filtered or unexported fields
}

FileEntry represents a file entry in a Pfs

func NewFileEntry

func NewFileEntry(name string, data []byte) *FileEntry

NewFileEntry creates a new file entry

func (*FileEntry) Data

func (e *FileEntry) Data() []byte

Data returns the data of the file entry

func (*FileEntry) Name

func (e *FileEntry) Name() string

Name returns the name of the file entry

func (*FileEntry) SetData

func (e *FileEntry) SetData(data []byte) error

SetData sets the data of the file entry

func (*FileEntry) SetName

func (e *FileEntry) SetName(name string) error

SetName sets the name of the file entry

type FilerByCRC

type FilerByCRC []*FileEntry

FilerByCRC sorts a slice of Filer by CRC32

func (FilerByCRC) Len

func (s FilerByCRC) Len() int

Len returns the length of the slice

func (FilerByCRC) Less

func (s FilerByCRC) Less(i, j int) bool

Less returns true if the CRC32 of the first element is less than the second

func (FilerByCRC) Swap

func (s FilerByCRC) Swap(i, j int)

Swap swaps two elements in the slice

type FilerByName

type FilerByName []filer

FilerByName sorts a slice of Filer by name

func (FilerByName) Len

func (s FilerByName) Len() int

Len returns the length of the slice

func (FilerByName) Less

func (s FilerByName) Less(i, j int) bool

Less returns true if the name of the first element is less than the second

func (FilerByName) Swap

func (s FilerByName) Swap(i, j int)

Swap swaps two elements in the slice

type Pfs

type Pfs struct {
	ContentsSummary string
	// contains filtered or unexported fields
}

Pfs represents a modern everquest pfs archive

func New

func New(name string) (*Pfs, error)

New creates a new empty instance. Use NewFile to load an archive on creation

func NewFile

func NewFile(path string) (*Pfs, error)

NewFile takes path and loads it as an eqg archive

func (*Pfs) Add

func (e *Pfs) Add(name string, data []byte) error

Add adds a new entry to a eqg

func (*Pfs) Close

func (e *Pfs) Close() error

func (*Pfs) Extract

func (e *Pfs) Extract(path string) (string, error)

Extract places the pfs contents to path

func (*Pfs) File

func (e *Pfs) File(name string) ([]byte, error)

File returns data of a file

func (*Pfs) Files

func (e *Pfs) Files() []*FileEntry

Files returns a string array of every file inside an EQG

func (*Pfs) Len

func (e *Pfs) Len() int

func (*Pfs) Read

func (e *Pfs) Read(r io.ReadSeeker) error

Read will read a Pfs archive

func (*Pfs) Remove

func (e *Pfs) Remove(name string) error

Remove deletes an entry in an eqg, if any

func (*Pfs) Set

func (e *Pfs) Set(name string, data []byte) error

func (*Pfs) SetFile

func (e *Pfs) SetFile(name string, data []byte) error

func (*Pfs) Write

func (e *Pfs) Write(w io.WriteSeeker) error

Write will write a Pfs archive to w

Jump to

Keyboard shortcuts

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