Isis 3 Programmer Reference
EndianSwapper.h
Go to the documentation of this file.
1 
24 #ifndef EndianSwapper_h
25 #define EndianSwapper_h
26 
27 #include "IException.h"
28 
29 namespace Isis {
30 
55  class EndianSwapper {
56  private:
58  bool p_needSwap;
64 
70  union {
72  uint32_t p_uint32;
74  double p_double;
76  float p_float;
78  int p_int;
80  long long int p_longLongInt;
82  short int p_shortInt;
87  unsigned short int p_uShortInt;
89  char p_char[8];
90  } p_swapper;
91 
92  public:
93  EndianSwapper(QString inputEndian);
95  double Double(void *buf);
96  float Float(void *buf);
97  int ExportFloat(void *buf);
98  int Int(void *buf);
99  uint32_t Uint32_t(void *buf);
100  long long int LongLongInt(void *buf);
101  short int ShortInt(void *buf);
102  unsigned short int UnsignedShortInt(void *buf);
103  bool willSwap() const {
104  return p_needSwap;
105  }
106  };
107 };
108 
109 #endif
int p_swapDirection
Indicates which direction to increment the pointer for swapping.
Definition: EndianSwapper.h:63
float Float(void *buf)
Swaps a floating point value.
char p_char[8]
Union containing the output value in byte format.
Definition: EndianSwapper.h:89
long long int p_longLongInt
Union containing the output 8 byte integer value with swapped bytes.
Definition: EndianSwapper.h:80
int p_int
Union containing the output 4 byte integer value with swapped bytes.
Definition: EndianSwapper.h:78
uint32_t p_uint32
Union containing the output uint32_t value with swapped bytes.
Definition: EndianSwapper.h:72
unsigned short int UnsignedShortInt(void *buf)
Swaps an unsigned short integer value.
double p_double
Union containing the output double precision value with swapped bytes.
Definition: EndianSwapper.h:74
long long int LongLongInt(void *buf)
Swaps an 8 byte integer value.
short int p_shortInt
Union containing the output 2 byte integer value with swapped bytes.
Definition: EndianSwapper.h:82
double Double(void *buf)
Swaps a double precision value.
Byte swapper.
Definition: EndianSwapper.h:55
float p_float
Union containing the output floating point value with swapped bytes.
Definition: EndianSwapper.h:76
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
~EndianSwapper()
Destroys the EndianSwapper object.
int ExportFloat(void *buf)
Swaps a floating point value for Exporting.
short int ShortInt(void *buf)
Swaps a short integer value.
bool p_needSwap
Indicates whether bytes need to be swapped.
Definition: EndianSwapper.h:58
union Isis::EndianSwapper::@0 p_swapper
Union containing the output double precision value, floating point value, short integer value...
EndianSwapper(QString inputEndian)
Constructs an EndianSwapper object, determining whether swapping of bytes actually needs to occur and...
uint32_t Uint32_t(void *buf)
Swaps a 32bit unsigned integer.
unsigned short int p_uShortInt
Union containing the output unsigned short integer value with swapped bytes.
Definition: EndianSwapper.h:87
int Int(void *buf)
Swaps a 4 byte integer value.