PDFix SDK  6.19.0
Loading...
Searching...
No Matches
PsStream Struct Referenceabstract

PsStream class. More...

#include <pdfix.h>

Inheritance diagram for PsStream:
PsCustomStream PsFileStream PsMemoryStream

Public Member Functions

virtual void Destroy ()=0
 Destroys PsStream resources. More...
 
virtual bool IsEof () const =0
 Checks if the current position is end of stream. More...
 
virtual int GetSize () const =0
 Gets the current size of a stream. More...
 
virtual bool Read (int offset, uint8_t *buffer, int size) const =0
 Reads data from PsStream into memory. More...
 
virtual bool Write (int offset, const uint8_t *buffer, int size)=0
 Writes data from a memory buffer into a stream, beginning at the offset position. More...
 
virtual int GetPos () const =0
 
virtual bool Flush () const =0
 
virtual void * GetStream () const =0
 
virtual PdfStreamType GetType () const =0
 Gets the type of a stream. More...
 

Detailed Description

PsStream class.

A PsStream is a data stream that may be a buffer in memory, a file, or an arbitrary user-written procedure. You typically would use an PsStream to import/export data to/from/ a PDF file. PsStream methods allow you to open and close streams, and to read and write data.

Member Function Documentation

◆ Destroy()

virtual void PsStream::Destroy ( )
pure virtual

Destroys PsStream resources.

See also
Pdfix::CreateStream

◆ Flush()

virtual bool PsStream::Flush ( ) const
pure virtual

Flush stream data. Synchronize the stream buffer with its controlled output sequence.

Returns
true if sucessfull. false otherwise.

◆ GetPos()

virtual int PsStream::GetPos ( ) const
pure virtual

Gets the current seek position in a stream. This is the position at which the next read or write will begin.

Returns
The current seek position.

◆ GetSize()

virtual int PsStream::GetSize ( ) const
pure virtual

Gets the current size of a stream.

Returns
The size of the stream.

◆ GetType()

virtual PdfStreamType PsStream::GetType ( ) const
pure virtual

Gets the type of a stream.

Returns
stream type.

◆ IsEof()

virtual bool PsStream::IsEof ( ) const
pure virtual

Checks if the current position is end of stream.

Returns
The size of the stream.
See also
PsStream::Read

◆ Read()

virtual bool PsStream::Read ( int  offset,
uint8_t *  buffer,
int  size 
) const
pure virtual

Reads data from PsStream into memory.

Parameters
buffer(Filled by the method) A buffer into which data is written.
offsetThe position to start read from.
sizeThe number of bytes to read.
Returns
true if the operation was successful, false otherwise.

◆ Write()

virtual bool PsStream::Write ( int  offset,
const uint8_t *  buffer,
int  size 
)
pure virtual

Writes data from a memory buffer into a stream, beginning at the offset position.

Parameters
bufferA buffer holding the data that is to be written. The buffer must be able to hold at least count bytes.
offsetThe position to seek.
sizeThe number of bytes to write.
Returns
true if the operation was successful, false otherwise.