FATFS file descriptor.
More...
#include </home/travis/build/forGGe/theCore/lib/fs/fat/export/ecl/fat/file.hpp>
◆ file() [1/2]
Constructs the FATFS file descriptor.
- Parameters
-
[in] | node | Weak smart pointer to the respective file inode. |
[in] | fs | Petite FATFS object. |
◆ ~file()
Closes and destructs the file descriptor.
◆ file() [2/2]
ecl::fat::file::file |
( |
const file & |
| ) |
|
|
delete |
◆ read()
ecl::err file::read |
( |
uint8_t * |
buf, |
|
|
size_t & |
size |
|
) |
| |
|
overridevirtual |
Reads data from a file to a buffer with given size.
- Precondition
- Valid and opened file descriptor.
Current read/write offset is advanced to an amount of bytes read.
- Parameters
-
[in] | buf | Buffer to store data into. Must not be NULL. |
[in,out] | size | Size of a buffer on entry, bytes read from a file on exit. In case of returned values is less than provided one, it means the read pointer has reached end of the file during read operation. |
- Returns
- Status of operation.
- Return values
-
err::notsup | Operation is not supported on a given filesystem. |
Implements ecl::fs::file_descriptor.
◆ write()
ecl::err file::write |
( |
const uint8_t * |
buf, |
|
|
size_t & |
size |
|
) |
| |
|
overridevirtual |
Writes data to a file from buffer with given size.
- Precondition
- Valid and opened file descriptor.
Current read/write offset is advanced to an amount of bytes written.
- Parameters
-
[in] | buf | Buffer to copy data from. Must not be NULL. |
[in,out] | size | Size of a buffer on entry, bytes written to a file on exit. |
- Returns
- Status of operation.
- Return values
-
err::notsup | Operation is not supported on a given filesystem. |
Implements ecl::fs::file_descriptor.
◆ seek()
Sets the file offset to a given value.
- Precondition
- Valid and opened file descriptor.
- Parameters
-
[in] | offt | New offset value. |
[in] | whence | Directs how to change offset:
- If set to seekdir::beg, the file offset shall be set to offset bytes.
- If set to seekdir::cur, the file offset shall be set to its current location plus offset.
- If set to is seekdir::end, the file offset shall be set to the size of the file plus offset.
|
- Returns
- Status of operation.
- Return values
-
err::notsup | Operation is not supported on a given filesystem. |
Implements ecl::fs::file_descriptor.
◆ tell()
Gets current file offset.
- Precondition
- Valid and opened file descriptor.
- Parameters
-
[out] | offt | Parameter to store offset into. |
- Returns
- Status of operation.
- Return values
-
err::notsup | Operation is not supported on a given filesystem. |
Implements ecl::fs::file_descriptor.
◆ close()
Closes the file descriptor.
- Precondition
- Valid and opened file descriptor.
- Postcondition
- File descriptor is closed.
- Returns
- Status of operation.
Implements ecl::fs::file_descriptor.
◆ operator=()
file& ecl::fat::file::operator= |
( |
file & |
| ) |
|
|
delete |
The documentation for this class was generated from the following files: