VMime
|
Public Member Functions | |
parserInputStreamAdapter (shared_ptr< seekableInputStream > stream) | |
shared_ptr< seekableInputStream > | getUnderlyingStream () |
bool | eof () const |
void | reset () |
size_t | read (byte_t *const data, const size_t count) |
void | seek (const size_t pos) |
size_t | skip (const size_t count) |
size_t | getPosition () const |
byte_t | peekByte () const |
byte_t | getByte () |
template<typename T > | |
bool | matchBytes (const T *bytes, const size_t length) const |
const string | extract (const size_t begin, const size_t end) const |
template<typename PREDICATE > | |
size_t | skipIf (PREDICATE pred, const size_t endPosition) |
size_t | findNext (const string &token, const size_t startPosition=0) |
Public Member Functions inherited from stream | |
virtual | ~stream () |
virtual size_t | getBlockSize () |
Additional Inherited Members | |
Protected Member Functions inherited from object | |
object () | |
object (const object &) | |
object & | operator= (const object &) |
virtual | ~object () |
An adapter class used for parsing from an input stream.
parserInputStreamAdapter | ( | shared_ptr< seekableInputStream > | stream | ) |
stream | input stream to wrap |
|
virtual |
Test for end of stream (no more data to read).
Implements inputStream.
References vmime::begin(), vmime::end(), and vmime::npos.
byte_t getByte | ( | ) |
Get the byte at the current position and advance current position by one byte.
|
virtual |
Returns the current position in this stream.
Implements seekableInputStream.
shared_ptr< seekableInputStream > getUnderlyingStream | ( | ) |
bool matchBytes | ( | const T * | bytes, |
const size_t | length | ||
) | const |
Check whether the bytes following the current position match the specified bytes.
Position is not updated.
bytes | bytes to compare |
length | number of bytes |
byte_t peekByte | ( | ) | const |
Get the byte at the current position without updating the current position.
Read data from the stream.
data | will receive the data read |
count | maximum number of bytes to read |
Implements inputStream.
|
virtual |
Set the read pointer to the beginning of the stream.
Implements inputStream.
|
virtual |
Sets the position, measured from the beginning of this stream, at which the next read occurs.
pos | the offset position, measured in bytes from the beginning of the stream, at which to set the stream pointer. |
Implements seekableInputStream.
Skip a number of bytes.
count | maximum number of bytes to ignore |
Implements inputStream.
Skips bytes matching a predicate from the current position.
The current position is updated to the next following byte which does not match the predicate.
pred | predicate |
endPosition | stop at this position (or at end of the stream, whichever comes first) |