count

package
v0.0.0-...-6a9c84d Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

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

func Classes(path string) (int, error)

func JarClasses

func JarClasses(path string) (int, error)

func JarClassesFrom

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

func ModuleClasses

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

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

func (Header) Size

func (Header) Size() uint32

type Image

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

	Redirects Redirects
	Offsets   Offsets
	Locations Locations
	Strings   Strings
}

func NewImage

func NewImage(path string) (Image, error)

type Location

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

func (Location) Extension

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

func (Location) FullName

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

type Locations

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

func (Locations) Get

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

type Offset

type Offset int32

type Offsets

type Offsets struct {
	Entries []Offset
	Offset  int32
}

func NewOffsets

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

func (Offsets) Size

func (o Offsets) Size() int

type Redirect

type Redirect int32

type Redirects

type Redirects struct {
	Entries []Redirect
	Offset  int32
}

func NewRedirects

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

func (Redirects) Size

func (r Redirects) Size() int

type StringReader

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

type Strings

type Strings struct {
	Offset int32
	Size   int32
	Reader StringReader
}

func (Strings) Get

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