Nebula
|
#include <byteorder.h>
Provides information and methods to help with byte ordering issues.
The following byte orders are defined:
NOTE: on console-platforms it is strongly recommended to store binary data in console-byte-order during asset processing on the development PC, so that the console doesn't waste loading time with byte conversions!
Classes | |
union | PunDoubleULL |
union | PunFloatUL |
Public Types | |
enum | Type { LittleEndian = 0 , BigEndian , Network = BigEndian , Host = BigEndian , LittleEndian = 0 , BigEndian , Network = BigEndian , Host = BigEndian } |
enum | Type { LittleEndian = 0 , BigEndian , Network = BigEndian , Host = BigEndian , LittleEndian = 0 , BigEndian , Network = BigEndian , Host = BigEndian } |
Public Member Functions | |
ByteOrder () | |
default constructor | |
ByteOrder (Type fromByteOrder, Type toByteOrder) | |
constructor: set byte order conversion rule | |
void | SetFromByteOrder (Type fromByteOrder) |
set from-byte-order | |
Type | GetFromByteOrder () const |
get from-byte-order | |
void | SetToByteOrder (Type toByteOrder) |
set to-byte-order | |
Type | GetToByteOrder () const |
get to-byte-order | |
template<class TYPE > | |
void | ConvertInPlace (TYPE &val) const |
endian-convert in place | |
template<class TYPE > | |
TYPE | Convert (TYPE val) const |
endian-convert by copy | |
ByteOrder () | |
default constructor | |
ByteOrder (Type fromByteOrder, Type toByteOrder) | |
constructor: set byte order conversion rule | |
void | SetFromByteOrder (Type fromByteOrder) |
set from-byte-order | |
Type | GetFromByteOrder () const |
get from-byte-order | |
void | SetToByteOrder (Type toByteOrder) |
set to-byte-order | |
Type | GetToByteOrder () const |
get to-byte-order | |
template<class TYPE > | |
void | Convert (TYPE &val) const |
endian-convert in place | |
template<> | |
__forceinline void | ConvertInPlace (Type fromByteOrder, Type toByteOrder, short &val) |
template<> | |
__forceinline void | ConvertInPlace (short &val) const |
template<> | |
__forceinline short | Convert (Type fromByteOrder, Type toByteOrder, short val) |
template<> | |
__forceinline short | Convert (short val) const |
template<> | |
__forceinline void | ConvertInPlace (Type fromByteOrder, Type toByteOrder, ushort &val) |
template<> | |
__forceinline void | ConvertInPlace (ushort &val) const |
template<> | |
__forceinline ushort | Convert (Type fromByteOrder, Type toByteOrder, ushort val) |
template<> | |
__forceinline ushort | Convert (ushort val) const |
template<> | |
__forceinline void | ConvertInPlace (Type fromByteOrder, Type toByteOrder, int &val) |
template<> | |
__forceinline void | ConvertInPlace (int &val) const |
template<> | |
__forceinline int | Convert (Type fromByteOrder, Type toByteOrder, int val) |
template<> | |
__forceinline int | Convert (int val) const |
template<> | |
__forceinline void | ConvertInPlace (Type fromByteOrder, Type toByteOrder, uint &val) |
template<> | |
__forceinline void | ConvertInPlace (uint &val) const |
template<> | |
__forceinline uint | Convert (Type fromByteOrder, Type toByteOrder, uint val) |
template<> | |
__forceinline uint | Convert (uint val) const |
template<> | |
__forceinline void | ConvertInPlace (Type fromByteOrder, Type toByteOrder, float &val) |
template<> | |
__forceinline void | ConvertInPlace (float &val) const |
template<> | |
__forceinline float | Convert (Type fromByteOrder, Type toByteOrder, float val) |
template<> | |
__forceinline float | Convert (float val) const |
template<> | |
__forceinline void | ConvertInPlace (Type fromByteOrder, Type toByteOrder, double &val) |
template<> | |
__forceinline void | ConvertInPlace (double &val) const |
template<> | |
__forceinline double | Convert (Type fromByteOrder, Type toByteOrder, double val) |
template<> | |
__forceinline uint64_t | Convert (Type fromByteOrder, Type toByteOrder, uint64_t val) |
template<> | |
__forceinline int64_t | Convert (Type fromByteOrder, Type toByteOrder, int64_t val) |
template<> | |
__forceinline int64_t | Convert (int64_t val) const |
template<> | |
__forceinline uint64_t | Convert (uint64_t val) const |
template<> | |
__forceinline double | Convert (double val) const |
template<> | |
__forceinline void | Convert (short &val) const |
template<> | |
__forceinline void | Convert (ushort &val) const |
template<> | |
__forceinline void | Convert (int &val) const |
template<> | |
__forceinline void | Convert (uint &val) const |
template<> | |
__forceinline void | Convert (float &val) const |
template<> | |
__forceinline void | Convert (double &val) const |
Static Public Member Functions | |
template<class TYPE > | |
static void | ConvertInPlace (Type fromByteOrder, Type toByteOrder, TYPE &val) |
endian-convert in place | |
template<class TYPE > | |
static TYPE | Convert (Type fromByteOrder, Type toByteOrder, TYPE val) |
endian-convert by copy | |
Private Attributes | |
Type | from |
Type | to |
__forceinline System::ByteOrder::ByteOrder | ( | ) |
default constructor
__forceinline System::ByteOrder::ByteOrder | ( | ByteOrder::Type | fromByteOrder, |
ByteOrder::Type | toByteOrder ) |
constructor: set byte order conversion rule
System::ByteOrder::ByteOrder | ( | ) |
default constructor
constructor: set byte order conversion rule
__forceinline void System::ByteOrder::Convert | ( | double & | val | ) | const |
__forceinline double System::ByteOrder::Convert | ( | double | val | ) | const |
__forceinline void System::ByteOrder::Convert | ( | float & | val | ) | const |
__forceinline float System::ByteOrder::Convert | ( | float | val | ) | const |
__forceinline void System::ByteOrder::Convert | ( | int & | val | ) | const |
__forceinline int System::ByteOrder::Convert | ( | int | val | ) | const |
__forceinline int64_t System::ByteOrder::Convert | ( | int64_t | val | ) | const |
__forceinline void System::ByteOrder::Convert | ( | short & | val | ) | const |
__forceinline short System::ByteOrder::Convert | ( | short | val | ) | const |
void System::ByteOrder::Convert | ( | TYPE & | val | ) | const |
endian-convert in place
__forceinline double System::ByteOrder::Convert | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
double | val ) |
__forceinline float System::ByteOrder::Convert | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
float | val ) |
__forceinline int System::ByteOrder::Convert | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
int | val ) |
__forceinline int64_t System::ByteOrder::Convert | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
int64_t | val ) |
__forceinline short System::ByteOrder::Convert | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
short | val ) |
|
static |
endian-convert by copy
__forceinline uint System::ByteOrder::Convert | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
uint | val ) |
__forceinline uint64_t System::ByteOrder::Convert | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
uint64_t | val ) |
__forceinline ushort System::ByteOrder::Convert | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
ushort | val ) |
TYPE System::ByteOrder::Convert | ( | TYPE | val | ) | const |
endian-convert by copy
__forceinline void System::ByteOrder::Convert | ( | uint & | val | ) | const |
__forceinline uint64_t System::ByteOrder::Convert | ( | uint64_t | val | ) | const |
__forceinline void System::ByteOrder::Convert | ( | ushort & | val | ) | const |
__forceinline void System::ByteOrder::ConvertInPlace | ( | double & | val | ) | const |
__forceinline void System::ByteOrder::ConvertInPlace | ( | float & | val | ) | const |
__forceinline void System::ByteOrder::ConvertInPlace | ( | int & | val | ) | const |
__forceinline void System::ByteOrder::ConvertInPlace | ( | short & | val | ) | const |
void System::ByteOrder::ConvertInPlace | ( | TYPE & | val | ) | const |
endian-convert in place
__forceinline void System::ByteOrder::ConvertInPlace | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
double & | val ) |
__forceinline void System::ByteOrder::ConvertInPlace | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
float & | val ) |
__forceinline void System::ByteOrder::ConvertInPlace | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
int & | val ) |
__forceinline void System::ByteOrder::ConvertInPlace | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
short & | val ) |
|
static |
endian-convert in place
__forceinline void System::ByteOrder::ConvertInPlace | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
uint & | val ) |
__forceinline void System::ByteOrder::ConvertInPlace | ( | Type | fromByteOrder, |
Type | toByteOrder, | ||
ushort & | val ) |
__forceinline void System::ByteOrder::ConvertInPlace | ( | uint & | val | ) | const |
__forceinline void System::ByteOrder::ConvertInPlace | ( | ushort & | val | ) | const |
__forceinline ByteOrder::Type System::ByteOrder::GetFromByteOrder | ( | ) | const |
get from-byte-order
Type System::ByteOrder::GetFromByteOrder | ( | ) | const |
get from-byte-order
__forceinline ByteOrder::Type System::ByteOrder::GetToByteOrder | ( | ) | const |
get to-byte-order
Type System::ByteOrder::GetToByteOrder | ( | ) | const |
get to-byte-order
__forceinline void System::ByteOrder::SetFromByteOrder | ( | Type | fromByteOrder | ) |
set from-byte-order
void System::ByteOrder::SetFromByteOrder | ( | Type | fromByteOrder | ) |
set from-byte-order
__forceinline void System::ByteOrder::SetToByteOrder | ( | Type | toByteOrder | ) |
set to-byte-order
void System::ByteOrder::SetToByteOrder | ( | Type | toByteOrder | ) |
set to-byte-order
|
private |
|
private |