26#ifndef CASA_LITTLEENDIANCONVERSION_H
27#define CASA_LITTLEENDIANCONVERSION_H
30#include <casacore/casa/aips.h>
31#include <casacore/casa/OS/CanonicalConversion.h>
71 static void toLocal (
char& to,
const void* from);
72 static void toLocal (
unsigned char& to,
const void* from);
73 static void toLocal (
short& to,
const void* from);
74 static void toLocal (
unsigned short& to,
const void* from);
75 static void toLocal (
int& to,
const void* from);
76 static void toLocal (
unsigned int& to,
const void* from);
79 static void toLocal (
float& to,
const void* from);
80 static void toLocal (
double& to,
const void* from);
86 static void toLocal (
char* to,
const void* from,
88 static void toLocal (
unsigned char* to,
const void* from,
90 static void toLocal (
short* to,
const void* from,
92 static void toLocal (
unsigned short* to,
const void* from,
94 static void toLocal (
int* to,
const void* from,
96 static void toLocal (
unsigned int* to,
const void* from,
102 static void toLocal (
float* to,
const void* from,
104 static void toLocal (
double* to,
const void* from,
111 static void fromLocal (
void* to,
char from);
112 static void fromLocal (
void* to,
unsigned char from);
113 static void fromLocal (
void* to,
short from);
114 static void fromLocal (
void* to,
unsigned short from);
115 static void fromLocal (
void* to,
int from);
116 static void fromLocal (
void* to,
unsigned int from);
119 static void fromLocal (
void* to,
float from);
120 static void fromLocal (
void* to,
double from);
128 static void fromLocal (
void* to,
const unsigned char* from,
132 static void fromLocal (
void* to,
const unsigned short* from,
136 static void fromLocal (
void* to,
const unsigned int* from,
164 to = *(
unsigned char*)from;
169 if (
sizeof(
short) != 2) {
170 if (((
signed char*)from)[2] < 0) {
176#if !defined(AIPS_LITTLE_ENDIAN)
186 if (
sizeof(
unsigned short) != 2) {
189#if !defined(AIPS_LITTLE_ENDIAN)
198 if (
sizeof(
int) != 4) {
199 if (((
signed char*)from)[3] < 0) {
205#if !defined(AIPS_LITTLE_ENDIAN)
215 if (
sizeof(
unsigned int) != 4) {
218#if !defined(AIPS_LITTLE_ENDIAN)
242#if !defined(AIPS_LITTLE_ENDIAN)
251#if !defined(AIPS_LITTLE_ENDIAN)
265 *(
unsigned char*)to = from;
270#if !defined(AIPS_LITTLE_ENDIAN)
279#if !defined(AIPS_LITTLE_ENDIAN)
288#if !defined(AIPS_LITTLE_ENDIAN)
297#if !defined(AIPS_LITTLE_ENDIAN)
306#if !defined(AIPS_LITTLE_ENDIAN)
315#if !defined(AIPS_LITTLE_ENDIAN)
324#if !defined(AIPS_LITTLE_ENDIAN)
333#if !defined(AIPS_LITTLE_ENDIAN)
static void reverse8(void *to, const void *from)
Reverse 8 bytes.
static void move8(void *to, const void *from)
Move 8 bytes.
static void reverse4(void *to, const void *from)
Reverse 4 bytes.
static void reverse2(void *to, const void *from)
Reverse 2 bytes.
static void move2(void *to, const void *from)
Move 2 bytes.
static void move4(void *to, const void *from)
Move 4 bytes.
static void fromLocal(void *to, const short *from, size_t nr)
static void toLocal(unsigned int *to, const void *from, size_t nr)
static void fromLocal(void *to, const char *from, size_t nr)
Convert nr values from local format to littleEndian format.
static void fromLocal(void *to, const float *from, size_t nr)
static void toLocal(Int64 *to, const void *from, size_t nr)
static void fromLocal(void *to, const Int64 *from, size_t nr)
static void toLocal(unsigned char *to, const void *from, size_t nr)
static void toLocal(int *to, const void *from, size_t nr)
static void toLocal(unsigned short *to, const void *from, size_t nr)
static void toLocal(char *to, const void *from, size_t nr)
Convert nr values from littleEndian format to local format.
static void fromLocal(void *to, const double *from, size_t nr)
static void toLocal(uInt64 *to, const void *from, size_t nr)
static void fromLocal(void *to, const unsigned short *from, size_t nr)
static void fromLocal(void *to, const unsigned char *from, size_t nr)
static void toLocal(char &to, const void *from)
Convert one value from littleEndian format to local format.
static void toLocal(float *to, const void *from, size_t nr)
static void toLocal(double *to, const void *from, size_t nr)
static void fromLocal(void *to, const unsigned int *from, size_t nr)
LittleEndianConversion()
This class should not be constructed (so declare the constructor private).
static void fromLocal(void *to, const uInt64 *from, size_t nr)
static void toLocal(short *to, const void *from, size_t nr)
static void fromLocal(void *to, const int *from, size_t nr)
static void fromLocal(void *to, char from)
Convert one value from local format to littleEndian format.
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