code::ByteOrder Class Reference

List of all members.

Detailed Description

ByteOrder allows you to have a portable character representation of your class across architechtures.

The BOStream class provides a better interface to this class.

See also:
BOStream
Author:
Lakshman
Version:
Id
code_ByteOrder.h,v 1.8 2009/06/02 20:17:39 lakshman Exp


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.


Constructor & Destructor Documentation

code::ByteOrder::ByteOrder ( bool  littleEndianFile = true  )  [inline]

Instantiate a ByteOrder object.

Parameters:
endian true if the file's bytes are little endian


Member Function Documentation

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.


Generated on Fri May 4 13:40:12 2012 for WDSS-IIw2 by  doxygen 1.4.7