C# Class Axiom.Serialization.Serializer

Summary description for Serializer.
Exibir arquivo Open project: WolfgangSt/axiom

Protected Properties

Property Type Description
currentChunkLength int
version string

Public Methods

Method Description
Serializer ( ) : System

Default constructor.

Protected Methods

Method Description
IgnoreCurrentChunk ( BinaryReader reader ) : void

Skips past a particular chunk.

Only really used during development, when logic for handling particular chunks is not yet complete.

IsEOF ( BinaryReader reader ) : bool
ReadBool ( BinaryReader reader ) : bool
ReadBytes ( BinaryReader reader, int count, IntPtr dest ) : void

Reads a specified number of floats and copies them into the destination pointer.

ReadFileChunk ( BinaryReader reader ) : short

Reads a chunk ID and chunk size.

ReadFileHeader ( BinaryReader reader ) : void

Reads a file header and checks the version string.

ReadFloat ( BinaryReader reader ) : float
ReadFloats ( BinaryReader reader, int count, IntPtr dest ) : void

Reads a specified number of floats and copies them into the destination pointer.

ReadFloats ( BinaryReader reader, int count, IntPtr dest, float destArray ) : void

Reads a specified number of floats and copies them into the destination pointer.

This overload will also copy the values into the specified destination array.

ReadInt ( BinaryReader reader ) : int
ReadInts ( BinaryReader reader, int count, IntPtr dest ) : void

Reads a specified number of integers and copies them into the destination pointer.

ReadLong ( BinaryReader reader ) : long
ReadQuat ( BinaryReader reader ) : Quaternion

Reads and returns a Quaternion.

ReadShort ( BinaryReader reader ) : short
ReadShorts ( BinaryReader reader, int count, IntPtr dest ) : void

Reads a specified number of shorts and copies them into the destination pointer.

ReadString ( BinaryReader reader ) : string

Reads from the stream up to the first endline character.

ReadString ( BinaryReader reader, char delimiter ) : string

Reads from the stream up to the specified delimiter character.

ReadUInt ( BinaryReader reader ) : uint
ReadULong ( BinaryReader reader ) : ulong
ReadUShort ( BinaryReader reader ) : ushort
ReadVector3 ( BinaryReader reader ) : Vector3

Reads and returns a Vector3 structure.

ReadVector4 ( BinaryReader reader ) : Vector4

Reads and returns a Vector4 structure.

Seek ( BinaryReader reader, long length ) : void
Seek ( BinaryReader reader, long length, SeekOrigin origin ) : void

Skips to a particular part of the binary stream.

WriteBool ( BinaryWriter writer, bool val ) : void
WriteBytes ( BinaryWriter writer, int count, IntPtr src ) : void

Writes a specified number of bytes.

WriteChunk ( BinaryWriter writer, MeshChunkID id, int chunkLength ) : void

Writes a chunk ID and chunk size. This would be more accurately named WriteChunkHeader, but this name is the counter of ReadChunk.

WriteChunk ( BinaryWriter writer, SkeletonChunkID id, int chunkLength ) : void

Writes a chunk ID and chunk size. This would be more accurately named WriteChunkHeader, but this name is the counter of ReadChunk.

WriteFileHeader ( BinaryWriter writer, string fileVersion ) : void

Writes a file header and version string.

WriteFloat ( BinaryWriter writer, float val ) : void
WriteFloats ( BinaryWriter writer, int count, IntPtr src ) : void

Writes a specified number of floats.

WriteInt ( BinaryWriter writer, int val ) : void
WriteInts ( BinaryWriter writer, int count, IntPtr src ) : void

Writes a specified number of integers.

WriteLong ( BinaryWriter writer, long val ) : void
WriteQuat ( BinaryWriter writer, Quaternion quat ) : void

Reads and returns a Quaternion.

WriteShort ( BinaryWriter writer, short val ) : void
WriteShorts ( BinaryWriter writer, int count, IntPtr src ) : void

Writes a specified number of shorts.

WriteString ( BinaryWriter writer, string str ) : void

Writes the string to the stream including the endline character.

WriteString ( BinaryWriter writer, string str, char delimiter ) : void

Writes the string to the stream including the specified delimiter character.

WriteUInt ( BinaryWriter writer, uint val ) : void
WriteULong ( BinaryWriter writer, ulong val ) : void
WriteUShort ( BinaryWriter writer, ushort val ) : void
WriteVector3 ( BinaryWriter writer, Vector3 vector ) : void

Writes a Vector3 structure.

WriteVector4 ( BinaryWriter writer, Vector4 vector ) : void

Writes a Vector4 structure.

Method Details

IgnoreCurrentChunk() protected method

Skips past a particular chunk.
Only really used during development, when logic for handling particular chunks is not yet complete.
protected IgnoreCurrentChunk ( BinaryReader reader ) : void
reader System.IO.BinaryReader
return void

IsEOF() protected method

protected IsEOF ( BinaryReader reader ) : bool
reader System.IO.BinaryReader
return bool

ReadBool() protected method

protected ReadBool ( BinaryReader reader ) : bool
reader System.IO.BinaryReader
return bool

ReadBytes() protected method

Reads a specified number of floats and copies them into the destination pointer.
protected ReadBytes ( BinaryReader reader, int count, IntPtr dest ) : void
reader System.IO.BinaryReader
count int Number of values to read.
dest System.IntPtr Pointer to copy the values into.
return void

ReadFileChunk() protected method

Reads a chunk ID and chunk size.
protected ReadFileChunk ( BinaryReader reader ) : short
reader System.IO.BinaryReader
return short

ReadFileHeader() protected method

Reads a file header and checks the version string.
protected ReadFileHeader ( BinaryReader reader ) : void
reader System.IO.BinaryReader
return void

ReadFloat() protected method

protected ReadFloat ( BinaryReader reader ) : float
reader System.IO.BinaryReader
return float

ReadFloats() protected method

Reads a specified number of floats and copies them into the destination pointer.
protected ReadFloats ( BinaryReader reader, int count, IntPtr dest ) : void
reader System.IO.BinaryReader
count int Number of values to read.
dest System.IntPtr Pointer to copy the values into.
return void

ReadFloats() protected method

Reads a specified number of floats and copies them into the destination pointer.
This overload will also copy the values into the specified destination array.
protected ReadFloats ( BinaryReader reader, int count, IntPtr dest, float destArray ) : void
reader System.IO.BinaryReader
count int Number of values to read.
dest System.IntPtr Pointer to copy the values into.
destArray float A float array that is to have the values copied into it at the same time as 'dest'.
return void

ReadInt() protected method

protected ReadInt ( BinaryReader reader ) : int
reader System.IO.BinaryReader
return int

ReadInts() protected method

Reads a specified number of integers and copies them into the destination pointer.
protected ReadInts ( BinaryReader reader, int count, IntPtr dest ) : void
reader System.IO.BinaryReader
count int Number of values to read.
dest System.IntPtr Pointer to copy the values into.
return void

ReadLong() protected method

protected ReadLong ( BinaryReader reader ) : long
reader System.IO.BinaryReader
return long

ReadQuat() protected method

Reads and returns a Quaternion.
protected ReadQuat ( BinaryReader reader ) : Quaternion
reader System.IO.BinaryReader
return Axiom.Math.Quaternion

ReadShort() protected method

protected ReadShort ( BinaryReader reader ) : short
reader System.IO.BinaryReader
return short

ReadShorts() protected method

Reads a specified number of shorts and copies them into the destination pointer.
protected ReadShorts ( BinaryReader reader, int count, IntPtr dest ) : void
reader System.IO.BinaryReader
count int Number of values to read.
dest System.IntPtr Pointer to copy the values into.
return void

ReadString() protected method

Reads from the stream up to the first endline character.
protected ReadString ( BinaryReader reader ) : string
reader System.IO.BinaryReader
return string

ReadString() protected method

Reads from the stream up to the specified delimiter character.
protected ReadString ( BinaryReader reader, char delimiter ) : string
reader System.IO.BinaryReader
delimiter char The character that signals the end of the string.
return string

ReadUInt() protected method

protected ReadUInt ( BinaryReader reader ) : uint
reader System.IO.BinaryReader
return uint

ReadULong() protected method

protected ReadULong ( BinaryReader reader ) : ulong
reader System.IO.BinaryReader
return ulong

ReadUShort() protected method

protected ReadUShort ( BinaryReader reader ) : ushort
reader System.IO.BinaryReader
return ushort

ReadVector3() protected method

Reads and returns a Vector3 structure.
protected ReadVector3 ( BinaryReader reader ) : Vector3
reader System.IO.BinaryReader
return Vector3

ReadVector4() protected method

Reads and returns a Vector4 structure.
protected ReadVector4 ( BinaryReader reader ) : Vector4
reader System.IO.BinaryReader
return Vector4

Seek() protected method

protected Seek ( BinaryReader reader, long length ) : void
reader System.IO.BinaryReader
length long
return void

Seek() protected method

Skips to a particular part of the binary stream.
protected Seek ( BinaryReader reader, long length, SeekOrigin origin ) : void
reader System.IO.BinaryReader
length long Number of bytes to skip.
origin SeekOrigin
return void

Serializer() public method

Default constructor.
public Serializer ( ) : System
return System

WriteBool() protected method

protected WriteBool ( BinaryWriter writer, bool val ) : void
writer System.IO.BinaryWriter
val bool
return void

WriteBytes() protected method

Writes a specified number of bytes.
protected WriteBytes ( BinaryWriter writer, int count, IntPtr src ) : void
writer System.IO.BinaryWriter
count int Number of values to write.
src System.IntPtr Pointer that holds the values.
return void

WriteChunk() protected method

Writes a chunk ID and chunk size. This would be more accurately named WriteChunkHeader, but this name is the counter of ReadChunk.
protected WriteChunk ( BinaryWriter writer, MeshChunkID id, int chunkLength ) : void
writer System.IO.BinaryWriter
id MeshChunkID
chunkLength int
return void

WriteChunk() protected method

Writes a chunk ID and chunk size. This would be more accurately named WriteChunkHeader, but this name is the counter of ReadChunk.
protected WriteChunk ( BinaryWriter writer, SkeletonChunkID id, int chunkLength ) : void
writer System.IO.BinaryWriter
id SkeletonChunkID
chunkLength int
return void

WriteFileHeader() protected method

Writes a file header and version string.
protected WriteFileHeader ( BinaryWriter writer, string fileVersion ) : void
writer System.IO.BinaryWriter
fileVersion string
return void

WriteFloat() protected method

protected WriteFloat ( BinaryWriter writer, float val ) : void
writer System.IO.BinaryWriter
val float
return void

WriteFloats() protected method

Writes a specified number of floats.
protected WriteFloats ( BinaryWriter writer, int count, IntPtr src ) : void
writer System.IO.BinaryWriter
count int Number of values to write.
src System.IntPtr Pointer that holds the values.
return void

WriteInt() protected method

protected WriteInt ( BinaryWriter writer, int val ) : void
writer System.IO.BinaryWriter
val int
return void

WriteInts() protected method

Writes a specified number of integers.
protected WriteInts ( BinaryWriter writer, int count, IntPtr src ) : void
writer System.IO.BinaryWriter
count int Number of values to write.
src System.IntPtr Pointer that holds the values.
return void

WriteLong() protected method

protected WriteLong ( BinaryWriter writer, long val ) : void
writer System.IO.BinaryWriter
val long
return void

WriteQuat() protected method

Reads and returns a Quaternion.
protected WriteQuat ( BinaryWriter writer, Quaternion quat ) : void
writer System.IO.BinaryWriter
quat Axiom.Math.Quaternion
return void

WriteShort() protected method

protected WriteShort ( BinaryWriter writer, short val ) : void
writer System.IO.BinaryWriter
val short
return void

WriteShorts() protected method

Writes a specified number of shorts.
protected WriteShorts ( BinaryWriter writer, int count, IntPtr src ) : void
writer System.IO.BinaryWriter
count int Number of values to write.
src System.IntPtr Pointer that holds the values.
return void

WriteString() protected method

Writes the string to the stream including the endline character.
protected WriteString ( BinaryWriter writer, string str ) : void
writer System.IO.BinaryWriter
str string
return void

WriteString() protected method

Writes the string to the stream including the specified delimiter character.
protected WriteString ( BinaryWriter writer, string str, char delimiter ) : void
writer System.IO.BinaryWriter
str string
delimiter char The character that signals the end of the string.
return void

WriteUInt() protected method

protected WriteUInt ( BinaryWriter writer, uint val ) : void
writer System.IO.BinaryWriter
val uint
return void

WriteULong() protected method

protected WriteULong ( BinaryWriter writer, ulong val ) : void
writer System.IO.BinaryWriter
val ulong
return void

WriteUShort() protected method

protected WriteUShort ( BinaryWriter writer, ushort val ) : void
writer System.IO.BinaryWriter
val ushort
return void

WriteVector3() protected method

Writes a Vector3 structure.
protected WriteVector3 ( BinaryWriter writer, Vector3 vector ) : void
writer System.IO.BinaryWriter
vector Vector3
return void

WriteVector4() protected method

Writes a Vector4 structure.
protected WriteVector4 ( BinaryWriter writer, Vector4 vector ) : void
writer System.IO.BinaryWriter
vector Vector4
return void

Property Details

currentChunkLength protected_oe property

Length of the chunk that is currently being processed.
protected int currentChunkLength
return int

version protected_oe property

Version string of this serializer.
protected string version
return string