Foxit PDF Conversion SDK

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

File reading interface. More...

Inheritance diagram for IFX_FileRead:

## Public Member Functions
virtual void | ClearRange ()
| Clear accessing range set by function IFX_FileRead::SetRange. More...
virtual FX_INT64 | GetPosition ()
| Get the current reading position in stream. More...
virtual FX_INT64 | GetSize ()=0
| Get total size of the file. More...
virtual FX_BOOL | IsEOF ()
| Determine whether reach the end of stream. More...
virtual FX_BOOL | ReadBlock (void *buffer, FX_INT64 offset, size_t size)=0
| Read a data block from the file. More...
virtual size_t | ReadBlock (void *buffer, size_t size)
| Read data block from stream. More...
virtual void | Release ()=0
| Called when to release everything. More...
virtual FX_INT64 | SetPosition (FX_INT64 pos)
| Set the current file accessing position. More...
virtual FX_BOOL | SetRange (FX_INT64 offset, FX_INT64 size)
| Set accessing range. More...

## Detailed Description

File reading interface.

## Member Function Documentation

## ◆ ClearRange()

virtual void IFX_FileRead::ClearRange | ( |  | ) |
| inline virtual

Clear accessing range set by function IFX_FileRead::SetRange.

Returns
  None.

## ◆ GetPosition()

virtual FX_INT64 IFX_FileRead::GetPosition | ( |  | ) |
| inline virtual

Get the current reading position in stream.

Returns
  The current reading position in stream.

Implements IFX_StreamRead.

Reimplemented in CFX_CachedFileRead, IFX_ChunkFileStream, and IFX_FileStream.

## ◆ GetSize()

virtual FX_INT64 IFX_FileRead::GetSize | ( |  | ) |
| pure virtual

Get total size of the file.

Returns
  File size, in bytes. Implementation can return 0 for any error.

Implemented in CFX_CachedFileRead, IFX_ChunkFileStream, and IFX_FileStream.

## ◆ IsEOF()

virtual FX_BOOL IFX_FileRead::IsEOF | ( |  | ) |
| inline virtual

Determine whether reach the end of stream.

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

Implements IFX_StreamRead.

Reimplemented in CFX_CachedFileRead, IFX_ChunkFileStream, and IFX_FileStream.

## ◆ ReadBlock() [1/2]

virtual FX_BOOL IFX_FileRead::ReadBlock | ( | void * | buffer,
|  | FX_INT64 | offset,
|  | size_t | size
| ) |  |
| pure virtual

Read a data block from the file.

Parameters

  [in,out] | buffer | Pointer to a buffer receiving read data
  [in] | offset | Byte offset from beginning of the file
  [in] | size | Number of bytes for the block.

Returns
  true means success, and false means failure.

Implemented in CFX_CachedFileRead, IFX_ChunkFileStream, and IFX_FileStream.

## ◆ ReadBlock() [2/2]

virtual size_t IFX_FileRead::ReadBlock | ( | void * | buffer,
|  | size_t | size
| ) |  |
| inline virtual

Read data block from 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. If returns 0, that means error or no data.

Implements IFX_StreamRead.

Reimplemented in CFX_CachedFileRead, IFX_ChunkFileStream, and IFX_FileStream.

## ◆ Release()

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

Called when to release everything.

Returns
  None.

Implements IFX_StreamRead.

Implemented in CFX_CachedFileRead, IFX_ChunkFileStream, and IFX_FileStream.

## ◆ SetPosition()

virtual FX_INT64 IFX_FileRead::SetPosition | ( | FX_INT64 | pos | ) |
| inline virtual

Set the current file accessing position.

Parameters

  [in] | pos | The new accessing position.

Returns
  The current file accessing position from the beginning of file. Default value:-1, means Unsupport.

Reimplemented from IFX_StreamRead.

## ◆ SetRange()

virtual FX_BOOL IFX_FileRead::SetRange | ( | FX_INT64 | offset,
|  | FX_INT64 | size
| ) |  |
| inline virtual

Set accessing range.

Parameters

  [in] | offset |
  [in] | size |

Returns
  true means success, and false means failure.