Structure for file 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_DWORD(* | GetSize )(FS_LPVOID clientData) |
Callback function to retrieve the current file stream size. More... | |
FS_RESULT(* | ReadBlock )(FS_LPVOID clientData, FS_DWORD offset, FS_LPVOID buffer, FS_DWORD size) |
Callback function to read data from the current file stream. More... | |
FS_RESULT(* | WriteBlock )(FS_LPVOID clientData, FS_DWORD offset, FS_LPCVOID buffer, FS_DWORD size) |
Callback function to write data into the current file stream. More... | |
FS_RESULT(* | Flush )(FS_LPVOID clientData) |
Callback function to flush all internal accessing buffers. More... | |
FS_RESULT(* | Truncate )(FS_LPVOID clientData, FS_DWORD size) |
Callback function to change file size. More... | |
Structure for file reading or writing (I/O).
FS_LPVOID FSCRT_FILEHANDLER::clientData |
User-defined data.
FS_RESULT(* FSCRT_FILEHANDLER::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_DWORD(* FSCRT_FILEHANDLER::GetSize) (FS_LPVOID clientData) |
Callback function to retrieve the current file stream size.
[in] | clientData | Pointer to user-defined data. |
FS_RESULT(* FSCRT_FILEHANDLER::ReadBlock) (FS_LPVOID clientData, FS_DWORD offset, FS_LPVOID buffer, FS_DWORD 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 file stream, in bytes. The buffer indicated by the parameter buffer should be enough to store specified data. |
void(* FSCRT_FILEHANDLER::Release) (FS_LPVOID clientData) |
Callback function to release the current file stream object.
[in] | clientData | Pointer to user-defined data. |
FS_RESULT(* FSCRT_FILEHANDLER::Truncate) (FS_LPVOID clientData, FS_DWORD size) |
Callback function to change file size.
This function is called under writing mode usually. Implementer can determine whether to realize it based on application requests.
[in] | clientData | Pointer to user-defined data. |
[in] | size | New size of file stream, in bytes. |
FS_RESULT(* FSCRT_FILEHANDLER::WriteBlock) (FS_LPVOID clientData, FS_DWORD offset, FS_LPCVOID buffer, FS_DWORD size) |
Callback function to write data into 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 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 file stream, in bytes. |