lib

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressFile

func CompressFile(filename string) (string, error)

CompressFile reads the given file and converts it to a gzip compressed hex string

func DecompressHexString

func DecompressHexString(hexdata string) ([]byte, error)

DecompressHexString decompresses the gzip/hex encoded data

func FindGoFiles

func FindGoFiles(directory string) ([]string, error)

FindGoFiles finds all go files recursively from the given directory

func GeneratePackFileString

func GeneratePackFileString(assetBundle *ReferencedAssets, ignoreErrors bool) (string, error)

GeneratePackFileString creates the contents of a pack file

func GetMewnFiles

func GetMewnFiles(args []string, ignoreErrors bool) []string

GetMewnFiles returns a list of files referencing mewn assets

func HasMewnReference

func HasMewnReference(filename string) (bool, error)

HasMewnReference determines if the current file has a reference to the mewn library

Types

type AssetDirectory added in v0.9.4

type AssetDirectory struct {
	FileGroups map[string]*FileGroup
}

AssetDirectory is a collection of file groups

func NewAssetDirectory added in v0.9.4

func NewAssetDirectory() *AssetDirectory

NewAssetDirectory creates a new asset directory

func (*AssetDirectory) GetGroup added in v0.9.4

func (a *AssetDirectory) GetGroup(groupName string) *FileGroup

GetGroup gets a filegroup by name. Returns nil if not found

func (*AssetDirectory) NewFileGroup added in v0.9.4

func (a *AssetDirectory) NewFileGroup(baseDirectory string) (*FileGroup, error)

NewFileGroup creates a new file group

type AssignStmt added in v0.9.4

type AssignStmt struct {
	LHS string
	RHS *CallStmt
}

AssignStmt holds data about an assignment

func ParseAssignment added in v0.9.4

func ParseAssignment(astmt *ast.AssignStmt) *AssignStmt

ParseAssignment parses an assignment statement

func (*AssignStmt) String added in v0.9.4

func (a *AssignStmt) String() string

type CallStmt added in v0.9.4

type CallStmt struct {
	Obj    string
	Method string
	Path   string
}

CallStmt holds data about a call statement

func ParseCallExpr added in v0.9.4

func ParseCallExpr(callstmt *ast.CallExpr) *CallStmt

ParseCallExpr parses a call expression for mewn related statements

func (*CallStmt) String added in v0.9.4

func (c *CallStmt) String() string

type FileGroup added in v0.9.4

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

FileGroup holds a collection of files

func (*FileGroup) AddAsset added in v0.9.4

func (f *FileGroup) AddAsset(name, data string) error

AddAsset to the FileGroup

func (*FileGroup) Bytes added in v0.9.4

func (f *FileGroup) Bytes(filename string) []byte

Bytes returns the asset as a Byte slice. Failure is indicated by a blank slice. If you need hard failures, use MustBytes.

func (*FileGroup) Entries added in v0.9.4

func (f *FileGroup) Entries() []string

Entries returns a slice of filenames in the FileGroup

func (*FileGroup) MustBytes added in v0.9.4

func (f *FileGroup) MustBytes(filename string) []byte

MustBytes returns the asset as a string. If the asset doesn't exist, it hard fails

func (*FileGroup) MustString added in v0.9.4

func (f *FileGroup) MustString(filename string) string

MustString returns the asset as a string. If the asset doesn't exist, it hard fails

func (*FileGroup) Reset added in v0.9.4

func (f *FileGroup) Reset()

Reset the FileGroup

func (*FileGroup) String added in v0.9.4

func (f *FileGroup) String(filename string) string

String returns the asset as a string Failure is indicated by a blank string. If you need hard failures, use MustString.

type Group added in v0.9.4

type Group struct {
	Name      string
	LocalPath string
	FullPath  string
}

Group holds information relating to a group

type ReferencedAsset

type ReferencedAsset struct {
	Name      string
	AssetPath string
	Group     *Group
}

ReferencedAsset holds the information for an asset referenced by the user

type ReferencedAssets

type ReferencedAssets struct {
	Caller      string
	PackageName string
	BaseDir     string
	Assets      []*ReferencedAsset
	Groups      []*Group
}

ReferencedAssets is a collection of assets referenced from a file

func GetReferencedAssets

func GetReferencedAssets(filenames []string) ([]*ReferencedAssets, error)

GetReferencedAssets gets a list of referenced assets from the AST

func (*ReferencedAssets) HasAsset added in v0.9.1

func (r *ReferencedAssets) HasAsset(name string) bool

HasAsset returns true if the given asset name has already been processed for this asset group

Jump to

Keyboard shortcuts

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