26#ifndef CASA_IBMCONVERSION_H
27#define CASA_IBMCONVERSION_H
30#include <casacore/casa/aips.h>
31#include <casacore/casa/OS/CanonicalConversion.h>
38#define SIZE_IBM_CHAR 1
39#define SIZE_IBM_UCHAR 1
40#define SIZE_IBM_SHORT 2
41#define SIZE_IBM_USHORT 2
43#define SIZE_IBM_UINT 4
44#define SIZE_IBM_INT64 4
45#define SIZE_IBM_UINT64 4
46#define SIZE_IBM_FLOAT 4
47#define SIZE_IBM_DOUBLE 8
88 static void toLocal (
char& to,
const void* from);
89 static void toLocal (
unsigned char& to,
const void* from);
90 static void toLocal (
short& to,
const void* from);
91 static void toLocal (
unsigned short& to,
const void* from);
92 static void toLocal (
int& to,
const void* from);
93 static void toLocal (
unsigned int& to,
const void* from);
96 static void toLocal (
float& to,
const void* from);
97 static void toLocal (
double& to,
const void* from);
107 static void toLocal (
char* to,
const void* from,
109 static void toLocal (
unsigned char* to,
const void* from,
111 static void toLocal (
short* to,
const void* from,
113 static void toLocal (
unsigned short* to,
const void* from,
115 static void toLocal (
int* to,
const void* from,
117 static void toLocal (
unsigned int* to,
const void* from,
123 static void toLocal (
float* to,
const void* from,
125 static void toLocal (
double* to,
const void* from,
137 static void fromLocal (
void* to,
unsigned char from);
138 static void fromLocal (
void* to,
short from);
139 static void fromLocal (
void* to,
unsigned short from);
140 static void fromLocal (
void* to,
int from);
141 static void fromLocal (
void* to,
unsigned int from);
144 static void fromLocal (
void* to,
float from);
145 static void fromLocal (
void* to,
double from);
157 static void fromLocal (
void* to,
const unsigned char* from,
159 static void fromLocal (
void* to,
const short* from,
161 static void fromLocal (
void* to,
const unsigned short* from,
163 static void fromLocal (
void* to,
const int* from,
165 static void fromLocal (
void* to,
const unsigned int* from,
212 if (
sizeof(
Int64) != 4) {
213 if (((
signed char*)from)[0] < 0) {
219#if defined(AIPS_LITTLE_ENDIAN)
228 if (
sizeof(
uInt64) != 4) {
231#if defined(AIPS_LITTLE_ENDIAN)
306#if defined(AIPS_LITTLE_ENDIAN)
315#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