zeus::TEndianHelper< T > Class Template Reference

#include <Endian.hpp>

Inheritance diagram for zeus::TEndianHelper< T >:

zeus::TZObject zeus::IZUnknown

List of all members.

Public Member Functions

convertFromLittleEndianBuffer (const Uint8 *pucSource)
convertFromBigEndianBuffer (const Uint8 *pucSource)
convertFromBuffer (const Uint8 *pucSource)
toLittleEndian (T tSource)
toBigEndian (T tSource)
void toLittleEndianStream (T tSource, Uint8 *pucDest)
void toBigEndianStream (T source, Uint8 *pucDest)
void swapBytes (const T tSource, Uint8 *pucDest)
Uint16 swapBytes (Uint16 usSource)
Uint32 swapBytes (Uint32 ulSource)
Uint64 swapBytes (Uint64 uldSource)
Int16 swapBytes (Int16 sSource)
Int32 swapBytes (Int32 lSource)
Int64 swapBytes (Int64 ldSource)


Detailed Description

template<typename T>
class zeus::TEndianHelper< T >

This is a helper class to convert data from big endian to little endian or v.v.

Member Function Documentation

template<typename T>
T zeus::TEndianHelper< T >::convertFromLittleEndianBuffer ( const Uint8 pucSource  )  [inline]

converts a datatype from little endian stored data

Parameters:
pucSource : data in memory as little endian
Returns:
value of data type

template<typename T>
T zeus::TEndianHelper< T >::convertFromBigEndianBuffer ( const Uint8 pucSource  )  [inline]

converts a data type from big endian stored data

Parameters:
pucSource : data in memory as big endian
Returns:
value of data type

template<typename T>
T zeus::TEndianHelper< T >::convertFromBuffer ( const Uint8 pucSource  )  [inline]

converts a data type from stored data. The data has been stored by the running system. Therefore the convertion depends on this platform only

Parameters:
pucSource : data in memory
Returns:
value of data type

template<typename T>
T zeus::TEndianHelper< T >::toLittleEndian ( tSource  )  [inline]

Converts a datatype value into little endian value

template<typename T>
T zeus::TEndianHelper< T >::toBigEndian ( tSource  )  [inline]

Converts a datatype value into big endian value

template<typename T>
void zeus::TEndianHelper< T >::toLittleEndianStream ( tSource,
Uint8 pucDest 
) [inline]

Converts a datatype value into big little endian and copies the data into the buffer

Parameters:
tSource : Source
pucDest : Buffer to copy data (bust be of size from T)

template<typename T>
void zeus::TEndianHelper< T >::toBigEndianStream ( source,
Uint8 pucDest 
) [inline]

Converts a datatype value into big big endian and copies the data into the buffer

Parameters:
tSource : Source
pucDest : Buffer to copy data (bust be of size from T)

template<typename T>
void zeus::TEndianHelper< T >::swapBytes ( const T  tSource,
Uint8 pucDest 
) [inline]

Swaps bytes of a source and returns the swapped byte array

template<typename T>
Uint16 zeus::TEndianHelper< T >::swapBytes ( Uint16  usSource  )  [inline]

swaps an unsigned int16 value

template<typename T>
Uint32 zeus::TEndianHelper< T >::swapBytes ( Uint32  ulSource  )  [inline]

swaps an unsigned int32 value

template<typename T>
Uint64 zeus::TEndianHelper< T >::swapBytes ( Uint64  uldSource  )  [inline]

swaps an unsigned int64 value

template<typename T>
Int16 zeus::TEndianHelper< T >::swapBytes ( Int16  sSource  )  [inline]

swaps an int16 value

template<typename T>
Int32 zeus::TEndianHelper< T >::swapBytes ( Int32  lSource  )  [inline]

swaps an int32 value

template<typename T>
Int64 zeus::TEndianHelper< T >::swapBytes ( Int64  ldSource  )  [inline]

swaps an int64 value


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


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Wed Oct 28 21:42:34 2009