28 #ifndef CASA_IBMCONVERSION_H
29 #define CASA_IBMCONVERSION_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/OS/CanonicalConversion.h>
40 #define SIZE_IBM_CHAR 1
41 #define SIZE_IBM_UCHAR 1
42 #define SIZE_IBM_SHORT 2
43 #define SIZE_IBM_USHORT 2
44 #define SIZE_IBM_INT 4
45 #define SIZE_IBM_UINT 4
46 #define SIZE_IBM_INT64 4
47 #define SIZE_IBM_UINT64 4
48 #define SIZE_IBM_FLOAT 4
49 #define SIZE_IBM_DOUBLE 8
90 static void toLocal (
char& to,
const void* from);
91 static void toLocal (
unsigned char& to,
const void* from);
92 static void toLocal (
short& to,
const void* from);
93 static void toLocal (
unsigned short& to,
const void* from);
94 static void toLocal (
int& to,
const void* from);
95 static void toLocal (
unsigned int& to,
const void* from);
98 static void toLocal (
float& to,
const void* from);
99 static void toLocal (
double& to,
const void* from);
109 static void toLocal (
char* to,
const void* from,
111 static void toLocal (
unsigned char* to,
const void* from,
113 static void toLocal (
short* to,
const void* from,
115 static void toLocal (
unsigned short* to,
const void* from,
117 static void toLocal (
int* to,
const void* from,
119 static void toLocal (
unsigned int* to,
const void* from,
125 static void toLocal (
float* to,
const void* from,
127 static void toLocal (
double* to,
const void* from,
139 static void fromLocal (
void* to,
unsigned char from);
140 static void fromLocal (
void* to,
short from);
141 static void fromLocal (
void* to,
unsigned short from);
142 static void fromLocal (
void* to,
int from);
143 static void fromLocal (
void* to,
unsigned int from);
146 static void fromLocal (
void* to,
float from);
147 static void fromLocal (
void* to,
double from);
159 static void fromLocal (
void* to,
const unsigned char* from,
161 static void fromLocal (
void* to,
const short* from,
163 static void fromLocal (
void* to,
const unsigned short* from,
165 static void fromLocal (
void* to,
const int* from,
167 static void fromLocal (
void* to,
const unsigned int* from,
214 if (
sizeof(
Int64) != 4) {
215 if (((
signed char*)from)[0] < 0) {
221 #if defined(AIPS_LITTLE_ENDIAN)
230 if (
sizeof(
uInt64) != 4) {
233 #if defined(AIPS_LITTLE_ENDIAN)
308 #if defined(AIPS_LITTLE_ENDIAN)
317 #if defined(AIPS_LITTLE_ENDIAN)
static size_t fromLocal(void *to, const char &from)
Convert one value from local format to canonical format.
static void reverse4(void *to, const void *from)
Reverse 4 bytes.
static size_t toLocal(char &to, const void *from)
Convert one value from canonical format to local format.
static void move4(void *to, const void *from)
Move 4 bytes.
IBMConversion()
This class should not be constructed (so declare the constructor private).
static void fromLocal(void *to, char from)
Convert one value from local format to IBM format.
static void fromLocal(void *to, const float *from, size_t nr)
static void toLocal(double *to, const void *from, size_t nr)
static void fromLocal(void *to, const double *from, size_t nr)
static void fromLocal(void *to, const char *from, size_t nr)
Convert nr values from local format to IBM format.
static void fromLocal(void *to, const Int64 *from, size_t nr)
static void toLocal(Int64 *to, const void *from, size_t nr)
static void toLocal(char &to, const void *from)
Convert one value from IBM format to local format.
static void fromLocal(void *to, const uInt64 *from, size_t nr)
static void toLocal(char *to, const void *from, size_t nr)
Convert nr values from IBM format to local format.
static void toLocal(float *to, const void *from, size_t nr)
static void toLocal(uInt64 *to, const void *from, size_t nr)
this file contains all the compiler specific defines
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
unsigned long long uInt64