WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
WXP::Swap Class Reference

This class performs byte swapping. More...

#include "../include/Swap.h"

Public Member Functions

 Swap (int flag)
int init (int flag)
int swap8 (unsigned char *ptr)
int swap4 (unsigned char *ptr)
int swap4 (unsigned char *ptr, int num)
int swap2 (unsigned char *ptr)
int swap2 (unsigned char *ptr, int num)
int readDouble (File &ifile, double &data)
int readFloat (File &ifile, float &data)
int readUInt4 (File &ifile, unsigned int &data)
int readInt4 (File &ifile, int &data)
int readUInt2 (File &ifile, unsigned short &data)
int readInt2 (File &ifile, short &data)
int writeFloat (File &ofile, float data)
int writeInt4 (File &ofile, int data)
int writeInt2 (File &ofile, short data)

Static Public Attributes

static const int NEVER = -1
static const int ALWAYS = 0
static const int DataStand = 1
static const int DataRev = 2
static const int BigEndian = 1
static const int LittleEndian = 2

Detailed Description

This class performs byte swapping.

flag = NEVER - never swap
flag = ALWAYS - swap no matter what
flag = DataStand - swap if machine reverse and data standard
flag = DataRev - swap if machine standard and data reverse

Author
Dan Vietor

Member Function Documentation

◆ init()

int Swap::init ( int flag)

Initializes class values

Parameters
flagFlag for type of swap and type of input data

The documentation for this class was generated from the following files: