count

package
v1.44.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

View Source
const (
	HeaderSlots = 7
	HeaderSize  = 4
)
View Source
const (
	AttributeEnd byte = iota
	AttributeModule
	AttributeParent
	AttributeBase
	AttributeExtension
	AttributeOffset
	AttributeCompressed
	AttributeUncompressed
)
View Source
const OffsetSize = 4
View Source
const RedirectSize = 4

Variables

View Source
var ClassExtensions = []string{".class", ".classdata", ".clj", ".groovy", ".kts"}

Functions

func Classes added in v1.20.0

func Classes(path string) (int, error)

func JarClasses added in v1.20.0

func JarClasses(path string) (int, error)

func JarClassesFrom added in v1.36.2

func JarClassesFrom(paths ...string) (int, int, error)

func ModuleClasses added in v1.20.0

func ModuleClasses(file string) (int, error)

Types

type Header struct {
	Magic         int32
	MajorVersion  int32
	MinorVersion  int32
	Flags         int32
	ResourceCount int32
	TableLength   int32
	LocationsSize int32
	StringsSize   int32
}

func NewHeader added in v1.20.0

func NewHeader(reader io.Reader) (Header, error)

func (Header) Size added in v1.20.0

func (Header) Size() uint32

type Image added in v1.20.0

type Image struct {
	MajorVersion  int32
	MinorVersion  int32
	Flags         int32
	ResourceCount int32

	Redirects Redirects
	Offsets   Offsets
	Locations Locations
	Strings   Strings
}

func NewImage added in v1.20.0

func NewImage(path string) (Image, error)

type Location added in v1.20.0

type Location struct {
	ModuleOffset     int32
	ParentOffset     int32
	BaseOffset       int32
	ExtensionOffset  int32
	ContentOffset    int32
	CompressedSize   int32
	UncompressedSize int32
}

func (Location) Extension added in v1.20.0

func (l Location) Extension(strings Strings) (string, error)

func (Location) FullName added in v1.20.0

func (l Location) FullName(strings Strings) (string, error)

type Locations added in v1.20.0

type Locations struct {
	Offset int32
	Size   int32
	Reader io.ReadSeeker
}

func (Locations) Get added in v1.20.0

func (l Locations) Get(offset Offset) (Location, error)

type Offset added in v1.20.0

type Offset int32

type Offsets added in v1.20.0

type Offsets struct {
	Entries []Offset
	Offset  int32
}

func NewOffsets added in v1.20.0

func NewOffsets(reader io.ReadSeeker, offset int32, tableLength int32) (Offsets, error)

func (Offsets) Size added in v1.20.0

func (o Offsets) Size() int

type Redirect added in v1.20.0

type Redirect int32

type Redirects added in v1.20.0

type Redirects struct {
	Entries []Redirect
	Offset  int32
}

func NewRedirects added in v1.20.0

func NewRedirects(reader io.ReadSeeker, offset int32, tableLength int32) (Redirects, error)

func (Redirects) Size added in v1.20.0

func (r Redirects) Size() int

type StringReader added in v1.20.0

type StringReader interface {
	io.Reader
	io.ReaderAt
	io.Seeker
}

type Strings added in v1.20.0

type Strings struct {
	Offset int32
	Size   int32
	Reader StringReader
}

func (Strings) Get added in v1.20.0

func (s Strings) Get(offset int32) (string, error)

Jump to

Keyboard shortcuts

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