|
CCAFFEINE
0.8.8
|
#include <BufferedReader.h>


Public Member Functions | |
| BufferedReader (Reader *in) | |
| virtual void | close () |
| virtual void | mark () |
| virtual boolean | markSupported () |
| virtual int | read () |
| virtual int | read (char *cbuf, int length) |
| virtual int | read (char *cbuf, int off, int length) |
| virtual boolean | ready () |
| virtual void | reset () |
| virtual long | skip (long length) |
| virtual CFREE char * | readLine () |
Protected Member Functions | |
| void | en (char *str) |
Private Member Functions | |
| int | preRead (char *cbuf, int off, int length) |
| int | findLineInBuffer () |
| void | fill () |
Private Attributes | |
| CDELETE Reader * | in |
| char * | cb |
| long | nChars |
| int | nextChar |
| int | maxChars |
| long | defaultCharBufferSize |
| long | defaultExpectedLineLength |
| CDELETE StringBuffer * | sb |
A C++ knockoff of the BufferedReader class in package java.io.
| virtual void jcpp::BufferedReader::close | ( | ) | [inline, virtual] |
| virtual void jcpp::BufferedReader::mark | ( | ) | [inline, virtual] |
Mark this point in the read stream.
Reimplemented from jcpp::Reader.
{
en((char *)"not allowed to use mark() in Reader");
}
| virtual boolean jcpp::BufferedReader::markSupported | ( | ) | [inline, virtual] |
Determine if this stream supports marking the stream.
Reimplemented from jcpp::Reader.
{
return FALSE;
}
| virtual int jcpp::BufferedReader::read | ( | ) | [virtual] |
Read a single character off the stream.
Implements jcpp::Reader.
| virtual int jcpp::BufferedReader::read | ( | char * | cbuf, |
| int | length | ||
| ) | [inline, virtual] |
Read length bytes into the buffer pointed to by cbuf.
Reimplemented from jcpp::Reader.
{
return read(cbuf, 0 , length);
}
| int jcpp::BufferedReader::preRead | ( | char * | cbuf, |
| int | off, | ||
| int | length | ||
| ) | [private] |
This reads a blob of characters, but does not necessarily fulfill the request. A negative return value means an error has occurred.
| virtual int jcpp::BufferedReader::read | ( | char * | cbuf, |
| int | off, | ||
| int | length | ||
| ) | [virtual] |
Read <em length /em> bytes into the buffer pointed to by <em cbuf /em> beginning at the offset <em off /em>.
Implements jcpp::Reader.
| virtual boolean jcpp::BufferedReader::ready | ( | ) | [inline, virtual] |
Answers TRUE if the stream is ready to be read.
Implements jcpp::Reader.
{
return (nextChar < nChars) || in->ready();
}
| virtual void jcpp::BufferedReader::reset | ( | ) | [inline, virtual] |
Reset the stream back to the previously set mark, if supported, error otherwise.
Reimplemented from jcpp::Reader.
{
en((char *)":-( Reader::reset() not supported");
}
| virtual long jcpp::BufferedReader::skip | ( | long | length | ) | [virtual] |
Skip length bytes or to end-of-file whichever comes first.
Implements jcpp::Reader.
| virtual CFREE char* jcpp::BufferedReader::readLine | ( | ) | [virtual] |
Read a line, the terminating newline is replaced with a null.
| int jcpp::BufferedReader::findLineInBuffer | ( | ) | [private] |
See if a newline char appears in the current buffer, if so return the index pointing to the newline, otherwise retrun -1.
| void jcpp::BufferedReader::fill | ( | ) | [private] |
Fill the buffer; note that this may block.
| void jcpp::BufferedReader::en | ( | char * | str | ) | [inline, protected] |
1.7.6.1