|
libcmutils 0.6.5
Multi-platform C99 utility library
|
File stream object for reading and writing files. More...
Data Fields | |
| ssize_t(* | Read )(const CMUTIL_FileStream *fs, CMUTIL_String *buffer, size_t size) |
| Read data from the file stream into a buffer. | |
| ssize_t(* | Write )(const CMUTIL_FileStream *fs, const CMUTIL_String *buffer, size_t offset, size_t size) |
| Write data from a buffer to the file stream. | |
| void(* | Close )(CMUTIL_FileStream *fs) |
| Close the file stream and free its resources. | |
File stream object for reading and writing files.
| ssize_t(* CMUTIL_FileStream::Read) (const CMUTIL_FileStream *fs, CMUTIL_String *buffer, size_t size) |
Read data from the file stream into a buffer.
This method only available if this object created with CMFileOpenRead mode, otherwise will return -1.
| fs | A pointer to the CMUTIL_FileStream object. |
| buffer | A pointer to the buffer where the read data will be stored. |
| size | The number of bytes to read from the file stream. |
| ssize_t(* CMUTIL_FileStream::Write) (const CMUTIL_FileStream *fs, const CMUTIL_String *buffer, size_t offset, size_t size) |
Write data from a buffer to the file stream.
This method only available if this object created with CMFileOpenWrite or CMFileOpenAppend mode, otherwise will return -1.
| fs | A pointer to the CMUTIL_FileStream object. |
| buffer | A pointer to the buffer containing the data to write. |
| offset | The offset in the buffer from which to start writing. |
| size | The number of bytes to write to the file stream. |
| void(* CMUTIL_FileStream::Close) (CMUTIL_FileStream *fs) |
Close the file stream and free its resources.
| fs | A pointer to the CMUTIL_FileStream object to be closed. |