Isis Developer Reference
Isis::EndianSwapper Class Reference

Byte swapper. More...

#include <EndianSwapper.h>

Collaboration diagram for Isis::EndianSwapper:
Collaboration graph

Public Member Functions

 EndianSwapper (QString inputEndian)
 Constructs an EndianSwapper object, determining whether swapping of bytes actually needs to occur and sets the direction of swapping.
 
 ~EndianSwapper ()
 Destroys the EndianSwapper object.
 
double Double (void *buf)
 Swaps a double precision value.
 
float Float (void *buf)
 Swaps a floating point value.
 
int ExportFloat (void *buf)
 Swaps a floating point value for Exporting.
 
int Int (void *buf)
 Swaps a 4 byte integer value.
 
uint32_t Uint32_t (void *buf)
 Swaps a 32bit unsigned integer.
 
long long int LongLongInt (void *buf)
 Swaps an 8 byte integer value.
 
short int ShortInt (void *buf)
 Swaps a short integer value.
 
unsigned short int UnsignedShortInt (void *buf)
 Swaps an unsigned short integer value.
 
bool willSwap () const
 

Detailed Description

Byte swapper.

This class is used to swap bytes on data that is from a different machine architecture.

Author
2002-07-10 Tracie Sucharski

Constructor & Destructor Documentation

◆ EndianSwapper()

Isis::EndianSwapper::EndianSwapper ( QString inputEndian)

Constructs an EndianSwapper object, determining whether swapping of bytes actually needs to occur and sets the direction of swapping.

Parameters
inputEndianByte order of input value (MSB or LSB).

References _FILEINFO_, Isis::IsLsb(), Isis::IsMsb(), and Isis::IException::Programmer.

◆ ~EndianSwapper()

Isis::EndianSwapper::~EndianSwapper ( )

Destroys the EndianSwapper object.

Member Function Documentation

◆ Double()

double Isis::EndianSwapper::Double ( void * buf)

Swaps a double precision value.

Parameters
bufInput double precision value to swap.

◆ ExportFloat()

int Isis::EndianSwapper::ExportFloat ( void * buf)

Swaps a floating point value for Exporting.

References Int().

◆ Float()

float Isis::EndianSwapper::Float ( void * buf)

Swaps a floating point value.

Parameters
bufInput floating point value to swap.

◆ Int()

int Isis::EndianSwapper::Int ( void * buf)

Swaps a 4 byte integer value.

Parameters
bufInput integer value to swap.

Referenced by ExportFloat().

◆ LongLongInt()

long long int Isis::EndianSwapper::LongLongInt ( void * buf)

Swaps an 8 byte integer value.

Parameters
bufInput integer value to swap.

◆ ShortInt()

short int Isis::EndianSwapper::ShortInt ( void * buf)

Swaps a short integer value.

Parameters
bufInput short integer value to swap.

◆ Uint32_t()

uint32_t Isis::EndianSwapper::Uint32_t ( void * buf)

Swaps a 32bit unsigned integer.

Parameters
bufInput uint32 integer value to swap.

◆ UnsignedShortInt()

unsigned short int Isis::EndianSwapper::UnsignedShortInt ( void * buf)

Swaps an unsigned short integer value.

Parameters
bufInput unsigned short integer value to swap.

◆ willSwap()

bool Isis::EndianSwapper::willSwap ( ) const
inline

Member Data Documentation

◆ p_char

char Isis::EndianSwapper::p_char[8]

Union containing the output value in byte format.

◆ p_double

double Isis::EndianSwapper::p_double

Union containing the output double precision value with swapped bytes.

◆ p_float

float Isis::EndianSwapper::p_float

Union containing the output floating point value with swapped bytes.

◆ p_int

int Isis::EndianSwapper::p_int

Union containing the output 4 byte integer value with swapped bytes.

◆ p_longLongInt

long long int Isis::EndianSwapper::p_longLongInt

Union containing the output 8 byte integer value with swapped bytes.

◆ p_shortInt

short int Isis::EndianSwapper::p_shortInt

Union containing the output 2 byte integer value with swapped bytes.

◆ p_uint32

uint32_t Isis::EndianSwapper::p_uint32

Union containing the output uint32_t value with swapped bytes.

◆ p_uShortInt

unsigned short int Isis::EndianSwapper::p_uShortInt

Union containing the output unsigned short integer value with swapped bytes.


The documentation for this class was generated from the following files: