8 #ifndef MBase_EndianConversion_h 9 #define MBase_EndianConversion_h 30 unsigned long lnDataSize =
sizeof(T);
31 unsigned char* lpByte = (
unsigned char*)(&iData);
32 unsigned char lpTemp = 0;
33 for (
unsigned Int32 idxByte = 0; idxByte < lnDataSize/2; idxByte++)
35 lpTemp = *(lpByte+idxByte);
36 *(lpByte+idxByte) = *(lpByte+lnDataSize-idxByte-1);
37 *(lpByte+lnDataSize-idxByte-1) = lpTemp;
46 inline void EndianConvertGUID(::
GUID &irGUID)
50 irGUID.
Data1 = ConvertEndian<unsigned Int32>(irGUID.
Data1);
51 irGUID.
Data2 = ConvertEndian<unsigned short>(irGUID.
Data2);
52 irGUID.
Data3 = ConvertEndian<unsigned short>(irGUID.
Data3);
56 #endif // GUID_DEFINED 59 #endif // MBase_EndianConversion_h
unsigned short Data2
Definition: Base/Base/GUID.h:35
bool IsBigEndian()
Definition: System.h:150
T ConvertEndian(T iData)
Definition: EndianConversion.h:26
#define Int32
Definition: BasicTypes.h:20
unsigned int Data1
Definition: Base/Base/GUID.h:34
Definition: Allocator.h:47
unsigned short Data3
Definition: Base/Base/GUID.h:36
Definition: Base/Base/GUID.h:32