asset

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package asset provides Go bindings for Android Asset Manager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

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

Asset wraps the NDK AAsset handle.

func NewAssetFromPointer

func NewAssetFromPointer(ptr unsafe.Pointer) *Asset

NewAssetFromPointer wraps a raw AAsset pointer.

func (*Asset) Buffer

func (h *Asset) Buffer() unsafe.Pointer

Buffer returns the value directly.

func (*Asset) Close

func (h *Asset) Close() error

Close releases the underlying NDK handle.

func (*Asset) IsAllocated

func (h *Asset) IsAllocated() int32

IsAllocated returns the value directly.

func (*Asset) Length

func (h *Asset) Length() Off_t

Length returns the value directly.

func (*Asset) Length64

func (h *Asset) Length64() Off64_t

Length64 returns the value directly.

func (*Asset) OpenFileDescriptor

func (h *Asset) OpenFileDescriptor(outStart *Off_t, outLength *Off_t) error

OpenFileDescriptor calls the underlying NDK function.

func (*Asset) OpenFileDescriptor64

func (h *Asset) OpenFileDescriptor64(outStart *Off64_t, outLength *Off64_t) error

OpenFileDescriptor64 calls the underlying NDK function.

func (*Asset) Pointer

func (h *Asset) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*Asset) Read

func (h *Asset) Read(buf unsafe.Pointer, count uint64) error

Read calls the underlying NDK function.

func (*Asset) RemainingLength

func (h *Asset) RemainingLength() Off_t

RemainingLength returns the value directly.

func (*Asset) RemainingLength64

func (h *Asset) RemainingLength64() Off64_t

RemainingLength64 returns the value directly.

func (*Asset) Seek

func (h *Asset) Seek(offset Off_t, whence int32) Off_t

Seek returns the value directly.

type Dir

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

Dir wraps the NDK AAssetDir handle.

func NewDirFromPointer

func NewDirFromPointer(ptr unsafe.Pointer) *Dir

NewDirFromPointer wraps a raw AAssetDir pointer.

func (*Dir) Close

func (h *Dir) Close() error

Close releases the underlying NDK handle.

func (*Dir) NextFileName

func (h *Dir) NextFileName() string

NextFileName returns the value directly.

func (*Dir) Pointer

func (h *Dir) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*Dir) Rewind

func (h *Dir) Rewind()

Rewind calls the underlying NDK function.

type Error

type Error int32

Error represents an NDK error code.

func (Error) Error

func (e Error) Error() string

type Manager

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

Manager wraps the NDK AAssetManager handle.

func NewManagerFromPointer

func NewManagerFromPointer(ptr unsafe.Pointer) *Manager

NewManagerFromPointer wraps a raw AAssetManager pointer.

func (*Manager) Open

func (h *Manager) Open(filename string, mode Mode) *Asset

Open creates a new Asset from this Manager.

func (*Manager) OpenDir

func (h *Manager) OpenDir(dirName string) *Dir

OpenDir creates a new Dir from this Manager.

func (*Manager) Pointer

func (h *Manager) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

type Mode

type Mode int32
const (
	Unknown   Mode = 0
	Random    Mode = 1
	Streaming Mode = 2
	Buffer    Mode = 3
)

type Off64_t

type Off64_t = capi.Off64_t

type Off_t

type Off_t = capi.Off_t

Jump to

Keyboard shortcuts

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