28 #ifndef CASA_LITTLEENDIANCONVERSION_H
29 #define CASA_LITTLEENDIANCONVERSION_H
73 static void toLocal (
char& to,
const void* from);
74 static void toLocal (
unsigned char& to,
const void* from);
75 static void toLocal (
short& to,
const void* from);
76 static void toLocal (
unsigned short& to,
const void* from);
77 static void toLocal (
int& to,
const void* from);
78 static void toLocal (
unsigned int& to,
const void* from);
81 static void toLocal (
float& to,
const void* from);
82 static void toLocal (
double& to,
const void* from);
88 static void toLocal (
char* to,
const void* from,
90 static void toLocal (
unsigned char* to,
const void* from,
92 static void toLocal (
short* to,
const void* from,
94 static void toLocal (
unsigned short* to,
const void* from,
96 static void toLocal (
int* to,
const void* from,
98 static void toLocal (
unsigned int* to,
const void* from,
104 static void toLocal (
float* to,
const void* from,
106 static void toLocal (
double* to,
const void* from,
113 static void fromLocal (
void* to,
char from);
114 static void fromLocal (
void* to,
unsigned char from);
115 static void fromLocal (
void* to,
short from);
116 static void fromLocal (
void* to,
unsigned short from);
117 static void fromLocal (
void* to,
int from);
118 static void fromLocal (
void* to,
unsigned int from);
121 static void fromLocal (
void* to,
float from);
122 static void fromLocal (
void* to,
double from);
128 static void fromLocal (
void* to,
const char* from,
130 static void fromLocal (
void* to,
const unsigned char* from,
132 static void fromLocal (
void* to,
const short* from,
134 static void fromLocal (
void* to,
const unsigned short* from,
136 static void fromLocal (
void* to,
const int* from,
138 static void fromLocal (
void* to,
const unsigned int* from,
144 static void fromLocal (
void* to,
const float* from,
146 static void fromLocal (
void* to,
const double* from,
166 to = *(
unsigned char*)from;
171 if (
sizeof(
short) != 2) {
172 if (((
signed char*)from)[2] < 0) {
178 #if !defined(AIPS_LITTLE_ENDIAN)
188 if (
sizeof(
unsigned short) != 2) {
191 #if !defined(AIPS_LITTLE_ENDIAN)
200 if (
sizeof(
int) != 4) {
201 if (((
signed char*)from)[3] < 0) {
207 #if !defined(AIPS_LITTLE_ENDIAN)
217 if (
sizeof(
unsigned int) != 4) {
220 #if !defined(AIPS_LITTLE_ENDIAN)
244 #if !defined(AIPS_LITTLE_ENDIAN)
253 #if !defined(AIPS_LITTLE_ENDIAN)
267 *(
unsigned char*)to = from;
272 #if !defined(AIPS_LITTLE_ENDIAN)
281 #if !defined(AIPS_LITTLE_ENDIAN)
290 #if !defined(AIPS_LITTLE_ENDIAN)
299 #if !defined(AIPS_LITTLE_ENDIAN)
308 #if !defined(AIPS_LITTLE_ENDIAN)
317 #if !defined(AIPS_LITTLE_ENDIAN)
326 #if !defined(AIPS_LITTLE_ENDIAN)
335 #if !defined(AIPS_LITTLE_ENDIAN)
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
static void move2(void *to, const void *from)
Move 2 bytes.
LittleEndianConversion()
This class should not be constructed (so declare the constructor private).
static void reverse2(void *to, const void *from)
Reverse 2 bytes.
unsigned long long uInt64
static void reverse8(void *to, const void *from)
Reverse 8 bytes.
static void toLocal(char &to, const void *from)
Convert one value from littleEndian format to local format.
static void fromLocal(void *to, char from)
Convert one value from local format to littleEndian format.
static void move4(void *to, const void *from)
Move 4 bytes.
A class with static functions to convert littleEndian format.
static void reverse4(void *to, const void *from)
Reverse 4 bytes.
static void move8(void *to, const void *from)
Move 8 bytes.