uop

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFormat = errors.New("invalid UOP file format")
	ErrInvalidIndex  = errors.New("invalid index")
	ErrReaderClosed  = errors.New("uop reader is closed")
	ErrEntryNotFound = errors.New("entry not found")
	ErrInvalidEntry  = errors.New("invalid entry")
)

Standard UOP format errors

Functions

This section is empty.

Types

type CompressionType

type CompressionType int16

CompressionType represents the compression method used for a UOP entry

const (
	CompressionNone   CompressionType = 0
	CompressionZlib   CompressionType = 1
	CompressionMythic CompressionType = 2
)

Compression flag constants

type Entry

type Entry = interface {
	io.ReaderAt
	Len() int
	Extra() uint64
}

type Entry6D

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

Entry6D represents an entry in UOP files with 6 components including compression info

type Option

type Option func(*Reader)

Option defines a function that configures a Reader.

func WithExtension

func WithExtension(ext string) Option

WithExtension sets the file extension for the pattern.

func WithExtra

func WithExtra() Option

WithExtra sets a flag to indicate if extra data is present in the entries.

func WithLength added in v0.0.6

func WithLength(length int) Option

WithLength sets the length of the index.

func WithStrict

func WithStrict() Option

WithStrict sets a flag to indicate if the reader should perform strict entry validation.

type Reader

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

Reader implements the interface for reading UOP files

func Open

func Open(filename string, length int, options ...Option) (*Reader, error)

Open creates a new UOP file reader

func (*Reader) Close

func (r *Reader) Close() error

Close releases resources

func (*Reader) Entries

func (r *Reader) Entries() iter.Seq[uint32]

Entries returns an iterator over available entry indices

func (*Reader) Entry

func (r *Reader) Entry(key uint32) (Entry, error)

Entry returns an entry reader

Jump to

Keyboard shortcuts

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