Attention
This functionality is only available in the C++ toolkits. For other languages, we recommend using language-specific functionality instead.
OEGetHostEndian¶
template<class T>
unsigned char OEGetHostEndian()
template<>
unsigned char OEGetHostEndian<int>()
template<>
unsigned char OEGetHostEndian<unsigned int>()
template<>
unsigned char OEGetHostEndian<float>()
template<>
unsigned char OEGetHostEndian<double>()
template<>
unsigned char OEGetHostEndian<short>()
template<>
unsigned char OEGetHostEndian<oefpos_t>()
template<>
unsigned char OEGetHostEndian<OEPlatform::OEHalfFloat>()
Returns the endianness of this machine so it can be encoded to a binary output file. The byte is used to indicate whether multi-byte binary values will need to be swapped when read on a different machine.
See also
Designed to work in conjunction with
OEGetFileEndian. The byte returned by
OEGetHostEndian should be written to the
output file, then OEGetFileEndian will
determine whether the bytes of the given type T need to be
swapped while being read by OEBReadData.