PoDoFo  1.0.0-dev
Public Member Functions | Protected Member Functions | Static Protected Member Functions | List of all members
PoDoFo::InputStream Class Referenceabstract

An interface for reading blocks of data from a data source. More...

#include <InputStream.h>

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

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)
 

Detailed Description

An interface for reading blocks of data from a data source.

It supports non-blocking read operations

Member Function Documentation

◆ CopyTo() [1/2]

void InputStream::CopyTo ( OutputStream stream)

Copy this stream to another.

Remarks
The copy begins from the current position and it's not reset after the operation is completed

◆ CopyTo() [2/2]

void InputStream::CopyTo ( OutputStream stream,
size_t  size 
)

Copy this stream to another.

Remarks
The copy begins from the current position and it's not reset after the operation is completed

◆ 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

◆ 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::PdfCanvasInputDevice, and PoDoFo::NullStreamDevice.


The documentation for this class was generated from the following files: