Documentation ¶
Overview ¶
Package d2loader provides a file loader which works in terms of `Source`s and `Asset`s. A `Source` is something that resembles a filesystem, and an `Asset` is something that implements `io.ReadSeeker`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
type Loader struct { d2interface.Cache *d2util.Logger LoaderProviders map[types.SourceType]func(path string) (asset.Source, error) Sources []asset.Source // contains filtered or unexported fields }
Loader represents the manager that handles loading and caching assets with the asset Sources that have been added
func (*Loader) AddSource ¶
func (l *Loader) AddSource(path string, sourceType types.SourceType) error
AddSource adds an asset source with the given path. The path will either resolve to a directory or a file on the host filesystem. In the case that it is a file, the file extension is used to determine the type of asset source. In the case that the path points to a directory, a FileSystemSource will be added.
func (*Loader) Load ¶
func (l *Loader) Load(subPath string) (io.ReadSeeker, error)
Load attempts to load an asset with the given sub-path. The sub-path is relative to the root of each asset source root (regardless of the type of asset source)
func (*Loader) SetCharset ¶
SetCharset sets the charset for loader
func (*Loader) SetLanguage ¶
SetLanguage sets the language for loader
Directories ¶
Path | Synopsis |
---|---|
Package asset provides interfaces for Asset and Source
|
Package asset provides interfaces for Asset and Source |
types
Package types provides an enumeration of Asset and Source types, as well as some utility functions
|
Package types provides an enumeration of Asset and Source types, as well as some utility functions |
Package filesystem provides a filesystem Asset and Source implementation for d2loader
|
Package filesystem provides a filesystem Asset and Source implementation for d2loader |
Package mpq provides an MPQ Asset and Source implementation for d2loader
|
Package mpq provides an MPQ Asset and Source implementation for d2loader |