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

Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 36 of file LESwaps.h.


Constructor & Destructor Documentation

LESwaps::LESwaps   [inline, private]
 

Definition at line 88 of file LESwaps.h.


Member Function Documentation

le_bool 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
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 50 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
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 82 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
Draft:
This API has been introduced in ICU 2.2. It is still in draft state and may be modified in a future release.

Definition at line 67 of file LESwaps.h.

Referenced by swapLong().


The documentation for this class was generated from the following file:
Generated on Thu Aug 15 14:14:01 2002 for ICU 2.2 by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001