26#ifndef CASA_IBMCONVERSION_H
27#define CASA_IBMCONVERSION_H
30#include <casacore/casa/aips.h>
31#include <casacore/casa/OS/CanonicalConversion.h>
37#define SIZE_IBM_CHAR 1
38#define SIZE_IBM_UCHAR 1
39#define SIZE_IBM_SHORT 2
40#define SIZE_IBM_USHORT 2
42#define SIZE_IBM_UINT 4
43#define SIZE_IBM_INT64 4
44#define SIZE_IBM_UINT64 4
45#define SIZE_IBM_FLOAT 4
46#define SIZE_IBM_DOUBLE 8
84 static void toLocal(
char& to,
const void* from);
85 static void toLocal(
unsigned char& to,
const void* from);
86 static void toLocal(
short& to,
const void* from);
87 static void toLocal(
unsigned short& to,
const void* from);
88 static void toLocal(
int& to,
const void* from);
89 static void toLocal(
unsigned int& to,
const void* from);
92 static void toLocal(
float& to,
const void* from);
93 static void toLocal(
double& to,
const void* from);
103 static void toLocal(
char* to,
const void* from,
size_t nr);
104 static void toLocal(
unsigned char* to,
const void* from,
size_t nr);
105 static void toLocal(
short* to,
const void* from,
size_t nr);
106 static void toLocal(
unsigned short* to,
const void* from,
size_t nr);
107 static void toLocal(
int* to,
const void* from,
size_t nr);
108 static void toLocal(
unsigned int* to,
const void* from,
size_t nr);
111 static void toLocal(
float* to,
const void* from,
size_t nr);
112 static void toLocal(
double* to,
const void* from,
size_t nr);
123 static void fromLocal(
void* to,
unsigned char from);
124 static void fromLocal(
void* to,
short from);
125 static void fromLocal(
void* to,
unsigned short from);
126 static void fromLocal(
void* to,
int from);
127 static void fromLocal(
void* to,
unsigned int from);
130 static void fromLocal(
void* to,
float from);
131 static void fromLocal(
void* to,
double from);
141 static void fromLocal(
void* to,
const char* from,
size_t nr);
142 static void fromLocal(
void* to,
const unsigned char* from,
size_t nr);
143 static void fromLocal(
void* to,
const short* from,
size_t nr);
144 static void fromLocal(
void* to,
const unsigned short* from,
size_t nr);
145 static void fromLocal(
void* to,
const int* from,
size_t nr);
146 static void fromLocal(
void* to,
const unsigned int* from,
size_t nr);
149 static void fromLocal(
void* to,
const float* from,
size_t nr);
150 static void fromLocal(
void* to,
const double* from,
size_t nr);
180 if (
sizeof(
Int64) != 4) {
181 if (((
signed char*)from)[0] < 0) {
187#if defined(AIPS_LITTLE_ENDIAN)
195 if (
sizeof(
uInt64) != 4) {
198#if defined(AIPS_LITTLE_ENDIAN)
250#if defined(AIPS_LITTLE_ENDIAN)
258#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)
For temporary backward namespace compatibility, use casa as alias for casacore.
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size).
unsigned long long uInt64