Foxit PDF Conversion SDK

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

File stream interface, reading & writing. More...

Inheritance diagram for IFX_FileStream:

## Public Member Functions
virtual FX_BOOL | Flush ()=0
| Flush internal buffer. More...
virtual FX_INT64 | GetPosition ()=0
| Get the current reading position in stream. More...
virtual FX_INT64 | GetSize ()=0
| Get the current stream size, in bytes. More...
virtual FX_BOOL | IsEOF ()=0
| 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 stream. More...
virtual size_t | ReadBlock (void *buffer, size_t size)=0
| Read data block from stream. More...
virtual void | Release ()=0
| Destroy the current instance. More...
virtual IFX_FileStream * | Retain ()=0
| Create a shared instance. More...
virtual FX_BOOL | WriteBlock (const void *buffer, FX_INT64 offset, size_t size)=0
| Write a block data into stream. More...
virtual FX_BOOL | WriteBlock (const void *buffer, size_t size)
| Write a block data to the end of current stream. More...
Public Member Functions inherited from IFX_FileRead
virtual void | ClearRange ()
| Clear accessing range set by function IFX_FileRead::SetRange. 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 stream interface, reading & writing.

## Member Function Documentation

## ◆ Flush()

virtual FX_BOOL IFX_FileStream::Flush | ( |  | ) |
| pure virtual

Flush internal buffer.

Returns
  true means success, and false means failure.

Implements IFX_FileWrite.

Implemented in CFX_CachedFileRead, and IFX_ChunkFileStream.

## ◆ GetPosition()

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

Get the current reading position in stream.

Returns
  Current reading position.

Reimplemented from IFX_FileRead.

Implemented in CFX_CachedFileRead, and IFX_ChunkFileStream.

## ◆ GetSize()

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

Get the current stream size, in bytes.

Returns
  Current stream size, in bytes.

Implements IFX_FileWrite.

Implemented in CFX_CachedFileRead, and IFX_ChunkFileStream.

## ◆ IsEOF()

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

Determine whether reach the end of stream.

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

Reimplemented from IFX_FileRead.

Implemented in CFX_CachedFileRead, and IFX_ChunkFileStream.

## ◆ ReadBlock() [1/2]

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

Read a data block from stream.

Parameters

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

Returns
  true means success, and false means failure.

Implements IFX_FileRead.

Implemented in CFX_CachedFileRead, and IFX_ChunkFileStream.

## ◆ ReadBlock() [2/2]

virtual size_t IFX_FileStream::ReadBlock | ( | void * | buffer,
|  | size_t | size
| ) |  |
| pure 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, means error or no data.

Reimplemented from IFX_FileRead.

Implemented in CFX_CachedFileRead, and IFX_ChunkFileStream.

## ◆ Release()

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

Destroy the current instance.

Returns
  None.

Implements IFX_FileWrite.

Implemented in CFX_CachedFileRead, and IFX_ChunkFileStream.

## ◆ Retain()

virtual IFX_FileStream* IFX_FileStream::Retain | ( |  | ) |
| pure virtual

Create a shared instance.

Returns
  File stream interface.

Implemented in CFX_CachedFileRead, and IFX_ChunkFileStream.

## ◆ WriteBlock() [1/2]

virtual FX_BOOL IFX_FileStream::WriteBlock | ( | const void * | buffer,
|  | FX_INT64 | offset,
|  | size_t | size
| ) |  |
| pure virtual

Write a block data into stream.

Parameters

  [in] | buffer | Pointer to the data block.
  [in] | offset | Byte offset from beginning of the file, the position to write data.
  [in] | size | The length in bytes of the buffer.

Returns
  true means success, and false means failure.

Implements IFX_FileWrite.

Implemented in CFX_CachedFileRead, and IFX_ChunkFileStream.

## ◆ WriteBlock() [2/2]

virtual FX_BOOL IFX_FileStream::WriteBlock | ( | const void * | buffer,
|  | size_t | size
| ) |  |
| inline virtual

Write a block data to the end of current stream.

Parameters

  [in] | buffer | Pointer to the data block.
  [in] | size | The length in bytes of the buffer.

Returns
  true means success, and false means failure.

Reimplemented from IFX_FileWrite.

Reimplemented in IFX_ChunkFileStream.