|
Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
|
#include <Endian.h>
Public Member Functions | |
| Endian () | |
| virtual | ~Endian () |
| void | ResolveEndian (char *data, size_t size, EndianType inputEndian) const |
| void | SwapBytes (char *data, size_t size) const |
| void | SwapBytes (char *data, size_t size, size_t number) const |
| EndianType | GetEndianType () const |
Object used to figure out the system's endianness and switch value endianness if necessary.
| Ult::Endian::Endian | ( | ) |
Endian constructor.
|
virtual |
Endian destructor.
|
inline |
Get the endianness of the host system
| void Ult::Endian::ResolveEndian | ( | char * | data, |
| size_t | size, | ||
| EndianType | inputEndian ) const |
Switch endianness of the input data only if necessary based on the system endianness and the input endianness.
| data | The bytes to be potentially switched endianness of |
| size | The number of bytes (should be multiple of 2) |
| inputEndian | The endianness of the input data |
| void Ult::Endian::SwapBytes | ( | char * | data, |
| size_t | size ) const |
Reverse the byte order of a single value.
| data | The bytes to swap the endianness of |
| size | The amount of bytes of data (e.g. 2,4,8) |
| void Ult::Endian::SwapBytes | ( | char * | data, |
| size_t | size, | ||
| size_t | number ) const |
Reverse the byte order of multiple values.
| data | The bytes to swap the endianness of |
| size | The amount of bytes of a single value |
| number | The number of values contained in data |