|
WXP C++ Library Version 6.74.9
|
This class creates a generic buffer for data. More...
#include "../include/Buffer.h"
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) |
| int | insert (int loc, const Buffer &data) |
| const unsigned char * | get () |
| unsigned char | get (int ind) |
| int | read (unsigned char *dat, int rsize) |
| int | read (Buffer &buf) |
| int | read (Buffer &buf, int rsize) |
| int | readLine (unsigned char *dat, int rsize) |
| int | skipLine () |
| int | clearUsed () |
| int | seek (int num) |
| 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 |
This class creates a generic buffer for data.
| Buffer::Buffer | ( | ) |
Constructor - Initializes the values.
References initClass().
| Buffer::Buffer | ( | int | rsize | ) |
Constructor - Size the arrays.
| rsize | The max size of the buffer |
References init(), and initClass().
| Buffer::~Buffer | ( | ) |
Destructor - deallocate buffer space
| Buffer::Buffer | ( | const Buffer & | buf | ) |
| int Buffer::add | ( | unsigned char * | dat, |
| int | rsize | ||
| ) |
| int Buffer::check | ( | int | rsize | ) |
| int Buffer::clear | ( | ) |
Clears the buffer
Referenced by WXP::NidsFile::readBytes(), WXP::GiniFile::readData(), and WXP::GiniFile::readHeader().
| int Buffer::clearUsed | ( | ) |
Removes data already used
Referenced by WXP::NidsFile::readBytes(), WXP::GiniFile::readData(), and WXP::GiniFile::readHeader().
| int Buffer::copy | ( | const Buffer & | buf | ) |
Copy data.
| buf | Buffer class to copy from |
References init().
Referenced by Buffer(), and operator=().
|
inline |
| int Buffer::dump | ( | int | off, |
| int | num | ||
| ) |
Prints the buffer contents
| 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
| off | The offset into buffer to start compare (<0 from end) |
| str | The string to compare against |
Referenced by WXP::GiniFile::readData().
|
inline |
Return data starting at pointer
Referenced by WXP::NidsFile::readBytes(), WXP::GiniFile::readData(), and WXP::GiniFile::readHeader().
| unsigned char Buffer::get | ( | int | i | ) |
Gets a byte from the buffer
| i | The index to extract |
|
inline |
Return the number of bytes available in buffer
Referenced by WXP::File::getLine(), WXP::File::read(), WXP::NidsFile::readBytes(), WXP::GiniFile::readData(), and WXP::File::skipLine().
|
inline |
Return the pointer index
|
inline |
Return the maximum size of buffer
|
inline |
Return the buffer size
Referenced by WXP::GiniFile::readData().
| int Buffer::inc | ( | int | num | ) |
Increments the pointer in the buffer
| num | The number of bytes to increment pointer |
| int Buffer::init | ( | int | rsize | ) |
Initializes the values
| rsize | The max size of the buffer |
Referenced by Buffer(), copy(), WXP::GiniFile::init(), WXP::Lev2File::init(), and WXP::NidsFile::init().
| int Buffer::insert | ( | int | loc, |
| const Buffer & | buf | ||
| ) |
| int Buffer::insert | ( | int | loc, |
| unsigned char * | dat, | ||
| int | rsize | ||
| ) |
| int Buffer::print | ( | ) |
Prints the values to standard output.
| int Buffer::read | ( | unsigned char * | dat, |
| int | rsize | ||
| ) |
Gets a line from the buffer
| dat | The buffer to write to |
| rsize | The size of the buffer |
Referenced by WXP::File::read(), WXP::File::read(), and WXP::NidsFile::readBytes().
| int Buffer::readLine | ( | unsigned char * | dat, |
| int | rsize | ||
| ) |
Gets a line from the buffer
| dat | The buffer to write to |
| rsize | The size of the buffer |
Referenced by WXP::File::getLine().
| int Buffer::resize | ( | int | rsize | ) |
| int Buffer::seek | ( | int | num | ) |
Sets the pointer in the buffer
| num | The byte offset |
| int Buffer::skipLine | ( | ) |
| int Buffer::trunc | ( | int | num | ) |
Truncates the data in the buffer
| num | The new size (num<0 - number of bytes to remove from end) |
Referenced by WXP::GiniFile::readData().