PoDoFo 1.0.0-dev
Loading...
Searching...
No Matches
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.
 
size_t Read (char *buffer, size_t size, bool &eof)
 Read data from the device.
 
char ReadChar ()
 Get next char from stream.
 
bool Read (char &ch)
 Get next char from stream.
 
void CopyTo (OutputStream &stream)
 Copy this stream to another.
 
void CopyTo (OutputStream &stream, size_t size)
 Copy this stream to another.
 

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.
 
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

◆ checkRead()

void InputStream::checkRead ( ) const
protectedvirtual

Optional checks before reading By default does nothing.

Reimplemented in PoDoFo::InputStreamDevice.

◆ 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

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

◆ 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.


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