A byte array container used to hold binary data in the same manner as disk based file system.
More...
|
| DataBuffer () |
|
| DataBuffer (bool doPad) |
|
| DataBuffer (string *str) |
|
| DataBuffer (const DataBuffer &db) |
|
virtual | ~DataBuffer () |
|
DataBuffer & | operator= (const DataBuffer &db) |
|
void | dumpBuffer () |
|
void | writeToFile (ofstream &ofs) |
|
void | writeToFile (fstream &ofs) |
|
void | readFromFile (fstream &ifs, int num_bytes) |
|
void | readFromFile (ifstream &ifs, int num_bytes) |
|
void | readFromFile (fstream &ifs, int64 filePos, int num_bytes) |
|
void | readFromFile (ifstream &ifs, int64 filePos, int num_bytes) |
|
const string & | readMD5HashKey () |
|
string | generateMD5HashKey () |
|
string | generateDataBufMD5HashKey () |
|
void | align4Byte () |
| Aligns the DataBuffer position pointer on a 4 byte boundary if it is not currently aligned as such. More...
|
|
void | align8Byte () |
| Aligns the DataBuffer position pointer on an 8 byte boundary if it is not currently aligned as such. More...
|
|
void | checkBufferSize (int sincr) |
| Checks the current buffer storage size and increments to see if it can contain sincr more bytes. If not it increments the size so that sincr bytes can be added safely. More...
|
|
void | clear () |
| Clear the DataBuffer. More...
|
|
const string & | readString () |
| Read a string and return a reference to be assigned to another string in the client. This function assumes the length of the string occurs imediately before the actual string data. More...
|
|
void | readString (string &str, int num_chars) |
| Read num_chars from 'this' databuffer into the input string, str. More...
|
|
void | readCharArray (char *array, int num_chars) |
| Read num_chars characters from 'this' DataBuffer into /em array. More...
|
|
uByte | readByte () |
| Read a byte from the buffer and update the iterator. More...
|
|
uByte | readByte (int pos) |
| Read a byte from the positions specified by pos ... doesn't update dbDataPos. More...
|
|
void | readByteArray (uByte *array, int num_bytes) |
| Read num_bytes characters from 'this' DataBuffer into array. More...
|
|
bool | readBool () |
| Read a bool from the buffer and update the iterator. More...
|
|
bool | readBool (int pos) |
| Read a bool from the positions specified by pos ... doesn't update dbDataPos. More...
|
|
void | readBoolArray (bool *array, int num_bools) |
| Read num_bools booleans from 'this' DataBuffer into array. More...
|
|
int | readInt32 () |
| Read an int from the buffer. Make sure the buffer is 4byte alligned before reading. More...
|
|
int | readInt32 (int pos) |
| Read the int from the positions specified by pos ... doesn't update dbDataPos. More...
|
|
int | readRawInt32 () |
| Read an Int32 ... don't check for alignment ... fast but client is responsible for alignment. More...
|
|
void | readIntArray (int *array, int num_ints) |
| Read num_ints integers from 'this' DataBuffer into array. More...
|
|
int64 | readInt64 () |
| Read a long from the buffer. Make sure the buffer is 8byte alligned before reading. More...
|
|
int64 | readInt64 (int pos) |
| Read the long from the positions specified by pos ... doesn't update dbDataPos. More...
|
|
int64 | readRawInt64 () |
| Read a long ... don't check for alignment ... fast but client is responsible for alignment. More...
|
|
void | readLongArray (int64 *array, int num_longs) |
| Read num_longs int64s from 'this' DataBuffer into array. More...
|
|
float | readFloat () |
| Read a float from the buffer. Make sure the buffer is 4byte alligned before reading. More...
|
|
float | readFloat (int pos) |
| Read the float from the positions specified by pos ... doesn't update dbDataPos. More...
|
|
float | readRawFloat () |
| Read a float ... don't check for alignment ... fast but client is responsible for alignment. More...
|
|
void | readFloatArray (float *array, int num_floats) |
| Read num_floats floats from 'this' DataBuffer into array. More...
|
|
double | readDouble () |
| Read a double from the buffer. Make sure the buffer is 8byte alligned before reading. More...
|
|
double | readDouble (int pos) |
| Just read the double from the positions specified by pos ... doesn't update dbDataPos. More...
|
|
double | readRawDouble () |
| Read a double ... don't check for alignment ... fast but client is responsible for alignment. More...
|
|
void | readDoubleArray (double *array, int num_doubles) |
| Read num_doubles doubles from 'this' DataBuffer into array. More...
|
|
void | writeString (const string &in_string) |
| Write the string in_string into 'this' DataBuffer. More...
|
|
void | writeString (char *char_string) |
| Write the string char_string into 'this' DataBuffer. More...
|
|
void | writeCharArray (const char *array, int num_chars) |
| Write num_chars of the character array into 'this' DataBuffer. More...
|
|
void | writeByte (uByte b) |
| Write a byte (b) to the DataBuffer. Make sure the buffer is sized appropriately before writing. More...
|
|
void | writeByte (uByte b, int pos) |
| Write a uByte (b) at databuffer position pos. Does not update the iterator. More...
|
|
void | writeRawByte (uByte b) |
| Write a uByte (b) ... don't check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly. More...
|
|
void | writeByteArray (const uByte *array, int num_bytes) |
| Write num_bytes uBytes from the input array into 'this' DataBuffer. More...
|
|
void | writeBool (bool b) |
| Write a bool (b) to the DataBuffer. Make sure the buffer is sized appropriately before writing. More...
|
|
void | writeBool (bool b, int pos) |
| Write a bool (b) at databuffer position pos. Does not update the iterator. More...
|
|
void | writeRawBool (bool b) |
| Write a bool (b) ... do not check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly. More...
|
|
void | writeBoolArray (const bool *array, int num_bools) |
| Write num_bools bools from the input array into 'this' DataBuffer. More...
|
|
void | writeInt32 (int i) |
| Write an Int32 (i) to the DataBuffer. Make sure the buffer is 4byte alligned and sized appropriatly before reading. More...
|
|
void | writeInt32 (int i, int pos) |
| Write an int (i) at databuffer position pos. Do not update the iterator. More...
|
|
void | writeRawInt32 (int i) |
| Write an Int32 (i) ... do not check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly. More...
|
|
void | writeIntArray (const int *array, int num_ints) |
| Write num_ints ints from the input array into 'this' DataBuffer. More...
|
|
void | writeInt64 (int64 i) |
| Write an Int64 (i) to the DataBuffer. Make sure the buffer is 8byte alligned and sized appropriatly before reading. More...
|
|
void | writeInt64 (int64 i, int pos) |
| Write a long (i) at databuffer position pos. Does not update the iterator. More...
|
|
void | writeRawInt64 (int64 i) |
| Write an Int64 (i) ... don't check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly. More...
|
|
void | writeLongArray (const int64 *array, int num_longs) |
| Write num_longs longs from the input array into 'this' DataBuffer. More...
|
|
void | writeFloat (float f) |
| Write a float (f) to the DataBuffer. Make sure the buffer is 4byte alligned and sized appropriatly before reading. More...
|
|
void | writeFloat (float f, int pos) |
| Write a float (f) at databuffer position pos. Does not update the iterator. More...
|
|
void | writeRawFloat (float f) |
| Write a float (f) ... do not check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly. More...
|
|
void | writeFloatArray (const float *array, int num_floats) |
| Write num_floats floats from the input array into 'this' DataBuffer. More...
|
|
void | writeDouble (double d) |
| Write a double (d) to the DataBuffer. Make sure the buffer is 8byte alligned and sized appropriatly before reading. More...
|
|
void | writeDouble (double d, int pos) |
| Write a double (d) at databuffer position pos. Does not update the iterator. More...
|
|
void | writeRawDouble (double d) |
| Write a double (d) ... do not check for alignment or size ... fast but the client is responsible for handling alignment and sizing correctly. More...
|
|
void | writeDoubleArray (const double *array, int num_doubles) |
| Write num_doubles doubles from the input array into 'this' DataBuffer. More...
|
|
virtual string | get_class_name () const |
| Returns the class name. More...
|
|
virtual int | class_size () const |
| Returns the class size (in bytes). More...
|
|
void | setSize (int num_bytes) |
| Set the size of the data buffer to num_bytes. More...
|
|
int | size () |
| Return the current DataBuffer size. More...
|
|
void | resetPos () |
| Reset the buffers iterator location to zero. More...
|
|
void | setPosToEnd () |
| Set the buffers iterator position to dbSize. If current iterator exceeds dbsize then dbsize is set and dbDataPos is unchanged. More...
|
|
int | getPos () const |
| Return the buffers iterator location. More...
|
|
void | incrementPos (int increment) |
| Increment the buffers iterator by increment bytes. This is an unsafe operation. If dbDataPos + increment > dbSize. dbSize is NOT checked. More...
|
|
void | decrementPos (int decrement) |
| Decrement the buffers iterator by decrement bytes. This is an unsafe operation. If dbDataPos - decrement < 0. More...
|
|
string | getData () const |
| Return a reference to the DataBuffer. More...
|
|
int | getCapacity () const |
| Return allocated capacity of 'this' DataBuffer. More...
|
|
char * | getPosPointer () |
| Return a pointer to the current iterator location in the buffer. More...
|
|
char * | getPosPointer (int pos) |
| Return a Pointer to position pos in the buffer. More...
|
|
void | setByteOrderReverse (bool bor) |
| Sets the byte order reverse flag to bor. More...
|
|
void | byteOrderReverseOn () |
| Sets the byte order reverse flag to true. More...
|
|
void | byteOrderReverseOff () |
| Sets the byte order reverse flag to false. More...
|
|
bool | isByteOrderReversed () const |
| 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.). More...
|
|
void | reserve (int sze) |
| brief Reserves space in the DataBuffer More...
|
|
The object contains a padding facility to maintain 1, 4, and 8 byte aligned objects so that the objects that utilize this class can be compiled as doubly aligned. This object is used extensively in support of database object serialization. The class contains a long list of methods and properties supporting read/write capability for string, char, byte, bool, int, long, float, and double types. Most types also contain an array read/write capability. Finally, the ability to read and write compressed data is provided using the zlib library facility.