LESwaps Class Reference

This class is used to access data which stored in big endian order regardless of the conventions of the platform. More...

#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.


Detailed Description

This class is used to access data which stored in big endian order regardless of the conventions of the platform.

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.

Stable:
ICU 2.8

Definition at line 66 of file LESwaps.h.


Member Function Documentation

le_uint8 LESwaps::isBigEndian  )  [inline, static]
 

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.

Returns:
TRUE if the platform is big endian

Stable:
ICU 2.8

Definition at line 82 of file LESwaps.h.

References le_uint8.

le_uint32 LESwaps::swapLong le_uint32  value  )  [inline, static]
 

This method does the byte swapping required on little endian platforms to correctly access a (32-bit) long.

Parameters:
value - the long to be byte swapped
Returns:
the byte swapped long

Stable:
ICU 2.8

Definition at line 117 of file LESwaps.h.

le_uint16 LESwaps::swapWord le_uint16  value  )  [inline, static]
 

This method does the byte swap required on little endian platforms to correctly access a (16-bit) word.

Parameters:
value - the word to be byte swapped
Returns:
the byte swapped word

Stable:
ICU 2.8

Definition at line 101 of file LESwaps.h.


The documentation for this class was generated from the following file:
Generated on Mon Jul 14 00:23:57 2008 for ICU 3.6 by  doxygen 1.3.9.1