The BOStream class provides a better interface to this class.
Public Member Functions | |
ByteOrder (bool littleEndianFile=true) | |
Instantiate a ByteOrder object. | |
void | swapIfNeeded (char *startVal, size_t numChars) const |
Swap (in place) the variable passed in iff the file's endianness differs from this machine's. | |
Static Public Member Functions | |
static void | swapAlways (char *startVal, size_t numChars) |
Unconditionally swaps (in place) the variable passed in. |
code::ByteOrder::ByteOrder | ( | bool | littleEndianFile = true |
) | [inline] |
static void code::ByteOrder::swapAlways | ( | char * | startVal, | |
size_t | numChars | |||
) | [inline, static] |
Unconditionally swaps (in place) the variable passed in.
Useful when you have to swap regardless of the byteorder.
void code::ByteOrder::swapIfNeeded | ( | char * | startVal, | |
size_t | numChars | |||
) | const [inline] |
Swap (in place) the variable passed in iff the file's endianness differs from this machine's.