GeoTessCPP: geotess::IFStreamBinary Class Reference

GeoTessCPP 2.2.3 Software to facilitate storage and retrieval of 3D information about the Earth.

Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
geotess::IFStreamBinary Class Reference

Opens a file for binary read and write access. More...

`#include <IFStreamBinary.h>`

## Public Member Functions
| IFStreamBinary ()
| IFStreamBinary (bool align)
| IFStreamBinary (const string &filename)
| IFStreamBinary (const string &filename, int num_bytes)
| IFStreamBinary (string *str)
| IFStreamBinary (const IFStreamBinary &db)
virtual | ~IFStreamBinary ()
IFStreamBinary & | operator= (const IFStreamBinary &db)
void | dumpBuffer ()
void | writeToFile (const string &filename)
void | writeToFile (ofstream &ofs)
void | readFromFile (const string &filename)
void | readFromFile (const string &filename, int num_bytes)
void | readFromFile (ifstream &ifs, int num_bytes)
const string & | getFileName () const
void | clear ()
void | setMemoryCapacityIncrement (int mci)
string | readString ()
void | readString (string &s)
void | readCharArray (string &s, int num_chars)
void | readCharArray (char *array, int num_chars)
void | readType (string &s)
void | readTypeArray (string &array, int num_chars)
bool | readBool ()
bool | readBool (int pos)
void | readBoolArray (bool *array, int num_bools)
void | readType (bool &b)
void | readTypeArray (bool *array, int num_bools)
byte | readByte ()
byte | readByte (int pos)
void | readByteArray (byte *array, int num_bs)
void | readType (byte &b)
void | readTypeArray (byte *array, int num_bs)
short | readShort ()
short | readShortNC ()
short | readShort (int pos)
void | readShortArray (short *array, int num_shorts)
void | readType (short &s)
void | readTypeArray (short *array, int num_shorts)
int | readInt ()
int | readIntNC ()
int | readInt (int pos)
void | readIntArray (int *array, int num_ints)
void | readType (int &i)
void | readTypeArray (int *array, int num_ints)
LONG_INT | readLong ()
LONG_INT | readLongNC ()
LONG_INT | readLong (int pos)
void | readLongArray (LONG_INT *array, int num_longs)
void | readType (LONG_INT &l)
void | readTypeArray (LONG_INT *array, int num_longs)
float | readFloat ()
float | readFloatNC ()
float | readFloat (int pos)
void | readFloatArray (float *array, int num_floats)
void | readType (float &f)
void | readTypeArray (float *array, int num_floats)
double | readDouble ()
double | readDoubleNC ()
double | readDouble (int pos)
void | readDoubleArray (double *array, int num_doubles)
void | readType (double &d)
void | readTypeArray (double *array, int num_doubles)
void | writeString (const string &str)
void | writeString (const char *char_string)
void | writeCharArray (const char *array, int num_chars)
void | writeType (const string &str)
void | writeType (const char *char_string)
void | writeBool (bool b)
void | writeBoolNC (bool b)
void | writeBool (bool b, int pos)
void | writeBoolArray (const bool *array, int num_bools)
void | writeType (bool b)
void | writeTypeArray (const bool *array, int num_bools)
void | writeByte (byte b)
void | writeByteNC (byte b)
void | writeByte (byte b, int pos)
void | writeByteArray (const byte *array, int num_bytes)
void | writeType (byte b)
void | writeTypeArray (const byte *array, int num_bytes)
void | writeShort (short i)
void | writeShortNC (short i)
void | writeShort (short i, int pos)
void | writeShortArray (const short *array, int num_ints)
void | writeType (short i)
void | writeTypeArray (const short *array, int num_ints)
void | writeInt (int i)
void | writeIntNC (int i)
void | writeInt (int i, int pos)
void | writeIntArray (const int *array, int num_ints)
void | writeType (int i)
void | writeTypeArray (const int *array, int num_ints)
void | writeLong (LONG_INT l)
void | writeLongNC (LONG_INT l)
void | writeLong (LONG_INT l, int pos)
void | writeLongArray (const LONG_INT *array, int num_longs)
void | writeType (LONG_INT l)
void | writeTypeArray (const LONG_INT *array, int num_longs)
void | writeFloat (float f)
void | writeFloatNC (float f)
void | writeFloat (float f, int pos)
void | writeFloatArray (const float *array, int num_floats)
void | writeType (float f)
void | writeTypeArray (const float *array, int num_floats)
void | writeDouble (double d)
void | writeDoubleNC (double d)
void | writeDouble (double d, int pos)
void | writeDoubleArray (const double *array, int num_doubles)
void | writeType (double d)
void | writeTypeArray (const double *array, int num_doubles)
void | reSize (int spc)
void | reserve (int sze)
int | size ()
void | resetPos ()
void | setPosToEnd ()
int | getPos () const
void | incrementPos (int increment=1)
void | decrementPos (int decrement=1)
const string & | getData () const
int | getCapacity () const
char * | getPosPointer ()
char * | getPosPointer (int pos)
void | setByteOrderReverse (bool bor)
void | byteOrderReverseOn ()
void | byteOrderReverseOff ()
bool | isByteOrderReversalOn () const
void | setBoundaryAlignment (bool align)
void | boundaryAlignmentOn ()
void | boundaryAlignmentOff ()
bool | isBoundaryAlignmentOn () const

## Static Public Member Functions
static bool | exists (const string &filename)
static string | className ()
static int | classSize ()

## Protected Member Functions
void | align2Byte ()
void | align4Byte ()
void | align8Byte ()
void | checkBufferSize (int sincr)

## Static Protected Member Functions
static void | reverseBOArray (int n, char *a, int s)
static void | reverseBO2Array (int n, char *a)
static void | reverseBO4Array (int n, char *a)
static void | reverseBO8Array (int n, char *a)
static void | reverseBO2 (char *d)
static void | reverseBO4 (char *d)
static void | reverseBO8 (char *d)

## Protected Attributes
string * | bData
int | bDataPos
int | bSize
bool | bAlign
bool | bReverse
bool | bOwnStr
string | bFileName
int | bMemIncr

## Detailed Description

Opens a file for binary read and write access.

Opens a file for binary read and write access. The read portion is configured to parse binary files using standard readType(...) functionality.

Functionality is provided to read elemental, strings, booleans, bytes, shorts, ints, longs, floats, or doubles, as-well-as array input forms of each (except strings). The binary file can be read in intrinsic alignment form (somewhat faster) where doubles and longs are assumed to be read (and written) along 8 bytes boundaries, floats and ints are aligned on 4 byte boundaries, and shorts are aligned on a 2 byte boundary. A little/big-endian byte reversal flag can be set to reverse the byte structure if necessary.

Definition at line 81 of file IFStreamBinary.h.

## Constructor & Destructor Documentation

## ◆ IFStreamBinary() [1/6]

geotess::IFStreamBinary::IFStreamBinary | ( |  | ) |

Public Default Constructor.

## ◆ IFStreamBinary() [2/6]

geotess::IFStreamBinary::IFStreamBinary | ( | bool | align | ) |

Standard constructor that sets the padding (alignment) option to align.

## ◆ IFStreamBinary() [3/6]

geotess::IFStreamBinary::IFStreamBinary | ( | const string & | filename | ) |

Standard constructor creates a new IFStreamBinary and opens reads its buffer from the input filename

## ◆ IFStreamBinary() [4/6]

geotess::IFStreamBinary::IFStreamBinary | ( | const string & | filename,
|  | int | num_bytes
| ) |  |

Standard constructor creates a new IFStreamBinary and opens reads its buffer from the input filename

## ◆ IFStreamBinary() [5/6]

geotess::IFStreamBinary::IFStreamBinary | ( | string * | str | ) |

Standard constructor that uses a provided string ptr as the data container.

## ◆ IFStreamBinary() [6/6]

geotess::IFStreamBinary::IFStreamBinary | ( | const IFStreamBinary & | db | ) |

Copy Constructor.

## ◆ ~IFStreamBinary()

virtual geotess::IFStreamBinary::~IFStreamBinary | ( |  | ) |
| virtual

Public destructor

## Member Function Documentation

## ◆ align2Byte()

void geotess::IFStreamBinary::align2Byte | ( |  | ) |
| inlineprotected

Ensure that the buffer position pointer (dbDataPos) is aligned on a 4 byte boundary.

Definition at line 130 of file IFStreamBinary.h.

## ◆ align4Byte()

void geotess::IFStreamBinary::align4Byte | ( |  | ) |
| inlineprotected

Ensure that the buffer position pointer (dbDataPos) is aligned on a 4 byte boundary.

Definition at line 140 of file IFStreamBinary.h.

## ◆ align8Byte()

void geotess::IFStreamBinary::align8Byte | ( |  | ) |
| inlineprotected

Ensure that the buffer position pointer (dbDataPos) is aligned on a 8 byte boundary.

Definition at line 150 of file IFStreamBinary.h.

## ◆ boundaryAlignmentOff()

void geotess::IFStreamBinary::boundaryAlignmentOff | ( |  | ) |
| inline

Turns off intrinsic boundary alignment.

Definition at line 733 of file IFStreamBinary.h.

## ◆ boundaryAlignmentOn()

void geotess::IFStreamBinary::boundaryAlignmentOn | ( |  | ) |
| inline

Turns on intrinsic boundary alignment.

Definition at line 725 of file IFStreamBinary.h.

## ◆ byteOrderReverseOff()

void geotess::IFStreamBinary::byteOrderReverseOff | ( |  | ) |
| inline

Turns off byte order reversal.

Definition at line 700 of file IFStreamBinary.h.

## ◆ byteOrderReverseOn()

void geotess::IFStreamBinary::byteOrderReverseOn | ( |  | ) |
| inline

Turns on byte order reversal.

Definition at line 692 of file IFStreamBinary.h.

## ◆ checkBufferSize()

void geotess::IFStreamBinary::checkBufferSize | ( | int | sincr | ) |
| inlineprotected

This function checks to make sure that the buffer is large enough to contain sincr more bytes ... if not it is resized so that it can.

Definition at line 160 of file IFStreamBinary.h.

## ◆ className()

static string geotess::IFStreamBinary::className | ( |  | ) |
| inlinestatic

Definition at line 566 of file IFStreamBinary.h.

## ◆ classSize()

static int geotess::IFStreamBinary::classSize | ( |  | ) |
| inlinestatic

Definition at line 574 of file IFStreamBinary.h.

## ◆ clear()

void geotess::IFStreamBinary::clear | ( |  | ) |
| inline

Clears the buffer.

Definition at line 288 of file IFStreamBinary.h.

## ◆ decrementPos()

void geotess::IFStreamBinary::decrementPos | ( | int | decrement = `1` | ) |
| inline

Decrement the iterator position.

Definition at line 642 of file IFStreamBinary.h.

## ◆ dumpBuffer()

void geotess::IFStreamBinary::dumpBuffer | ( |  | ) |

Debug dump of the data.

## ◆ exists()

static bool geotess::IFStreamBinary::exists | ( | const string & | filename | ) |
| static

Static function that returns true if the input filename exists.

## ◆ getCapacity()

int geotess::IFStreamBinary::getCapacity | ( |  | ) | const
| inline

Return the allocated capacity of this IFStreamBinary.

Definition at line 658 of file IFStreamBinary.h.

## ◆ getData()

const string& geotess::IFStreamBinary::getData | ( |  | ) | const
| inline

Return a const reference to 'this' IFStreamBinarys data.

Definition at line 650 of file IFStreamBinary.h.

## ◆ getFileName()

const string& geotess::IFStreamBinary::getFileName | ( |  | ) | const
| inline

Return the file name with which this binary reader was opened

Definition at line 283 of file IFStreamBinary.h.

## ◆ getPos()

int geotess::IFStreamBinary::getPos | ( |  | ) | const
| inline

Get the current iterator position.

Definition at line 626 of file IFStreamBinary.h.

## ◆ getPosPointer() [1/2]

char* geotess::IFStreamBinary::getPosPointer | ( |  | ) |
| inline

Return a pointer at the current iterator location in the IFStreamBinary data.

Definition at line 667 of file IFStreamBinary.h.

## ◆ getPosPointer() [2/2]

char* geotess::IFStreamBinary::getPosPointer | ( | int | pos | ) |
| inline

Return a pointer to position pos in 'this' IFStreamBinarys data.

Definition at line 675 of file IFStreamBinary.h.

## ◆ incrementPos()

void geotess::IFStreamBinary::incrementPos | ( | int | increment = `1` | ) |
| inline

Increment the iterator position.

Definition at line 634 of file IFStreamBinary.h.

## ◆ isBoundaryAlignmentOn()

bool geotess::IFStreamBinary::isBoundaryAlignmentOn | ( |  | ) | const
| inline

Returns true if the byte order in reads and writes is reversed for all 2, 4, or 8 byte intrinsincs (short, int, long, float, double, etc.).

Definition at line 742 of file IFStreamBinary.h.

## ◆ isByteOrderReversalOn()

bool geotess::IFStreamBinary::isByteOrderReversalOn | ( |  | ) | const
| inline

Returns true if the byte order in reads and writes is reversed for all 2, 4, or 8 byte intrinsincs (short, int, long, float, double, etc.).

Definition at line 709 of file IFStreamBinary.h.

## ◆ operator=()

IFStreamBinary& geotess::IFStreamBinary::operator= | ( | const IFStreamBinary & | db | ) |

Assignment operator

## ◆ readBool() [1/2]

bool geotess::IFStreamBinary::readBool | ( |  | ) |
| inline

Read bool data. readBool() reads one bool from the IFStreamBinary and updates buffer iterator. The second form specifies where to read but does not update the iterator. The last form reads num_bool into the input array. readType is for templatization and behaves like readBool(). Similarly, readTypeArray behaves as readBoolArray.

Read in a single bool and return it.

Definition at line 820 of file IFStreamBinary.h.

## ◆ readBool() [2/2]

bool geotess::IFStreamBinary::readBool | ( | int | pos | ) |
| inline

Read in a single bool starting at the input position and return it. Don't check for alignment.

Definition at line 833 of file IFStreamBinary.h.

## ◆ readBoolArray()

void geotess::IFStreamBinary::readBoolArray | ( | bool * | array,
|  | int | num_bools
| ) |  |
| inline

Read in num_bools into the input array.

Definition at line 841 of file IFStreamBinary.h.

## ◆ readByte() [1/2]

byte geotess::IFStreamBinary::readByte | ( |  | ) |
| inline

Read byte data. readByte() reads one byte from the IFStreamBinary and updates buffer iterator. The second form specifies where to read but does not update the iterator. The last form reads num_bytes into the input array. readType is for templatization and behaves like readByte(). Similarly, readTypeArray behaves as readByteArray.

Read in a single byte and return it.

Definition at line 875 of file IFStreamBinary.h.

## ◆ readByte() [2/2]

byte geotess::IFStreamBinary::readByte | ( | int | pos | ) |
| inline

Read in a single byte starting at the input position and return it. Don't check for alignment.

Definition at line 888 of file IFStreamBinary.h.

## ◆ readByteArray()

void geotess::IFStreamBinary::readByteArray | ( | byte * | array,
|  | int | num_bytes
| ) |  |
| inline

Read in num_bytes into the input array.

Definition at line 896 of file IFStreamBinary.h.

## ◆ readCharArray() [1/2]

void geotess::IFStreamBinary::readCharArray | ( | char * | array,
|  | int | num_chars
| ) |  |
| inline

Read in num_chars to the presized character array

Definition at line 791 of file IFStreamBinary.h.

## ◆ readCharArray() [2/2]

void geotess::IFStreamBinary::readCharArray | ( | string & | s,
|  | int | num_chars
| ) |  |
| inline

Read in num_chars to the string s

Definition at line 782 of file IFStreamBinary.h.

## ◆ readDouble() [1/2]

double geotess::IFStreamBinary::readDouble | ( |  | ) |
| inline

Read double data. readDouble() reads one double from the IFStreamBinary and updates buffer iterator. The second form is like the first except that byte alignment is assumed to be ok (not checked). The third form specifies where to read but does not update the iterator or check alignment. The last form reads num_doubles into the input array. readType is for templatization and behaves like readDouble(). Similarly, readTypeArray behaves as readDoubleArray.

Read in a single double and return it.

Definition at line 1230 of file IFStreamBinary.h.

## ◆ readDouble() [2/2]

double geotess::IFStreamBinary::readDouble | ( | int | pos | ) |
| inline

Read in a single double starting at the input position and return it. Don't check for alignment.

Definition at line 1252 of file IFStreamBinary.h.

## ◆ readDoubleArray()

void geotess::IFStreamBinary::readDoubleArray | ( | double * | array,
|  | int | num_doubles
| ) |  |
| inline

Read in num_doubles into the input array.

Definition at line 1269 of file IFStreamBinary.h.

## ◆ readDoubleNC()

double geotess::IFStreamBinary::readDoubleNC | ( |  | ) |
| inline

Read in a single double and return it. Don't check for alignment.

Definition at line 1239 of file IFStreamBinary.h.

## ◆ readFloat() [1/2]

float geotess::IFStreamBinary::readFloat | ( |  | ) |
| inline

Read float data. readFloat() reads one float from the IFStreamBinary and updates buffer iterator. The second form is like the first except that byte alignment is assumed to be ok (not checked). The third form specifies where to read but does not update the iterator or check alignment. The last form reads num_floats into the input array. readType is for templatization and behaves like readFloat(). Similarly, readTypeArray behaves as readFloatArray.

Read in a single float and return it.

Definition at line 1155 of file IFStreamBinary.h.

## ◆ readFloat() [2/2]

float geotess::IFStreamBinary::readFloat | ( | int | pos | ) |
| inline

Read in a single float starting at the input position and return it. Don't check for alignment.

Definition at line 1177 of file IFStreamBinary.h.

## ◆ readFloatArray()

void geotess::IFStreamBinary::readFloatArray | ( | float * | array,
|  | int | num_floats
| ) |  |
| inline

Read in num_floats into the input array.

Definition at line 1194 of file IFStreamBinary.h.

## ◆ readFloatNC()

float geotess::IFStreamBinary::readFloatNC | ( |  | ) |
| inline

Read in a single float and return it. Don't check for alignment.

Definition at line 1164 of file IFStreamBinary.h.

## ◆ readFromFile() [1/3]

void geotess::IFStreamBinary::readFromFile | ( | const string & | filename | ) |

Read and fills the buffer from the input file name.

## ◆ readFromFile() [2/3]

void geotess::IFStreamBinary::readFromFile | ( | const string & | filename,
|  | int | num_bytes
| ) |  |

Read num_bytes from input file (Partial read).

## ◆ readFromFile() [3/3]

void geotess::IFStreamBinary::readFromFile | ( | ifstream & | ifs,
|  | int | num_bytes
| ) |  |

Reads num_bytes data from the input ifstream into this buffer. the read begins at position file_pos in the input stream. Reads num_bytes data from the input ifstream into this buffer.

## ◆ readInt() [1/2]

int geotess::IFStreamBinary::readInt | ( |  | ) |
| inline

Read int data. readInt() reads one int from the IFStreamBinary and updates buffer iterator. The second form is like the first except that byte alignment is assumed to be ok (not checked). The third form specifies where to read but does not update the iterator or check alignment. The last form reads num_ints into the input array. readType is for templatization and behaves like readInt(). Similarly, readTypeArray behaves as readIntArray.

Read in a single int and return it.

Definition at line 1005 of file IFStreamBinary.h.

## ◆ readInt() [2/2]

int geotess::IFStreamBinary::readInt | ( | int | pos | ) |
| inline

Read in a single int starting at the input position and return it. Don't check for alignment.

Definition at line 1027 of file IFStreamBinary.h.

## ◆ readIntArray()

void geotess::IFStreamBinary::readIntArray | ( | int * | array,
|  | int | num_ints
| ) |  |
| inline

Read in num_ints into the input array.

Definition at line 1044 of file IFStreamBinary.h.

## ◆ readIntNC()

int geotess::IFStreamBinary::readIntNC | ( |  | ) |
| inline

Read in a single int and return it. Don't check for alignment.

Definition at line 1014 of file IFStreamBinary.h.

## ◆ readLong() [1/2]

LONG_INT geotess::IFStreamBinary::readLong | ( |  | ) |
| inline

Read long data. readLong() reads one long from the IFStreamBinary and updates buffer iterator. The second form is like the first except that byte alignment is assumed to be ok (not checked). The third form specifies where to read but does not update the iterator or check alignment. The last form reads num_longs into the input array. readType is for templatization and behaves like readLong(). Similarly, readTypeArray behaves as readLongArray.

Read in a single long and return it.

Definition at line 1080 of file IFStreamBinary.h.

## ◆ readLong() [2/2]

LONG_INT geotess::IFStreamBinary::readLong | ( | int | pos | ) |
| inline

Read in a single long starting at the input position and return it. Don't check for alignment.

Definition at line 1102 of file IFStreamBinary.h.

## ◆ readLongArray()

void geotess::IFStreamBinary::readLongArray | ( | LONG_INT * | array,
|  | int | num_longs
| ) |  |
| inline

Read in num_longs into the input array.

Definition at line 1119 of file IFStreamBinary.h.

## ◆ readLongNC()

LONG_INT geotess::IFStreamBinary::readLongNC | ( |  | ) |
| inline

Read in a single long and return it. Don't check for alignment.

Definition at line 1089 of file IFStreamBinary.h.

## ◆ readShort() [1/2]

short geotess::IFStreamBinary::readShort | ( |  | ) |
| inline

Read short data. readShort() reads one short from the IFStreamBinary and updates buffer iterator. The second form is like the first except that byte alignment is assumed to be ok (not checked). The third form specifies where to read but does not update the iterator or check alignment. The last form reads num_shorts into the input array. readType is for templatization and behaves like readShort(). Similarly, readTypeArray behaves as readShortArray.

Read in a single short and return it.

Definition at line 930 of file IFStreamBinary.h.

## ◆ readShort() [2/2]

short geotess::IFStreamBinary::readShort | ( | int | pos | ) |
| inline

Read in a single short starting at the input position and return it. Don't check for alignment.

Definition at line 952 of file IFStreamBinary.h.

## ◆ readShortArray()

void geotess::IFStreamBinary::readShortArray | ( | short * | array,
|  | int | num_shorts
| ) |  |
| inline

Read in num_shorts into the input array.

Definition at line 969 of file IFStreamBinary.h.

## ◆ readShortNC()

short geotess::IFStreamBinary::readShortNC | ( |  | ) |
| inline

Read in a single short and return it. Don't check for alignment.

Definition at line 939 of file IFStreamBinary.h.

## ◆ readString() [1/2]

string geotess::IFStreamBinary::readString | ( |  | ) |
| inline

Read string data. readString() assumes the string length immediately precedes the string data. readString(string& s) is the same as the first but assigns the string to the input reference. The next two functions read in num_chars and assign them into the input string reference s, or presized character array, respectively. The functions readType* are for templatized access.

Read in a single string and return it.

Definition at line 754 of file IFStreamBinary.h.

## ◆ readString() [2/2]

void geotess::IFStreamBinary::readString | ( | string & | s | ) |
| inline

Read in a string and assign it to s.

Definition at line 764 of file IFStreamBinary.h.

## ◆ readType() [1/8]

void geotess::IFStreamBinary::readType | ( | bool & | b | ) |
| inline

Read in a single bool and assign to s.

Definition at line 857 of file IFStreamBinary.h.

## ◆ readType() [2/8]

void geotess::IFStreamBinary::readType | ( | byte & | b | ) |
| inline

Read in a single byte and assign to s.

Definition at line 912 of file IFStreamBinary.h.

## ◆ readType() [3/8]

void geotess::IFStreamBinary::readType | ( | double & | d | ) |
| inline

Read in a single double and assign to d.

Definition at line 1287 of file IFStreamBinary.h.

## ◆ readType() [4/8]

void geotess::IFStreamBinary::readType | ( | float & | f | ) |
| inline

Read in a single float and assign to f.

Definition at line 1212 of file IFStreamBinary.h.

## ◆ readType() [5/8]

void geotess::IFStreamBinary::readType | ( | int & | i | ) |
| inline

Read in a single int and assign to i.

Definition at line 1062 of file IFStreamBinary.h.

## ◆ readType() [6/8]

void geotess::IFStreamBinary::readType | ( | LONG_INT & | l | ) |
| inline

Read in a single long and assign to l.

Definition at line 1137 of file IFStreamBinary.h.

## ◆ readType() [7/8]

void geotess::IFStreamBinary::readType | ( | short & | s | ) |
| inline

Read in a single short and assign to s.

Definition at line 987 of file IFStreamBinary.h.

## ◆ readType() [8/8]

void geotess::IFStreamBinary::readType | ( | string & | s | ) |
| inline

Read in a string and assign it to s.

Definition at line 802 of file IFStreamBinary.h.

## ◆ readTypeArray() [1/8]

void geotess::IFStreamBinary::readTypeArray | ( | bool * | array,
|  | int | num_bools
| ) |  |
| inline

Read in num_bools into the input array.

Definition at line 865 of file IFStreamBinary.h.

## ◆ readTypeArray() [2/8]

void geotess::IFStreamBinary::readTypeArray | ( | byte * | array,
|  | int | num_bytes
| ) |  |
| inline

Read in num_bytes into the input array.

Definition at line 920 of file IFStreamBinary.h.

## ◆ readTypeArray() [3/8]

void geotess::IFStreamBinary::readTypeArray | ( | double * | array,
|  | int | num_doubles
| ) |  |
| inline

Read in num_doubles into the input array.

Definition at line 1295 of file IFStreamBinary.h.

## ◆ readTypeArray() [4/8]

void geotess::IFStreamBinary::readTypeArray | ( | float * | array,
|  | int | num_floats
| ) |  |
| inline

Read in num_floats into the input array.

Definition at line 1220 of file IFStreamBinary.h.

## ◆ readTypeArray() [5/8]

void geotess::IFStreamBinary::readTypeArray | ( | int * | array,
|  | int | num_ints
| ) |  |
| inline

Read in num_ints into the input array.

Definition at line 1070 of file IFStreamBinary.h.

## ◆ readTypeArray() [6/8]

void geotess::IFStreamBinary::readTypeArray | ( | LONG_INT * | array,
|  | int | num_longs
| ) |  |
| inline

Read in num_longs into the input array.

Definition at line 1145 of file IFStreamBinary.h.

## ◆ readTypeArray() [7/8]

void geotess::IFStreamBinary::readTypeArray | ( | short * | array,
|  | int | num_shorts
| ) |  |
| inline

Read in num_shorts into the input array.

Definition at line 995 of file IFStreamBinary.h.

## ◆ readTypeArray() [8/8]

void geotess::IFStreamBinary::readTypeArray | ( | string & | s,
|  | int | num_chars
| ) |  |
| inline

Read in num_chars to the string s

Definition at line 810 of file IFStreamBinary.h.

## ◆ reserve()

void geotess::IFStreamBinary::reserve | ( | int | sze | ) |
| inline

Sets the storage capacity. Attained on next required resize.

Definition at line 591 of file IFStreamBinary.h.

## ◆ resetPos()

void geotess::IFStreamBinary::resetPos | ( |  | ) |
| inline

Reset the current iterator position to the beginning of the buffer.

Definition at line 608 of file IFStreamBinary.h.

## ◆ reSize()

void geotess::IFStreamBinary::reSize | ( | int | spc | ) |
| inline

This function allocates spc bytes in the buffer. Used to minimize reallocation.

Definition at line 583 of file IFStreamBinary.h.

## ◆ reverseBO2()

void geotess::IFStreamBinary::reverseBO2 | ( | char * | d | ) |
| inlinestaticprotected

Reverses byte order of d. d is assumed to point to an 2 byte element.

Definition at line 1910 of file IFStreamBinary.h.

## ◆ reverseBO2Array()

static void geotess::IFStreamBinary::reverseBO2Array | ( | int | n,
|  | char * | a
| ) |  |
| staticprotected

## ◆ reverseBO4()

void geotess::IFStreamBinary::reverseBO4 | ( | char * | d | ) |
| inlinestaticprotected

Reverses byte order of d. d is assumed to point to an 4 byte element.

Definition at line 1920 of file IFStreamBinary.h.

## ◆ reverseBO4Array()

static void geotess::IFStreamBinary::reverseBO4Array | ( | int | n,
|  | char * | a
| ) |  |
| staticprotected

## ◆ reverseBO8()

void geotess::IFStreamBinary::reverseBO8 | ( | char * | d | ) |
| inlinestaticprotected

Reverses byte order of d. d is assumed to point to an 8 byte element.

Definition at line 1934 of file IFStreamBinary.h.

## ◆ reverseBO8Array()

static void geotess::IFStreamBinary::reverseBO8Array | ( | int | n,
|  | char * | a
| ) |  |
| staticprotected

## ◆ reverseBOArray()

static void geotess::IFStreamBinary::reverseBOArray | ( | int | n,
|  | char * | a,
|  | int | s
| ) |  |
| staticprotected

## ◆ setBoundaryAlignment()

void geotess::IFStreamBinary::setBoundaryAlignment | ( | bool | align | ) |
| inline

Sets the intrinsic boundary alignment flag to align.

Definition at line 717 of file IFStreamBinary.h.

## ◆ setByteOrderReverse()

void geotess::IFStreamBinary::setByteOrderReverse | ( | bool | bor | ) |
| inline

Sets the byte order reverse flag to bor.

Definition at line 684 of file IFStreamBinary.h.

## ◆ setMemoryCapacityIncrement()

void geotess::IFStreamBinary::setMemoryCapacityIncrement | ( | int | mci | ) |
| inline

Set the amount of memory increase (bytes) for bData everytime it's current capacity is exceeded (defaults to 1MB = 1000000).

Definition at line 299 of file IFStreamBinary.h.

## ◆ setPosToEnd()

void geotess::IFStreamBinary::setPosToEnd | ( |  | ) |
| inline

Set the current iterator position to the end of the buffer.

Definition at line 617 of file IFStreamBinary.h.

## ◆ size()

int geotess::IFStreamBinary::size | ( |  | ) |
| inline

Returns the IFStreamBinary size.

Definition at line 599 of file IFStreamBinary.h.

## ◆ writeBool() [1/2]

void geotess::IFStreamBinary::writeBool | ( | bool | b | ) |
| inline

Write bool data. writeBool writes one byte to the IFStreamBinary and updates buffer iterator. The second form is like the first except that sufficient buffer size is not checked. The third form simply writes the data at the input position (pos) but does not check for buffer size, nor does it update the internal buffer iterator. The last method writes num_bools from the input array into 'this' IFStreamBinary. writeType is for templatization and behaves like writeBool. Similarly, writeTypeArray behaves like writeBoolArray.

Write the input bool at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1375 of file IFStreamBinary.h.

## ◆ writeBool() [2/2]

void geotess::IFStreamBinary::writeBool | ( | bool | b,
|  | int | pos
| ) |  |
| inline

Write the input bool at the input buffer position. Don't check for alignment or sufficient buffer size. Don't update the internal buffer position.

Definition at line 1398 of file IFStreamBinary.h.

## ◆ writeBoolArray()

void geotess::IFStreamBinary::writeBoolArray | ( | const bool * | array,
|  | int | num_bools
| ) |  |
| inline

Write num_bools from the input bool array to the output buffer.

Definition at line 1406 of file IFStreamBinary.h.

## ◆ writeBoolNC()

void geotess::IFStreamBinary::writeBoolNC | ( | bool | b | ) |
| inline

Write the input bool at the current buffer position. Don't check for alignment or sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1387 of file IFStreamBinary.h.

## ◆ writeByte() [1/2]

void geotess::IFStreamBinary::writeByte | ( | byte | b | ) |
| inline

Write byte data. writeByte writes one byte to the IFStreamBinary and updates buffer iterator. The second form is like the first except that sufficient buffer size is not checked. The third form simply writes the data at the input position (pos) but does not check for buffer size, nor does it update the internal buffer iterator. The last method writes num_bytes from the input array into 'this' IFStreamBinary. writeType is for templatization and behaves like writeByte. Similarly, writeTypeArray behaves like writeByteArray.

Write the input byte at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1446 of file IFStreamBinary.h.

## ◆ writeByte() [2/2]

void geotess::IFStreamBinary::writeByte | ( | byte | b,
|  | int | pos
| ) |  |
| inline

Write the input byte at the input buffer position. Don't check for alignment or sufficient buffer size. Don't update the internal buffer position.

Definition at line 1469 of file IFStreamBinary.h.

## ◆ writeByteArray()

void geotess::IFStreamBinary::writeByteArray | ( | const byte * | array,
|  | int | num_bytes
| ) |  |
| inline

Write num_bytes from the input byte array to the output buffer.

Definition at line 1477 of file IFStreamBinary.h.

## ◆ writeByteNC()

void geotess::IFStreamBinary::writeByteNC | ( | byte | b | ) |
| inline

Write the input byte at the current buffer position. Don't check for alignment or sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1458 of file IFStreamBinary.h.

## ◆ writeCharArray()

void geotess::IFStreamBinary::writeCharArray | ( | const char * | array,
|  | int | num_chars
| ) |  |
| inline

Write num_chars from the input character array to the output buffer.

Definition at line 1337 of file IFStreamBinary.h.

## ◆ writeDouble() [1/2]

void geotess::IFStreamBinary::writeDouble | ( | double | d | ) |
| inline

Write double data. writeDouble writes one double to the IFStreamBinary and updates buffer iterator. The second form is like the first except that byte alignment and sufficient buffer size are not checked. The third form simply writes the data at the input position (pos) but does not check for alignment, buffer size, nor does it update the internal buffer iterator. The last method writes num_doubles from the input array into 'this' IFStreamBinary. writeType is for templatization and behaves like writeDouble. Similarly, writeTypeArray behaves like writeDoubleArray.

Write the input double at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1833 of file IFStreamBinary.h.

## ◆ writeDouble() [2/2]

void geotess::IFStreamBinary::writeDouble | ( | double | d,
|  | int | pos
| ) |  |
| inline

Write the input double at the input buffer position. Don't check for alignment or sufficient buffer size. Don't update the internal buffer position.

Definition at line 1857 of file IFStreamBinary.h.

## ◆ writeDoubleArray()

void geotess::IFStreamBinary::writeDoubleArray | ( | const double * | array,
|  | int | num_doubles
| ) |  |
| inline

Write num_doubles from the input double array to the output buffer.

Definition at line 1870 of file IFStreamBinary.h.

## ◆ writeDoubleNC()

void geotess::IFStreamBinary::writeDoubleNC | ( | double | d | ) |
| inline

Write the input double at the current buffer position. Don't check for alignment or sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1846 of file IFStreamBinary.h.

## ◆ writeFloat() [1/2]

void geotess::IFStreamBinary::writeFloat | ( | float | f | ) |
| inline

Write float data. writeFloat writes one float to the IFStreamBinary and updates buffer iterator. The second form is like the first except that byte alignment and sufficient buffer size are not checked. The third form simply writes the data at the input position (pos) but does not check for alignment, buffer size, nor does it update the internal buffer iterator. The last method writes num_floats from the input array into 'this' IFStreamBinary. writeType is for templatization and behaves like writeFloat. Similarly, writeTypeArray behaves like writeFloatArray.

Write the input float at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1754 of file IFStreamBinary.h.

## ◆ writeFloat() [2/2]

void geotess::IFStreamBinary::writeFloat | ( | float | f,
|  | int | pos
| ) |  |
| inline

Write the input float at the input buffer position. Don't check for alignment or sufficient buffer size. Don't update the internal buffer position.

Definition at line 1778 of file IFStreamBinary.h.

## ◆ writeFloatArray()

void geotess::IFStreamBinary::writeFloatArray | ( | const float * | array,
|  | int | num_floats
| ) |  |
| inline

Write num_floats from the input float array to the output buffer.

Definition at line 1791 of file IFStreamBinary.h.

## ◆ writeFloatNC()

void geotess::IFStreamBinary::writeFloatNC | ( | float | f | ) |
| inline

Write the input float at the current buffer position. Don't check for alignment or sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1767 of file IFStreamBinary.h.

## ◆ writeInt() [1/2]

void geotess::IFStreamBinary::writeInt | ( | int | i | ) |
| inline

Write int data. writeInt writes one int to the IFStreamBinary and updates buffer iterator. The second form is like the first except that byte alignment and sufficient buffer size are not checked. The third form simply writes the data at the input position (pos) but does not check for alignment, buffer size, nor does it update the internal buffer iterator. The last method writes num_ints from the input array into 'this' IFStreamBinary. writeType is for templatization and behaves like writeInt. Similarly, writeTypeArray behaves like writeIntArray.

Write the input int at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1596 of file IFStreamBinary.h.

## ◆ writeInt() [2/2]

void geotess::IFStreamBinary::writeInt | ( | int | i,
|  | int | pos
| ) |  |
| inline

Write the input int at the input buffer position. Don't check for alignment or sufficient buffer size. Don't update the internal buffer position.

Definition at line 1620 of file IFStreamBinary.h.

## ◆ writeIntArray()

void geotess::IFStreamBinary::writeIntArray | ( | const int * | array,
|  | int | num_ints
| ) |  |
| inline

Write num_ints from the input int array to the output buffer.

Definition at line 1633 of file IFStreamBinary.h.

## ◆ writeIntNC()

void geotess::IFStreamBinary::writeIntNC | ( | int | i | ) |
| inline

Write the input int at the current buffer position. Don't check for alignment or sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1609 of file IFStreamBinary.h.

## ◆ writeLong() [1/2]

void geotess::IFStreamBinary::writeLong | ( | LONG_INT | l | ) |
| inline

Write long data. writeLong writes one long to the IFStreamBinary and updates buffer iterator. The second form is like the first except that byte alignment and sufficient buffer size are not checked. The third form simply writes the data at the input position (pos) but does not check for alignment, buffer size, nor does it update the internal buffer iterator. The last method writes num_longs from the input array into 'this' IFStreamBinary. writeType is for templatization and behaves like writeLong. Similarly, writeTypeArray behaves like writeLongArray.

Write the input long at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1675 of file IFStreamBinary.h.

## ◆ writeLong() [2/2]

void geotess::IFStreamBinary::writeLong | ( | LONG_INT | l,
|  | int | pos
| ) |  |
| inline

Write the input long at the input buffer position. Don't check for alignment or sufficient buffer size. Don't update the internal buffer position.

Definition at line 1699 of file IFStreamBinary.h.

## ◆ writeLongArray()

void geotess::IFStreamBinary::writeLongArray | ( | const LONG_INT * | array,
|  | int | num_longs
| ) |  |
| inline

Write num_longs from the input long array to the output buffer.

Definition at line 1712 of file IFStreamBinary.h.

## ◆ writeLongNC()

void geotess::IFStreamBinary::writeLongNC | ( | LONG_INT | l | ) |
| inline

Write the input long at the current buffer position. Don't check for alignment or sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1688 of file IFStreamBinary.h.

## ◆ writeShort() [1/2]

void geotess::IFStreamBinary::writeShort | ( | short | s | ) |
| inline

Write short data. writeShort writes one short to the IFStreamBinary and updates buffer iterator. The second form is like the first except that byte alignment and sufficient buffer size are not checked. The third form simply writes the data at the input position (pos) but does not check for alignment, buffer size, nor does it update the internal buffer iterator. The last method writes num_shorts from the input array into 'this' IFStreamBinary. writeType is for templatization and behaves like writeShort. Similarly, writeTypeArray behaves like writeShortArray.

Write the input short at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1517 of file IFStreamBinary.h.

## ◆ writeShort() [2/2]

void geotess::IFStreamBinary::writeShort | ( | short | s,
|  | int | pos
| ) |  |
| inline

Write the input short at the input buffer position. Don't check for alignment or sufficient buffer size. Don't update the internal buffer position.

Definition at line 1541 of file IFStreamBinary.h.

## ◆ writeShortArray()

void geotess::IFStreamBinary::writeShortArray | ( | const short * | array,
|  | int | num_shorts
| ) |  |
| inline

Write num_shorts from the input short array to the output buffer.

Definition at line 1554 of file IFStreamBinary.h.

## ◆ writeShortNC()

void geotess::IFStreamBinary::writeShortNC | ( | short | s | ) |
| inline

Write the input short at the current buffer position. Don't check for alignment or sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1530 of file IFStreamBinary.h.

## ◆ writeString() [1/2]

void geotess::IFStreamBinary::writeString | ( | const char * | char_string | ) |
| inline

Write the null terminated character string at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit. Both the string size (int) and its data are written.

Definition at line 1328 of file IFStreamBinary.h.

## ◆ writeString() [2/2]

void geotess::IFStreamBinary::writeString | ( | const string & | str | ) |
| inline

Write string data to 'this' IFStreamBinary. The two writeString functions first writes the the input string length immediately followed by the string data. The next function writes num_chars from the input character array into 'this' IFStreamBinary. readType is for templatization and behaves like readString(). Similarly, readTypeArray behaves like readCharArray.

Write the input string at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit. Both the string size (int) and the strings data are written.

Definition at line 1308 of file IFStreamBinary.h.

## ◆ writeToFile() [1/2]

void geotess::IFStreamBinary::writeToFile | ( | const string & | filename | ) |

Write the buffer to the output file name.

## ◆ writeToFile() [2/2]

void geotess::IFStreamBinary::writeToFile | ( | ofstream & | ofs | ) |

Write the buffer to the output stream.

## ◆ writeType() [1/9]

void geotess::IFStreamBinary::writeType | ( | bool | b | ) |
| inline

Write the input bool at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1426 of file IFStreamBinary.h.

## ◆ writeType() [2/9]

void geotess::IFStreamBinary::writeType | ( | byte | b | ) |
| inline

Write the input byte at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1497 of file IFStreamBinary.h.

## ◆ writeType() [3/9]

void geotess::IFStreamBinary::writeType | ( | const char * | char_string | ) |
| inline

Write the null terminated character string at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit. Both the string size (int) and its data are written.

Definition at line 1363 of file IFStreamBinary.h.

## ◆ writeType() [4/9]

void geotess::IFStreamBinary::writeType | ( | const string & | str | ) |
| inline

Write the input string at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit. Both the string size (int) and the strings data are written.

Definition at line 1353 of file IFStreamBinary.h.

## ◆ writeType() [5/9]

void geotess::IFStreamBinary::writeType | ( | double | d | ) |
| inline

Write the input double at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1892 of file IFStreamBinary.h.

## ◆ writeType() [6/9]

void geotess::IFStreamBinary::writeType | ( | float | f | ) |
| inline

Write the input float at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1813 of file IFStreamBinary.h.

## ◆ writeType() [7/9]

void geotess::IFStreamBinary::writeType | ( | int | i | ) |
| inline

Write the input int at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1655 of file IFStreamBinary.h.

## ◆ writeType() [8/9]

void geotess::IFStreamBinary::writeType | ( | LONG_INT | l | ) |
| inline

Write the input long at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1734 of file IFStreamBinary.h.

## ◆ writeType() [9/9]

void geotess::IFStreamBinary::writeType | ( | short | s | ) |
| inline

Write the input short at the current buffer position. Ensure alignment and sufficient buffer size. Increment the internal buffer position on exit.

Definition at line 1576 of file IFStreamBinary.h.

## ◆ writeTypeArray() [1/7]

void geotess::IFStreamBinary::writeTypeArray | ( | const bool * | array,
|  | int | num_bools
| ) |  |
| inline

Write num_bools from the input bool array to the output buffer.

Definition at line 1434 of file IFStreamBinary.h.

## ◆ writeTypeArray() [2/7]

void geotess::IFStreamBinary::writeTypeArray | ( | const byte * | array,
|  | int | num_bytes
| ) |  |
| inline

Write num_bytes from the input byte array to the output buffer.

Definition at line 1505 of file IFStreamBinary.h.

## ◆ writeTypeArray() [3/7]

void geotess::IFStreamBinary::writeTypeArray | ( | const double * | array,
|  | int | num_doubles
| ) |  |
| inline

Write num_doubles from the input double array to the output buffer.

Definition at line 1900 of file IFStreamBinary.h.

## ◆ writeTypeArray() [4/7]

void geotess::IFStreamBinary::writeTypeArray | ( | const float * | array,
|  | int | num_floats
| ) |  |
| inline

Write num_floats from the input float array to the output buffer.

Definition at line 1821 of file IFStreamBinary.h.

## ◆ writeTypeArray() [5/7]

void geotess::IFStreamBinary::writeTypeArray | ( | const int * | array,
|  | int | num_ints
| ) |  |
| inline

Write num_ints from the input int array to the output buffer.

Definition at line 1663 of file IFStreamBinary.h.

## ◆ writeTypeArray() [6/7]

void geotess::IFStreamBinary::writeTypeArray | ( | const LONG_INT * | array,
|  | int | num_longs
| ) |  |
| inline

Write num_longs from the input long array to the output buffer.

Definition at line 1742 of file IFStreamBinary.h.

## ◆ writeTypeArray() [7/7]

void geotess::IFStreamBinary::writeTypeArray | ( | const short * | array,
|  | int | num_shorts
| ) |  |
| inline

Write num_shorts from the input short array to the output buffer.

Definition at line 1584 of file IFStreamBinary.h.

## Member Data Documentation

## ◆ bAlign

bool geotess::IFStreamBinary::bAlign
| protected

A boolean, that if true, maintains 4 and 8 byte alignment in support of double alignment compilation.

Definition at line 104 of file IFStreamBinary.h.

## ◆ bData

string* geotess::IFStreamBinary::bData
| protected

A string object is used to contain the actual data.

Definition at line 88 of file IFStreamBinary.h.

## ◆ bDataPos

int geotess::IFStreamBinary::bDataPos
| protected

The current iterator position in the data container (dbData).

Definition at line 93 of file IFStreamBinary.h.

## ◆ bFileName

string geotess::IFStreamBinary::bFileName
| protected

Definition at line 122 of file IFStreamBinary.h.

## ◆ bMemIncr

int geotess::IFStreamBinary::bMemIncr
| protected

Definition at line 124 of file IFStreamBinary.h.

## ◆ bOwnStr

bool geotess::IFStreamBinary::bOwnStr
| protected

A boolean, that if true, indicates the storage string for this IFStreamBinary is owned and therefore deleted when the IFStreamBinary is deleted.

Definition at line 120 of file IFStreamBinary.h.

## ◆ bReverse

bool geotess::IFStreamBinary::bReverse
| protected

A boolean, that if true, reverses the byte order of all 2, 4, and 8 byte intrinsics (shorts, ints, long, floats, doubles, etc.). This flag is set by client using this IFStreamBinary (default to false ... no reversal). The flag is used to convert byte order between big- and little- endian formats.

Definition at line 113 of file IFStreamBinary.h.

## ◆ bSize

int geotess::IFStreamBinary::bSize
| protected

The current size of the data container.

Definition at line 98 of file IFStreamBinary.h.

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

- rstt/GeoTessCPP/include/IFStreamBinary.h