This class creates a generic buffer for data.
More...
#include "../include/Buffer.h"
|
|
class | File |
|
class | Zlib |
|
class | BZlib |
This class creates a generic buffer for data.
- Author
- Dan Vietor
◆ Buffer() [1/3]
◆ Buffer() [2/3]
| Buffer::Buffer |
( |
int | rsize | ) |
|
Constructor - Size the arrays.
- Parameters
-
| rsize | The max size of the buffer |
References init(), and initClass().
◆ ~Buffer()
Destructor - deallocate buffer space
◆ Buffer() [3/3]
| Buffer::Buffer |
( |
const Buffer & | buf | ) |
|
◆ add()
| int Buffer::add |
( |
unsigned char * | dat, |
|
|
int | rsize ) |
Adds data to buffer
- Parameters
-
| dat | Data to add |
| rsize | Size of data |
References check().
◆ check()
| int Buffer::check |
( |
int | rsize | ) |
|
Checks to see if buffer is large enough to hold data, if not resizes
- Parameters
-
References resize().
Referenced by add(), insert(), and insert().
◆ clear()
◆ clearUsed()
| int Buffer::clearUsed |
( |
| ) |
|
Removes data already used
◆ copy()
| int Buffer::copy |
( |
const Buffer & | buf | ) |
|
◆ dump() [1/3]
| int WXP::Buffer::dump |
( |
| ) |
|
|
inline |
Prints entire buffer
References dump().
Referenced by dump().
◆ dump() [2/3]
| int WXP::Buffer::dump |
( |
int | num | ) |
|
|
inline |
Prints number of bytes from start of buffer
References dump().
Referenced by dump().
◆ dump() [3/3]
| int Buffer::dump |
( |
int | off, |
|
|
int | num ) |
Prints the buffer contents
- Parameters
-
| off | The starting point |
| num | The number of bytes to dump |
◆ equal()
| 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
◆ get() [1/2]
| const unsigned char * WXP::Buffer::get |
( |
| ) |
|
|
inline |
Return data starting at pointer
◆ get() [2/2]
| unsigned char Buffer::get |
( |
int | i | ) |
|
Gets a byte from the buffer
- Parameters
-
- Returns
- The byte
◆ getAvail()
| int WXP::Buffer::getAvail |
( |
| ) |
|
|
inline |
Return the number of bytes available in buffer
◆ getInd()
| int WXP::Buffer::getInd |
( |
| ) |
|
|
inline |
◆ getMax()
| int WXP::Buffer::getMax |
( |
| ) |
|
|
inline |
Return the maximum size of buffer
◆ getSize()
| int WXP::Buffer::getSize |
( |
| ) |
|
|
inline |
◆ inc()
| int Buffer::inc |
( |
int | num | ) |
|
Increments the pointer in the buffer
- Parameters
-
| num | The number of bytes to increment pointer |
◆ init()
| int Buffer::init |
( |
int | rsize | ) |
|
Initializes the values
- Parameters
-
| rsize | The max size of the buffer |
Referenced by Buffer(), and copy().
◆ initClass()
| int Buffer::initClass |
( |
| ) |
|
◆ insert() [1/2]
| int Buffer::insert |
( |
int | loc, |
|
|
const Buffer & | buf ) |
Insert another buffer
- Parameters
-
| loc | Location in buffer to add new data |
| buf | Buffer class to copy from |
References Buffer(), and check().
◆ insert() [2/2]
| 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().
◆ operator=()
Assignment operator. Used to overload copying
- Parameters
-
References Buffer(), and copy().
◆ print()
Prints the values to standard output.
◆ read()
| int Buffer::read |
( |
unsigned char * | dat, |
|
|
int | rsize ) |
Gets a line from the buffer
- Parameters
-
| dat | The buffer to write to |
| rsize | The size of the buffer |
- Returns
- The number of bytes read
◆ readLine()
| int Buffer::readLine |
( |
unsigned char * | dat, |
|
|
int | rsize ) |
Gets a line from the buffer
- Parameters
-
| dat | The buffer to write to |
| rsize | The size of the buffer |
- Returns
- The number of bytes read
◆ resize()
| int Buffer::resize |
( |
int | rsize | ) |
|
Resizes the buffer.
- Parameters
-
| rsize | The new maximum size |
Referenced by check().
◆ seek()
| int Buffer::seek |
( |
int | num | ) |
|
Sets the pointer in the buffer
- Parameters
-
◆ skipLine()
Skips a line from the buffer
- Returns
- 1 if saw NL, 0 if not
◆ trunc()
| 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) |
The documentation for this class was generated from the following files: