C# Class Ohana3DS_Transfigured.Ohana.IOUtils

Mostra file Open project: Quibilia/Ohana3DS-Transfigured

Public Methods

Method Description
endianSwap ( uint value ) : uint

Converts a value from Little to Big or Big to Little endian.

readString ( BinaryReader input, uint address, bool advancePosition = false ) : string

Read an ASCII String from a given Reader at a given address. Note that the text MUST end with a Null Terminator (0x0). It doesn't advances the position after reading.

readString ( BinaryReader input, uint address, uint count ) : string

Read an ASCII String from a given Reader at a given address with given size. It will also stop reading if a Null Terminator (0x0) is found. It WILL advance the position until the count is reached, or a 0x0 is found.

readStringWithLength ( BinaryReader input, uint count ) : string

Read an ASCII String from a given Reader with given size. It will also stop reading if a Null Terminator (0x0) is found. It WILL advance the position until the count is reached, or a 0x0 is found.

signExtend ( int value, int bits ) : int

Sign extends the value, so it will keep the sign flag.

signExtend ( uint value, int bits ) : int

Sign extends the value, so it will keep the sign flag.

Method Details

endianSwap() public static method

Converts a value from Little to Big or Big to Little endian.
public static endianSwap ( uint value ) : uint
value uint The value to be swapped
return uint

readString() public static method

Read an ASCII String from a given Reader at a given address. Note that the text MUST end with a Null Terminator (0x0). It doesn't advances the position after reading.
public static readString ( BinaryReader input, uint address, bool advancePosition = false ) : string
input System.IO.BinaryReader The Reader of the File Stream
address uint Address where the text begins
advancePosition bool
return string

readString() public static method

Read an ASCII String from a given Reader at a given address with given size. It will also stop reading if a Null Terminator (0x0) is found. It WILL advance the position until the count is reached, or a 0x0 is found.
public static readString ( BinaryReader input, uint address, uint count ) : string
input System.IO.BinaryReader The Reader of the File Stream
address uint Address where the text begins
count uint Number of bytes that the text have
return string

readStringWithLength() public static method

Read an ASCII String from a given Reader with given size. It will also stop reading if a Null Terminator (0x0) is found. It WILL advance the position until the count is reached, or a 0x0 is found.
public static readStringWithLength ( BinaryReader input, uint count ) : string
input System.IO.BinaryReader The Reader of the File Stream
count uint Number of bytes that the text have
return string

signExtend() public static method

Sign extends the value, so it will keep the sign flag.
public static signExtend ( int value, int bits ) : int
value int The value that should be sign-extended
bits int Number of bits that the value have
return int

signExtend() public static method

Sign extends the value, so it will keep the sign flag.
public static signExtend ( uint value, int bits ) : int
value uint The value that should be sign-extended
bits int Number of bits that the value have
return int