WXP::Buffer Class Reference
[Utility objects]

This class creates a generic buffer for data. More...

#include "../include/Buffer.h"

List of all members.

Public Member Functions

int initClass ()
int init (int rsize)
 Buffer ()
 Buffer (int rsize)
 ~Buffer ()
 Buffer (const Buffer &data)
Buffer operator= (const Buffer &data)
int copy (const Buffer &data)
int clear ()
int resize (int rsize)
int check (int rsize)
int add (unsigned char *dat, int rsize)
int insert (int loc, unsigned char *dat, int rsize)
const unsigned char * get ()
unsigned char get (int ind)
int clearUsed ()
int inc (int num)
int trunc (int num)
int equal (int off, const char *str)
int getInd ()
int getSize ()
int getAvail ()
int getMax ()
int print ()
int dump (int off, int num)
int dump (int num)
int dump ()

Friends

class File
class Zlib
class BZlib

Detailed Description

This class creates a generic buffer for data.

Author:
Dan Vietor

Constructor & Destructor Documentation

Buffer::Buffer (  ) 

Constructor - Initializes the values.

References initClass().

Buffer::Buffer ( int  rsize  ) 

Constructor - Size the arrays.

Parameters:
rsize The max size of the buffer

References init(), and initClass().

Buffer::~Buffer (  ) 

Destructor - deallocate buffer space

Buffer::Buffer ( const Buffer buf  ) 

Copy constructor.

Parameters:
data Strings class to copy from

References copy().


Member Function Documentation

int Buffer::add ( unsigned char *  dat,
int  rsize 
)

Adds data to buffer

Parameters:
dat Data to add
rsize Size of data

References check().

int Buffer::check ( int  rsize  ) 

Checks to see if buffer is large enough to hold data, if not resizes

Parameters:
rsize The size to check

References resize().

Referenced by add(), and insert().

int Buffer::clear (  ) 
int Buffer::clearUsed (  ) 
int Buffer::copy ( const Buffer buf  ) 

Copy data.

Parameters:
buf Buffer class to copy from

References init().

Referenced by Buffer(), and operator=().

int WXP::Buffer::dump (  )  [inline]

Prints entire buffer

References dump().

Referenced by dump().

int WXP::Buffer::dump ( int  num  )  [inline]

Prints number of bytes from start of buffer

References dump().

Referenced by dump().

int Buffer::dump ( int  off,
int  num 
)

Prints the buffer contents

Parameters:
off The starting point
num The number of bytes to dump
int Buffer::equal ( int  off,
const char *  str 
)

Compares data in buffer to string

Parameters:
off The offset into buffer to start compare (<0 from end)
str The string to compare against
Returns:
1=equal, 0=not equal

Referenced by WXP::NidsFile::readBytes(), and WXP::GiniFile::readData().

unsigned char Buffer::get ( int  i  ) 

Gets a byte from the buffer

Parameters:
i The index to extract
Returns:
The byte
const unsigned char* WXP::Buffer::get (  )  [inline]

Return data starting at pointer

Referenced by WXP::NidsFile::readBytes(), WXP::GiniFile::readData(), and WXP::GiniFile::readHeader().

int WXP::Buffer::getAvail (  )  [inline]

Return the number of bytes available in buffer

Referenced by WXP::NidsFile::readBytes(), and WXP::GiniFile::readData().

int WXP::Buffer::getInd (  )  [inline]

Return the pointer index

int WXP::Buffer::getMax (  )  [inline]

Return the maximum size of buffer

Referenced by WXP::NidsFile::readBytes().

int WXP::Buffer::getSize (  )  [inline]

Return the buffer size

Referenced by WXP::NidsFile::readBytes(), and WXP::GiniFile::readData().

int Buffer::inc ( int  num  ) 

Increments the pointer in the buffer

Parameters:
num The number of bytes to increment pointer

Referenced by WXP::NidsFile::readBytes().

int Buffer::init ( int  rsize  ) 

Initializes the values

Parameters:
rsize The max size of the buffer

Referenced by Buffer(), copy(), WXP::NidsFile::init(), and WXP::GiniFile::init().

int Buffer::initClass (  ) 

Initializes the class values

Referenced by Buffer().

int Buffer::insert ( int  loc,
unsigned char *  dat,
int  rsize 
)

Insert data into buffer

Parameters:
loc Location in buffer to add new data
dat Data to add
rsize Size of data

References check().

Buffer Buffer::operator= ( const Buffer buf  ) 

Assignment operator. Used to overload copying

Parameters:
data String class to copy from

References copy().

int Buffer::print (  ) 

Prints the values to standard output.

int Buffer::resize ( int  rsize  ) 

Resizes the buffer.

Parameters:
rsize The new maximum size

Referenced by check().

int Buffer::trunc ( int  num  ) 

Truncates the data in the buffer

Parameters:
num The new size (num<0 - number of bytes to remove from end)

Referenced by WXP::NidsFile::readBytes(), and WXP::GiniFile::readData().


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

Generated on 8 Jan 2010 for WXP C++ Library by  doxygen 1.6.1