dat

package
v0.0.0-...-e659864 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FalloutDat

type FalloutDat interface {
	GetGame() uint8

	GetDirs() []FalloutDir

	GetDbg() dbg.Map

	// SetDbg adds various debug info
	//
	// If argument is `nil`, all data (including directories data) is cleared;
	// otherwise data is collected starting from currect stream position
	//
	//  - stream must be set to same position it was when reading DAT file
	//  - `cmd/fodat(dump)` can be used to display debug info
	SetDbg(io.Seeker) error
	// contains filtered or unexported methods
}

FalloutDat represents single .dat file

NOTE: Unstable interface

func Fallout1

func Fallout1(stream io.ReadSeeker) (dat1 FalloutDat, err error)

Fallout1 reads already opened stream as DAT1

func Fallout2

func Fallout2(stream io.ReadSeeker) (dat2 FalloutDat, err error)

Fallout2 reads already opened stream as DAT2

func Open

func Open(filename string) (osFile *os.File, dat FalloutDat, err error)

Open attempts to read .dat file with unspecified version as DAT2 or DAT1 (in that order)

On success, returns opened stream (required for extracting files data) and `FalloutDat` object.

type FalloutDir

type FalloutDir interface {
	GetParentDat() FalloutDat

	GetName() string // returns base name (NAME)
	GetPath() string // returns full path (DIR//NAME)

	GetFiles() []FalloutFile

	GetDbg() dbg.Map

	// SetDbg adds various debug info
	//
	// If argument is `nil`, all data (including files data) is cleared
	SetDbg(io.Seeker) error
}

FalloutDat represents single directory entry

NOTE: Unstable interface

type FalloutFile

type FalloutFile interface {
	GetParentDat() FalloutDat
	GetParentDir() FalloutDir

	GetName() string // returns base name (FILENAME.EXT)
	GetPath() string // returns full path (DIR/NAME/FILENAME.EXT)

	GetOffset() int64
	GetSizeReal() int64
	GetSizePacked() int64
	GetPacked() bool
	GetPackedMode() uint32

	GetBytesReal(io.ReadSeeker) ([]byte, error)
	GetBytesPacked(io.ReadSeeker) ([]byte, error)
	GetBytesUnpacked([]byte) ([]byte, error)

	GetDbg() dbg.Map

	// SetDbg adds various debug info
	//
	// If argument is `nil`, all data is cleared
	SetDbg(io.Seeker) error
}

FalloutFile represents a single file entry

NOTE: Unstable interface

Jump to

Keyboard shortcuts

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