Foxit PDF Conversion SDK

Public Member Functions | List of all members
IFX_BufferRead Class Referenceabstract
FXCRT

IFX_BufferRead stream provides an optimized approach to read stream data. Usually, one stream maintains an internal buffer for data access, this buffer can be used directly to caller, and avoids data-copy. More...

Inheritance diagram for IFX_BufferRead:

## Public Member Functions
virtual FX_LPCBYTE | GetBlockBuffer ()=0
| Get internal buffer of block data. More...
virtual FX_INT64 | GetBlockOffset ()=0
| Get the offset of data in internal buffer. More...
virtual size_t | GetBlockSize ()=0
| Get the size of data in internal buffer. More...
virtual FX_INT64 | GetPosition ()=0
| Get the current reading position in stream. More...
virtual FX_BOOL | IsEOF ()=0
| Determine whether reach the end of stream. More...
virtual size_t | ReadBlock (void *buffer, size_t size)=0
| Read data block from sequential stream. More...
virtual FX_BOOL | ReadNextBlock (FX_BOOL bRestart=false)=0
| Read the next block in sequential stream. More...
virtual void | Release ()=0
| Called when to release the current instance. More...
Public Member Functions inherited from IFX_StreamRead
virtual FX_INT64 | SetPosition (FX_INT64 pos)
| Set the current file accessing position. More...

## Detailed Description

IFX_BufferRead stream provides an optimized approach to read stream data. Usually, one stream maintains an internal buffer for data access, this buffer can be used directly to caller, and avoids data-copy.

## Member Function Documentation

## ◆ GetBlockBuffer()

virtual FX_LPCBYTE IFX_BufferRead::GetBlockBuffer | ( |  | ) |
| pure virtual

Get internal buffer of block data.

Returns
  The internal buffer.

## ◆ GetBlockOffset()

virtual FX_INT64 IFX_BufferRead::GetBlockOffset | ( |  | ) |
| pure virtual

Get the offset of data in internal buffer.

This offset starts from the beginning of stream.

Returns
  The offset of data in internal buffer.

## ◆ GetBlockSize()

virtual size_t IFX_BufferRead::GetBlockSize | ( |  | ) |
| pure virtual

Get the size of data in internal buffer.

Returns
  Size of data in internal buffer.

## ◆ GetPosition()

virtual FX_INT64 IFX_BufferRead::GetPosition | ( |  | ) |
| pure virtual

Get the current reading position in stream.

Returns
  Current reading position in stream.

Implements IFX_StreamRead.

## ◆ IsEOF()

virtual FX_BOOL IFX_BufferRead::IsEOF | ( |  | ) |
| pure virtual

Determine whether reach the end of stream.

Returns
  true means reach the end of stream, and false means not yet.

Implements IFX_StreamRead.

## ◆ ReadBlock()

virtual size_t IFX_BufferRead::ReadBlock | ( | void * | buffer,
|  | size_t | size
| ) |  |
| pure virtual

Read data block from sequential stream.

Parameters

  [in,out] | buffer | buffer to store data.
  [in] | size | total size of buffer, in bytes.

Returns
  The length of data stored in buffer. 0 means error or no data.

Implements IFX_StreamRead.

## ◆ ReadNextBlock()

virtual FX_BOOL IFX_BufferRead::ReadNextBlock | ( | FX_BOOL | bRestart = `false` | ) |
| pure virtual

Read the next block in sequential stream.

Parameters

  [in] | bRestart | Indicates to read data from the beginning of stream. Default value: false.

Returns
  true means success, and false means failure.

## ◆ Release()

virtual void IFX_BufferRead::Release | ( |  | ) |
| pure virtual

Called when to release the current instance.

Returns
  None.

Implements IFX_StreamRead.