Structure for file with large size for reading or writing (I/O). More...
#include <fs_base_r.h>
Public Attributes | |
FS_LPVOID | clientData |
User-defined data. More... | |
void(* | Release )(FS_LPVOID clientData) |
Callback function to release the current file stream object. More... | |
FS_RESULT(* | GetSize )(FS_LPVOID clientData, FSCRT_FILESIZE *size) |
Callback function to retrieve the current file stream size. More... | |
FS_RESULT(* | ReadBlock )(FS_LPVOID clientData, const FSCRT_FILESIZE *offset, FS_LPVOID buffer, const FSCRT_FILESIZE *size) |
Callback function to read data from the current file stream. More... | |
FS_RESULT(* | WriteBlock )(FS_LPVOID clientData, const FSCRT_FILESIZE *offset, FS_LPCVOID buffer, const FSCRT_FILESIZE *size) |
Callback function to write data into the current large file stream. More... | |
FS_RESULT(* | Flush )(FS_LPVOID clientData) |
Callback function to flush all internal accessing buffers. More... | |
FS_RESULT(* | Truncate )(FS_LPVOID clientData, const FSCRT_FILESIZE *fileSize) |
Callback function to change file size. More... | |
Structure for file with large size for reading or writing (I/O).
FS_LPVOID FSCRT_FILEHANDLER_L::clientData |
User-defined data.
FS_RESULT(* FSCRT_FILEHANDLER_L::Flush) (FS_LPVOID clientData) |
Callback function to flush all internal accessing buffers.
For reading mode, this function will clear all cached buffers.
For writing mode, this function writes all cached data into file stream.
Sometimes, caller calls this function to make sure data is written into file stream.
[in] | clientData | Pointer to user-defined data. |
FS_RESULT(* FSCRT_FILEHANDLER_L::GetSize) (FS_LPVOID clientData, FSCRT_FILESIZE *size) |
Callback function to retrieve the current file stream size.
[in] | clientData | Pointer to user-defined data. |
[out] | size | Pointer to structure FSCRT_FILESIZE that retrieves the stream size of current file. |
FS_RESULT(* FSCRT_FILEHANDLER_L::ReadBlock) (FS_LPVOID clientData, const FSCRT_FILESIZE *offset, FS_LPVOID buffer, const FSCRT_FILESIZE *size) |
Callback function to read data from the current file stream.
[in] | clientData | Pointer to user-defined data. |
[in] | offset | Offset position starts from the beginning of file stream. This parameter indicates reading position. |
[in] | buffer | Memory buffer to store data which are read from file stream. This parameter should not be NULL. |
[in] | size | Size of data which should be read from large file stream, in bytes. The buffer indicated by the parameter buffer should be enough to store specified data. |
void(* FSCRT_FILEHANDLER_L::Release) (FS_LPVOID clientData) |
Callback function to release the current file stream object.
[in] | clientData | Pointer to user-defined data. |
FS_RESULT(* FSCRT_FILEHANDLER_L::Truncate) (FS_LPVOID clientData, const FSCRT_FILESIZE *fileSize) |
Callback function to change file size.
This function is called with writing mode usually. Implementer can determine when to call it based on application requests.
[in] | clientData | Pointer to user-defined data. |
[in] | fileSize | New size of large file stream, in bytes. |
FS_RESULT(* FSCRT_FILEHANDLER_L::WriteBlock) (FS_LPVOID clientData, const FSCRT_FILESIZE *offset, FS_LPCVOID buffer, const FSCRT_FILESIZE *size) |
Callback function to write data into the current large file stream.
[in] | clientData | Pointer to user-defined data. |
[in] | offset | Offset position starts from the beginning of large file stream. This parameter indicates writing position. |
[in] | buffer | Memory buffer contains data which is written into file stream. This parameter should not be NULL. |
[in] | size | Size of data which should be written into large file stream, in bytes. |