C# Class Glare.Assets.AssetLoader

A loader for an Asset.
Inheritance: NotifyingObject
Show file Open project: Burton-Radons/Alexandria Class Usage Examples

Public Properties

Property Type Description
ProgressProperty PropertyInfo

Public Methods

Method Description
AddError ( long offset, string message ) : void

Add a generic load error.

AssetLoader ( AssetManager assetManager, BinaryReader reader, string name, FileManager fileManager, Asset contextResource = null, long length = null ) : Glare.Framework

Initialise the Asset loader.

Expect ( byte expected ) : bool

Expect a UInt16 value; if found, return true; otherwise report an error and return false

Expect ( int expected ) : bool

Expect a Int32 value; if found, return true; otherwise report an error and return false

Expect ( long expected ) : bool

Expect a Int64 value; if found, return true; otherwise report an error and return false

Expect ( sbyte expected ) : bool

Expect a SByte value; if found, return true; otherwise report an error and return false

Expect ( short expected ) : bool

Expect a Int16 value; if found, return true; otherwise report an error and return false

Expect ( uint expected ) : bool

Expect a UInt32 value; if found, return true; otherwise report an error and return false

Expect ( ulong expected ) : bool

Expect a UInt64 value; if found, return true; otherwise report an error and return false

Expect ( ushort expected ) : bool

Expect a Byte value; if found, return true; otherwise report an error and return false

ExpectMagic ( string expected ) : bool

Expect a magic sequence of bytes. If found, return true; otherwise report an error and return false.

ExpectPosition ( long expected ) : bool

Expect the input to be at a given position; if not so, report an error.

ExpectZeroes ( int size, int count ) : bool

Expect a sequence of zeroes, reporting errors if they are not found.

MakeBigEndian ( ) : BinaryReader

Switch the Reader for a BigEndianBinaryReader.

ReadCheckedAbsoluteBox3f ( ) : Box3f

Read a Box3f that is conveyed using absolute coordinates, with a triplet of min values and a triplet of max values. This checks that the min values are less than or equal to the max values, reporting errors if not.

Reset ( ) : void

Reset the stream position to the original position when the asset loader was created.

SetProgressToPosition ( ) : void

Set Progress to the current reader Position, based on the Start offset and the Length.

StartMarking ( ) : MarkingStream

Switch to the use of a MarkingStream.

StartMarking ( BinaryReader &reader ) : MarkingStream

Switch to the use of a MarkingStream.

Private Methods

Method Description
ExpectCore ( long expected, long received ) : bool
ValueToString ( long value ) : string

Method Details

AddError() public method

Add a generic load error.
public AddError ( long offset, string message ) : void
offset long
message string
return void

AssetLoader() public method

Initialise the Asset loader.
public AssetLoader ( AssetManager assetManager, BinaryReader reader, string name, FileManager fileManager, Asset contextResource = null, long length = null ) : Glare.Framework
assetManager AssetManager
reader System.IO.BinaryReader
name string
fileManager FileManager The to use to load any attached files. If this is null (the default), then the system file manager () is used.
contextResource Asset
length long
return Glare.Framework

Expect() public method

Expect a UInt16 value; if found, return true; otherwise report an error and return false
public Expect ( byte expected ) : bool
expected byte
return bool

Expect() public method

Expect a Int32 value; if found, return true; otherwise report an error and return false
public Expect ( int expected ) : bool
expected int
return bool

Expect() public method

Expect a Int64 value; if found, return true; otherwise report an error and return false
public Expect ( long expected ) : bool
expected long
return bool

Expect() public method

Expect a SByte value; if found, return true; otherwise report an error and return false
public Expect ( sbyte expected ) : bool
expected sbyte
return bool

Expect() public method

Expect a Int16 value; if found, return true; otherwise report an error and return false
public Expect ( short expected ) : bool
expected short
return bool

Expect() public method

Expect a UInt32 value; if found, return true; otherwise report an error and return false
public Expect ( uint expected ) : bool
expected uint
return bool

Expect() public method

Expect a UInt64 value; if found, return true; otherwise report an error and return false
public Expect ( ulong expected ) : bool
expected ulong
return bool

Expect() public method

Expect a Byte value; if found, return true; otherwise report an error and return false
public Expect ( ushort expected ) : bool
expected ushort
return bool

ExpectMagic() public method

Expect a magic sequence of bytes. If found, return true; otherwise report an error and return false.
public ExpectMagic ( string expected ) : bool
expected string
return bool

ExpectPosition() public method

Expect the input to be at a given position; if not so, report an error.
public ExpectPosition ( long expected ) : bool
expected long
return bool

ExpectZeroes() public method

Expect a sequence of zeroes, reporting errors if they are not found.
public ExpectZeroes ( int size, int count ) : bool
size int
count int
return bool

MakeBigEndian() public method

Switch the Reader for a BigEndianBinaryReader.
public MakeBigEndian ( ) : BinaryReader
return BinaryReader

ReadCheckedAbsoluteBox3f() public method

Read a Box3f that is conveyed using absolute coordinates, with a triplet of min values and a triplet of max values. This checks that the min values are less than or equal to the max values, reporting errors if not.
public ReadCheckedAbsoluteBox3f ( ) : Box3f
return Box3f

Reset() public method

Reset the stream position to the original position when the asset loader was created.
public Reset ( ) : void
return void

SetProgressToPosition() public method

Set Progress to the current reader Position, based on the Start offset and the Length.
public SetProgressToPosition ( ) : void
return void

StartMarking() public method

Switch to the use of a MarkingStream.
public StartMarking ( ) : MarkingStream
return MarkingStream

StartMarking() public method

Switch to the use of a MarkingStream.
public StartMarking ( BinaryReader &reader ) : MarkingStream
reader BinaryReader
return MarkingStream

Property Details

ProgressProperty public static property

PropertyInfo for the Progress property.
public static PropertyInfo ProgressProperty
return PropertyInfo