Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Ogre::Serializer Class Reference

Generic class for serialising data to / from binary stream-based files. More...

#include <OgreSerializer.h>

Inheritance diagram for Ogre::Serializer:

Ogre::MeshSerializer Ogre::MeshSerializerImpl Ogre::SkeletonSerializer Ogre::MeshSerializerImpl_v1_2 Ogre::MeshSerializerImpl_v1_1 List of all members.

Public Types

enum  Endian { ENDIAN_NATIVE, ENDIAN_BIG, ENDIAN_LITTLE }
 The endianness of written files. More...


Public Member Functions

 Serializer ()
virtual ~Serializer ()

Protected Member Functions

virtual void writeFileHeader (void)
virtual void writeChunkHeader (uint16 id, uint32 size)
void writeFloats (const float *const pfloat, size_t count)
void writeFloats (const double *const pfloat, size_t count)
void writeShorts (const uint16 *const pShort, size_t count)
void writeInts (const uint32 *const pInt, size_t count)
void writeBools (const bool *const pLong, size_t count)
void writeObject (const Vector3 &vec)
void writeObject (const Quaternion &q)
void writeString (const String &string)
void writeData (const void *const buf, size_t size, size_t count)
virtual void readFileHeader (DataStreamPtr &stream)
virtual unsigned short readChunk (DataStreamPtr &stream)
void readBools (DataStreamPtr &stream, bool *pDest, size_t count)
void readFloats (DataStreamPtr &stream, float *pDest, size_t count)
void readFloats (DataStreamPtr &stream, double *pDest, size_t count)
void readShorts (DataStreamPtr &stream, uint16 *pDest, size_t count)
void readInts (DataStreamPtr &stream, uint32 *pDest, size_t count)
void readObject (DataStreamPtr &stream, Vector3 &pDest)
void readObject (DataStreamPtr &stream, Quaternion &pDest)
String readString (DataStreamPtr &stream)
String readString (DataStreamPtr &stream, size_t numChars)
virtual void flipToLittleEndian (void *pData, size_t size, size_t count=1)
virtual void flipFromLittleEndian (void *pData, size_t size, size_t count=1)
virtual void flipEndian (void *pData, size_t size, size_t count)
virtual void flipEndian (void *pData, size_t size)
virtual void determineEndianness (DataStreamPtr &stream)
 Determine the endianness of the incoming stream compared to native.

virtual void determineEndianness (Endian requestedEndian)
 Determine the endianness to write with based on option.


Protected Attributes

uint32 mCurrentstreamLen
FILE * mpfFile
String mVersion
bool mFlipEndian

Detailed Description

Generic class for serialising data to / from binary stream-based files.

Remarks:
This class provides a number of useful methods for exporting / importing data from stream-oriented binary files (e.g. .mesh and .skeleton).

Definition at line 40 of file OgreSerializer.h.


Member Enumeration Documentation

enum Ogre::Serializer::Endian
 

The endianness of written files.

Enumeration values:
ENDIAN_NATIVE  Use the platform native endian.
ENDIAN_BIG  Use big endian (0x1000 is serialised as 0x10 0x00).
ENDIAN_LITTLE  Use little endian (0x1000 is serialised as 0x00 0x10).

Definition at line 47 of file OgreSerializer.h.


Constructor & Destructor Documentation

Ogre::Serializer::Serializer  ) 
 

virtual Ogre::Serializer::~Serializer  )  [virtual]
 


Member Function Documentation

virtual void Ogre::Serializer::determineEndianness Endian  requestedEndian  )  [protected, virtual]
 

Determine the endianness to write with based on option.

virtual void Ogre::Serializer::determineEndianness DataStreamPtr stream  )  [protected, virtual]
 

Determine the endianness of the incoming stream compared to native.

virtual void Ogre::Serializer::flipEndian void *  pData,
size_t  size
[protected, virtual]
 

virtual void Ogre::Serializer::flipEndian void *  pData,
size_t  size,
size_t  count
[protected, virtual]
 

virtual void Ogre::Serializer::flipFromLittleEndian void *  pData,
size_t  size,
size_t  count = 1
[protected, virtual]
 

virtual void Ogre::Serializer::flipToLittleEndian void *  pData,
size_t  size,
size_t  count = 1
[protected, virtual]
 

void Ogre::Serializer::readBools DataStreamPtr stream,
bool *  pDest,
size_t  count
[protected]
 

virtual unsigned short Ogre::Serializer::readChunk DataStreamPtr stream  )  [protected, virtual]
 

virtual void Ogre::Serializer::readFileHeader DataStreamPtr stream  )  [protected, virtual]
 

void Ogre::Serializer::readFloats DataStreamPtr stream,
double *  pDest,
size_t  count
[protected]
 

void Ogre::Serializer::readFloats DataStreamPtr stream,
float *  pDest,
size_t  count
[protected]
 

void Ogre::Serializer::readInts DataStreamPtr stream,
uint32 pDest,
size_t  count
[protected]
 

void Ogre::Serializer::readObject DataStreamPtr stream,
Quaternion pDest
[protected]
 

void Ogre::Serializer::readObject DataStreamPtr stream,
Vector3 pDest
[protected]
 

void Ogre::Serializer::readShorts DataStreamPtr stream,
uint16 pDest,
size_t  count
[protected]
 

String Ogre::Serializer::readString DataStreamPtr stream,
size_t  numChars
[protected]
 

String Ogre::Serializer::readString DataStreamPtr stream  )  [protected]
 

void Ogre::Serializer::writeBools const bool *const  pLong,
size_t  count
[protected]
 

virtual void Ogre::Serializer::writeChunkHeader uint16  id,
uint32  size
[protected, virtual]
 

void Ogre::Serializer::writeData const void *const  buf,
size_t  size,
size_t  count
[protected]
 

virtual void Ogre::Serializer::writeFileHeader void   )  [protected, virtual]
 

void Ogre::Serializer::writeFloats const double *const  pfloat,
size_t  count
[protected]
 

void Ogre::Serializer::writeFloats const float *const  pfloat,
size_t  count
[protected]
 

void Ogre::Serializer::writeInts const uint32 *const  pInt,
size_t  count
[protected]
 

void Ogre::Serializer::writeObject const Quaternion q  )  [protected]
 

void Ogre::Serializer::writeObject const Vector3 vec  )  [protected]
 

void Ogre::Serializer::writeShorts const uint16 *const  pShort,
size_t  count
[protected]
 

void Ogre::Serializer::writeString const String string  )  [protected]
 


Member Data Documentation

uint32 Ogre::Serializer::mCurrentstreamLen [protected]
 

Definition at line 60 of file OgreSerializer.h.

bool Ogre::Serializer::mFlipEndian [protected]
 

Definition at line 63 of file OgreSerializer.h.

FILE* Ogre::Serializer::mpfFile [protected]
 

Definition at line 61 of file OgreSerializer.h.

String Ogre::Serializer::mVersion [protected]
 

Definition at line 62 of file OgreSerializer.h.


The documentation for this class was generated from the following file:

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:44:04 2006