Claw
1.7.3
|
This class is made to help reading istreams with a buffer. More...
#include <buffered_istream.hpp>
Public Member Functions | |
buffered_istream (stream_type &f) | |
Constructor. | |
~buffered_istream () | |
Destructor. | |
unsigned int | remaining () const |
Tell how many bytes are ready in the buffer. | |
bool | read_more (unsigned int n) |
Increase the number of ready bytes to a given number. | |
const char * | get_buffer () const |
Get the input buffer. | |
char | get_next () |
Get the next value in the buffer and move one byte forward. | |
bool | read (char *buf, unsigned int n) |
Read a range of data. | |
void | move (unsigned int n) |
Move some bytes forward. | |
void | close () |
Closes this buffer (not the stream). | |
operator bool () const | |
Tell if there is still datas in the buffer/stream. |
This class is made to help reading istreams with a buffer.
Definition at line 42 of file buffered_istream.hpp.
claw::buffered_istream< Stream >::buffered_istream | ( | stream_type & | f | ) |
Constructor.
f | The file associated to the stream. |
Definition at line 38 of file buffered_istream.tpp.
void claw::buffered_istream< Stream >::close | ( | ) |
Closes this buffer (not the stream).
The cursor of the stream is repositioned according to the remaining data, and the buffer is cleared.
Definition at line 183 of file buffered_istream.tpp.
void claw::buffered_istream< Stream >::move | ( | unsigned int | n | ) |
Move some bytes forward.
n | The number of bytes to skip. |
Definition at line 169 of file buffered_istream.tpp.
bool claw::buffered_istream< Stream >::read | ( | char * | buf, |
unsigned int | n | ||
) |
Read a range of data.
buf | The buffer in which we write the read data. |
n | The number of bytes to read. |
Definition at line 145 of file buffered_istream.tpp.
bool claw::buffered_istream< Stream >::read_more | ( | unsigned int | n | ) |
Increase the number of ready bytes to a given number.
n | The number of bytes you need. |
Definition at line 77 of file buffered_istream.tpp.