IBMConversion.h

Classes

IBMConversion -- A class with static functions to convert IBM format (full description)

class IBMConversion

Interface

Public Members
static void toLocal (char& to, const void* from)
static void toLocal (unsigned char& to, const void* from)
static void toLocal (short& to, const void* from)
static void toLocal (unsigned short& to, const void* from)
static void toLocal (int& to, const void* from)
static void toLocal (unsigned int& to, const void* from)
static void toLocal (Int64& to, const void* from)
static void toLocal (uInt64& to, const void* from)
static void toLocal (float& to, const void* from)
static void toLocal (double& to, const void* from)
static void toLocal (char* to, const void* from, unsigned int nr)
static void toLocal (unsigned char* to, const void* from, unsigned int nr)
static void toLocal (short* to, const void* from, unsigned int nr)
static void toLocal (unsigned short* to, const void* from, unsigned int nr)
static void toLocal (int* to, const void* from, unsigned int nr)
static void toLocal (unsigned int* to, const void* from, unsigned int nr)
static void toLocal (Int64* to, const void* from, unsigned int nr)
static void toLocal (uInt64* to, const void* from, unsigned int nr)
static void toLocal (float* to, const void* from, unsigned int nr)
static void toLocal (double* to, const void* from, unsigned int nr)
static void fromLocal (void* to, char from)
static void fromLocal (void* to, unsigned char from)
static void fromLocal (void* to, short from)
static void fromLocal (void* to, unsigned short from)
static void fromLocal (void* to, int from)
static void fromLocal (void* to, unsigned int from)
static void fromLocal (void* to, Int64 from)
static void fromLocal (void* to, uInt64 from)
static void fromLocal (void* to, float from)
static void fromLocal (void* to, double from)
static void fromLocal (void* to, const char* from, unsigned int nr)
static void fromLocal (void* to, const unsigned char* from, unsigned int nr)
static void fromLocal (void* to, const short* from, unsigned int nr)
static void fromLocal (void* to, const unsigned short* from, unsigned int nr)
static void fromLocal (void* to, const int* from, unsigned int nr)
static void fromLocal (void* to, const unsigned int* from, unsigned int nr)
static void fromLocal (void* to, const Int64* from, unsigned int nr)
static void fromLocal (void* to, const uInt64* from, unsigned int nr)
static void fromLocal (void* to, const float* from, unsigned int nr)
static void fromLocal (void* to, const double* from, unsigned int nr)
Private Members
IBMConversion()

Description

Review Status

Reviewed By:
Friso Olnon
Date Reviewed:
1996/11/06
Programs:
Tests:

Synopsis

This class contains static toLocal functions to convert data from IBM-360 format to local format and vice-versa. It also handles the conversion of the IBM EBCDIC characters to ASCII characters (for data type char).

The functions work well on big-endian as well as little-endian machines.

Motivation

Archived WSRT data can be stored in the old IBM format (EBCDIC characters and floats with base 16). Conversion functions are needed to read these data.

To Do

Member Description

static void toLocal (char& to, const void* from)
static void toLocal (unsigned char& to, const void* from)
static void toLocal (short& to, const void* from)
static void toLocal (unsigned short& to, const void* from)
static void toLocal (int& to, const void* from)
static void toLocal (unsigned int& to, const void* from)
static void toLocal (Int64& to, const void* from)
static void toLocal (uInt64& to, const void* from)
static void toLocal (float& to, const void* from)
static void toLocal (double& to, const void* from)

Convert one value from IBM format to local format. The from and to buffer should not overlap. The char version converts from EBCDIC to ASCII, while the unsigned char version is a simple copy.

static void toLocal (char* to, const void* from, unsigned int nr)
static void toLocal (unsigned char* to, const void* from, unsigned int nr)
static void toLocal (short* to, const void* from, unsigned int nr)
static void toLocal (unsigned short* to, const void* from, unsigned int nr)
static void toLocal (int* to, const void* from, unsigned int nr)
static void toLocal (unsigned int* to, const void* from, unsigned int nr)
static void toLocal (Int64* to, const void* from, unsigned int nr)
static void toLocal (uInt64* to, const void* from, unsigned int nr)
static void toLocal (float* to, const void* from, unsigned int nr)
static void toLocal (double* to, const void* from, unsigned int nr)

Convert nr values from IBM format to local format. The from and to buffer should not overlap. The char version converts from EBCDIC to ASCII, while the unsigned char version is a simple copy.

static void fromLocal (void* to, char from)
static void fromLocal (void* to, unsigned char from)
static void fromLocal (void* to, short from)
static void fromLocal (void* to, unsigned short from)
static void fromLocal (void* to, int from)
static void fromLocal (void* to, unsigned int from)
static void fromLocal (void* to, Int64 from)
static void fromLocal (void* to, uInt64 from)
static void fromLocal (void* to, float from)
static void fromLocal (void* to, double from)

Convert one value from local format to IBM format. The from and to buffer should not overlap. The char version converts from ASCII to EBCDIC, while the unsigned char version is a simple copy.

static void fromLocal (void* to, const char* from, unsigned int nr)
static void fromLocal (void* to, const unsigned char* from, unsigned int nr)
static void fromLocal (void* to, const short* from, unsigned int nr)
static void fromLocal (void* to, const unsigned short* from, unsigned int nr)
static void fromLocal (void* to, const int* from, unsigned int nr)
static void fromLocal (void* to, const unsigned int* from, unsigned int nr)
static void fromLocal (void* to, const Int64* from, unsigned int nr)
static void fromLocal (void* to, const uInt64* from, unsigned int nr)
static void fromLocal (void* to, const float* from, unsigned int nr)
static void fromLocal (void* to, const double* from, unsigned int nr)

Convert nr values from local format to IBM format. The from and to buffer should not overlap. The char version converts from ASCII to EBCDIC, while the unsigned char version is a simple copy.

IBMConversion()

This class should not be constructed (so declare the constructor private).