Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

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>

List of all members.

Static Public Methods

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

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

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


Private Methods

 LESwaps ()


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 59 of file LESwaps.h.


Constructor & Destructor Documentation

LESwaps::LESwaps   [inline, private]
 

Definition at line 113 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 74 of file LESwaps.h.

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 107 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 92 of file LESwaps.h.


The documentation for this class was generated from the following file:
Generated on Thu Jan 29 13:22:41 2004 for ICU 2.8 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001