|
sprint 1-alpha
|
A simple buffer class (it is like a vector<char> with an additional pos pointer) More...
#include <bufferize.h>
Classes | |
| struct | _Rep |
Public Member Functions | |
| data_buffer (int capacity) | |
| int | capacity () const |
| resturn the buffer capacity | |
| int | size () const |
| return the buffer size | |
| void | size (int s) |
| set the internal size | |
| int | pos () const |
| return current reading/writing pos inside buffer | |
| void | pos (int p) |
| void | skip (int s) |
| Skip data without check (read, write intenally) | |
| int | remain () const |
| Return the number of bytes remaining to read inside buffer (read) | |
| unsigned char * | data () const |
| return the first byte (use with care) | |
| unsigned char * | cur () const |
| return pointer to the next available byte | |
| unsigned char | peek () |
| Extract a byte without check. | |
| unsigned char | get () |
| Extract a byte and increase reading pos without check. | |
| void | put (unsigned char c) |
| Insert a byte and increase reading pos without check. | |
| bool | full () const |
| return true if buffer is full (write) | |
| bool | avail () const |
| return is there are data available in buffer (read) | |
| int | write (const unsigned char *src, int len) |
| write some bytes inside queue at current position | |
| int | put (char c) |
| put a single char inside the buffer | |
| int | read (unsigned char *dst, int len) |
A simple buffer class (it is like a vector<char> with an additional pos pointer)
| int sprint::data_buffer::read | ( | unsigned char * | dst, |
| int | len | ||
| ) |
Extract a variable ammount of data from buffer
1.7.4