mFS file system library for EEPROM memory chips.
file Class Reference
mFS File handle class More...
#include <mfs.h>
Public Member Functions | |
| file (mfs *fs_ref, char filename[20], FileOpenMode operation) | |
| Create file handle. | |
| ~file () | |
| Close file handle. | |
| void | rewind () |
| Rewind to the start postion of the file. | |
| char | rewind (uint32_t n) |
| Reverse n bytes back. | |
| char | forward () |
| Forward one byte. | |
| char | forward (uint32_t n) |
| Forward n bytes. | |
| char | seek (uint32_t byte) |
| Seek to byte given. | |
| void | read (char *data, uint32_t n) |
| Reads a string of bytes. | |
| void | readBin (char *data, uint32_t n) |
| Reads a binary array of bytes. | |
| char | write (char *data, uint32_t n) |
| Write byte array to a file (buffer) | |
| char | flush () |
| Flush file buffer Writes buffer to the EEPROM chip in use. | |
Detailed Description
mFS File handle class
This class provides a file handle and data manipulation methods to be used for files stored in mFS files system.
Definition at line 223 of file mfs.h.
Constructor & Destructor Documentation
Create file handle.
- Warning:
- File must be created before it can be opened! Opening non-existing file will trip the system to error(); If read only file is opened in rw mode system will trip to error().
AWRITE is a file access mode where cursor can be moved along the file and write can be started at any point. write() function will overwrite only as many bytes as you chosen to write.
DWRITE is a file access mode similiar to AWRITE but when you start writing all the data after cursor will be removed permanently and flush() will set a new EOF marker.
- Parameters:
-
filename[20] Filename input. operation RO = Read only, AWRITE = read and write, DWRITE = read + destructive write.
| ~file | ( | ) |
Member Function Documentation
| char flush | ( | ) |
| char forward | ( | ) |
| char forward | ( | uint32_t | n ) |
| void read | ( | char * | data, |
| uint32_t | n | ||
| ) |
| void readBin | ( | char * | data, |
| uint32_t | n | ||
| ) |
| char rewind | ( | uint32_t | n ) |
| char seek | ( | uint32_t | byte ) |
Generated on Tue Jul 19 2022 05:47:57 by
1.7.2