#include <LESwaps.h>
Static Public Member Functions | |
le_uint8 | isBigEndian () |
This method detects the endian-ness of the platform by casting a pointer to a word to a pointer to a byte. | |
le_uint16 | swapWord (le_uint16 value) |
This method does the byte swap required on little endian platforms to correctly access a (16-bit) word. | |
le_uint32 | swapLong (le_uint32 value) |
This method does the byte swapping required on little endian platforms to correctly access a (32-bit) long. |
It has been designed to automatically detect the endian-ness of the platform, so that a compilation flag is not needed.
All methods are static and inline in an attempt to induce the compiler to do most of the calculations at compile time.
Definition at line 66 of file LESwaps.h.
|
This method detects the endian-ness of the platform by casting a pointer to a word to a pointer to a byte. On big endian platforms the FF will be in the byte with the lowest address. On little endian platforms, the FF will be in the byte with the highest address.
Definition at line 82 of file LESwaps.h. References le_uint8. |
|
This method does the byte swapping required on little endian platforms to correctly access a (32-bit) long.
|
|
This method does the byte swap required on little endian platforms to correctly access a (16-bit) word.
|