Documentation
¶
Index ¶
- func DeleteFileByPath(parent *Dir, path string) bool
- func Detect(path string) (bool, error)
- func NameHashUTF16(name string) uint64
- func NameHashUTF8(name string) uint64
- func Pack(dirPath string, arcPath string) error
- func UniqueIDHash(fullName string) uint64
- func UnpackArc(arcPath, outDir string) error
- type Arc
- func (fs *Arc) CopyFile(srcPath, dstPath string) error
- func (fs *Arc) CreateFile(path string, data []byte) *File
- func (fs *Arc) DeleteFile(path string) bool
- func (fs *Arc) Dump(path string) error
- func (fs *Arc) GetFile(path string) *File
- func (fs *Arc) GetFileList() []string
- func (fs *Arc) MergeFrom(src *Arc, keepDupes bool)
- func (fs *Arc) Unpack(outDir string) error
- type ArcPointer
- type Dir
- type File
- type FilePointer
- type MemoryPointer
- type MemoryPointerCompressed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteFileByPath ¶
func NameHashUTF16 ¶
NameHashUTF16 computes name hash (lowercased input) as UTF-16LE
func NameHashUTF8 ¶
NameHashUTF8 computes name hash (lowercased input) as UTF-8
func UniqueIDHash ¶
UniqueIDHash computes the unique id hash of a full name encoded as UTF-16LE without lowercasing
Types ¶
type Arc ¶
Arc represents an ARC file system in memory It mirrors the structure used by the original C# ArcFileSystem.
func (*Arc) DeleteFile ¶
func (*Arc) GetFileList ¶
type ArcPointer ¶
type ArcPointer struct {
// contains filtered or unexported fields
}
func NewArcPointer ¶
func NewArcPointer(path string, offset int64) *ArcPointer
func (*ArcPointer) Compressed ¶
func (a *ArcPointer) Compressed() bool
func (*ArcPointer) Data ¶
func (a *ArcPointer) Data() ([]byte, error)
func (*ArcPointer) RawSize ¶
func (a *ArcPointer) RawSize() uint32
func (*ArcPointer) Size ¶
func (a *ArcPointer) Size() uint32
type Dir ¶
type Dir struct {
Name string
Parent *Dir
Dirs map[string]*Dir
Files map[string]*File
// contains filtered or unexported fields
}
Dir represents a directory node
func GetOrCreateDirByPath ¶
func (*Dir) GetOrCreateDir ¶
GetOrCreateDir finds or creates a directory by name under this dir
type File ¶
type File struct {
Name string
Parent *Dir
Ptr FilePointer
// contains filtered or unexported fields
}
File represents a file node with data pointer
func AddFileByPath ¶
func FindFileByPath ¶
func (*File) RelativePath ¶
RelativePath returns the path of the file relative to the Arc root.
type FilePointer ¶
type MemoryPointer ¶
type MemoryPointer struct {
// contains filtered or unexported fields
}
func NewMemoryPointer ¶
func NewMemoryPointer(data []byte) *MemoryPointer
func (*MemoryPointer) Compressed ¶
func (m *MemoryPointer) Compressed() bool
func (*MemoryPointer) Data ¶
func (m *MemoryPointer) Data() ([]byte, error)
func (*MemoryPointer) RawSize ¶
func (m *MemoryPointer) RawSize() uint32
func (*MemoryPointer) Size ¶
func (m *MemoryPointer) Size() uint32
type MemoryPointerCompressed ¶
type MemoryPointerCompressed struct {
// contains filtered or unexported fields
}
func NewMemoryPointerCompressed ¶
func NewMemoryPointerCompressed(compressed []byte, rawSize uint32) *MemoryPointerCompressed
func NewMemoryPointerCompressedAuto ¶
func NewMemoryPointerCompressedAuto(compressed []byte) *MemoryPointerCompressed
NewMemoryPointerCompressedAuto tries to determine raw size by decompressing
func (*MemoryPointerCompressed) Compressed ¶
func (m *MemoryPointerCompressed) Compressed() bool
func (*MemoryPointerCompressed) Data ¶
func (m *MemoryPointerCompressed) Data() ([]byte, error)
func (*MemoryPointerCompressed) RawSize ¶
func (m *MemoryPointerCompressed) RawSize() uint32
func (*MemoryPointerCompressed) Size ¶
func (m *MemoryPointerCompressed) Size() uint32
Click to show internal directories.
Click to hide internal directories.