PoDoFo 0.9.20
PoDoFo::InputStream Class Referenceabstract

#include <InputStream.h>

Inheritance diagram for PoDoFo::InputStream:
PoDoFo::InputStreamDevice PoDoFo::PdfAESInputStream PoDoFo::PdfRC4InputStream PoDoFo::PdfCanvasInputDevice PoDoFo::StreamDevice PoDoFo::NullStreamDevice

Public Member Functions

void Read (char *buffer, size_t size)
 
size_t Read (char *buffer, size_t size, bool &eof)
 
char ReadChar ()
 
bool Read (char &ch)
 

Protected Member Functions

virtual size_t readBuffer (char *buffer, size_t size, bool &eof)=0
 
virtual bool readChar (char &ch)
 
virtual void checkRead () const
 

Detailed Description

An interface for reading blocks of data from a data source. It supports non-blocking read operations

Member Function Documentation

◆ checkRead()

void InputStream::checkRead ( ) const
protectedvirtual

Optional checks before reading By default does nothing

Reimplemented in PoDoFo::InputStreamDevice.

◆ Read() [1/3]

bool InputStream::Read ( char & ch)

Get next char from stream.

Parameters
chthe read character
Returns
true if success, false if EOF is encountered before reading the character

◆ Read() [2/3]

void InputStream::Read ( char * buffer,
size_t size )

Read data from the device

Parameters
buffera pointer to the data buffer
sizelength of the output buffer
Remarks
throws if EOF is encountered before reading the required size

◆ Read() [3/3]

size_t InputStream::Read ( char * buffer,
size_t size,
bool & eof )

Read data from the device

Parameters
buffera pointer to the data buffer
sizelength of the output buffer
eofstream encountered EOF during the read
Returns
Number of read bytes

◆ readBuffer()

virtual size_t PoDoFo::InputStream::readBuffer ( char * buffer,
size_t size,
bool & eof )
protectedpure virtual

Read a buffer from the stream /param eof true if the stream reached eof during read /returns number of read bytes

Implemented in PoDoFo::NullStreamDevice, PoDoFo::PdfAESInputStream, PoDoFo::PdfCanvasInputDevice, and PoDoFo::PdfRC4InputStream.

◆ ReadChar()

char InputStream::ReadChar ( )

Get next char from stream.

Returns
the next character from the stream
Remarks
throws if EOF is encountered before reading the character

◆ readChar()

bool InputStream::readChar ( char & ch)
protectedvirtual

Read the next char in stream. /returns true if success, false if EOF

Reimplemented in PoDoFo::NullStreamDevice, and PoDoFo::PdfCanvasInputDevice.