PoDoFo
1.0.0-dev
|
An interface for reading blocks of data from a data source. More...
#include <InputStream.h>
Public Member Functions | |
void | Read (char *buffer, size_t size) |
Read data from the device. More... | |
size_t | Read (char *buffer, size_t size, bool &eof) |
Read data from the device. More... | |
char | ReadChar () |
Get next char from stream. More... | |
bool | Read (char &ch) |
Get next char from stream. More... | |
void | CopyTo (OutputStream &stream) |
Copy this stream to another. More... | |
void | CopyTo (OutputStream &stream, size_t size) |
Copy this stream to another. More... | |
Protected Member Functions | |
virtual size_t | readBuffer (char *buffer, size_t size, bool &eof)=0 |
Read a buffer from the stream /param eof true if the stream reached eof during read /returns number of read bytes. | |
virtual bool | readChar (char &ch) |
Read the next char in stream. More... | |
virtual void | checkRead () const |
Optional checks before reading By default does nothing. | |
Static Protected Member Functions | |
static size_t | ReadBuffer (InputStream &stream, char *buffer, size_t size, bool &eof) |
static bool | ReadChar (InputStream &stream, char &ch) |
An interface for reading blocks of data from a data source.
It supports non-blocking read operations
void InputStream::CopyTo | ( | OutputStream & | stream | ) |
Copy this stream to another.
void InputStream::CopyTo | ( | OutputStream & | stream, |
size_t | size | ||
) |
Copy this stream to another.
bool InputStream::Read | ( | char & | ch | ) |
Get next char from stream.
ch | the read character |
void InputStream::Read | ( | char * | buffer, |
size_t | size | ||
) |
Read data from the device.
buffer | a pointer to the data buffer |
size | length of the output buffer |
size_t InputStream::Read | ( | char * | buffer, |
size_t | size, | ||
bool & | eof | ||
) |
Read data from the device.
buffer | a pointer to the data buffer |
size | length of the output buffer |
eof | stream encountered EOF during the read |
char InputStream::ReadChar | ( | ) |
Get next char from stream.
|
protectedvirtual |
Read the next char in stream.
/returns true if success, false if EOF
Reimplemented in PoDoFo::PdfCanvasInputDevice, and PoDoFo::NullStreamDevice.