A generic interface for all files on the FAT 16/32 filesystem.
More...
#include <PropWare/filesystem/fat/fatfile.h>
|
const char * | get_name () const |
| Determine the name of a file. More...
|
|
bool | exists () const |
| Determine if a file exists (file does not have to be open) More...
|
|
bool | exists (PropWare::ErrorCode &err) const |
|
virtual PropWare::ErrorCode | open ()=0 |
| Open the file. More...
|
|
virtual PropWare::ErrorCode | close () |
| Close a file - a required step in any workflow that includes opening a file. More...
|
|
virtual PropWare::ErrorCode | flush ()=0 |
| Flush any modified data back to the SD card. More...
|
|
int32_t | get_length () const |
| Return the number of bytes (characters) in the file.
|
|
int32_t | tell () const |
| Obtain the value of the file position indicator. More...
|
|
PropWare::ErrorCode | seek (const int32_t offset, const SeekDir way) |
| Sets the position of the next character to be read or written. More...
|
|
PropWare::ErrorCode | seek (const int32_t position) |
|
|
static const unsigned int | MAX_FILENAME_LENGTH = 32 |
|
A generic interface for all files on the FAT 16/32 filesystem.
Definition at line 36 of file fatfile.h.
◆ ErrorCode
◆ SeekDir
Enumerator |
---|
BEG | beginning of the stream
|
CUR | current position in the stream
|
END | end of the stream
|
Definition at line 47 of file file.h.
◆ close()
virtual PropWare::ErrorCode PropWare::File::close |
( |
| ) |
|
|
virtualinherited |
Close a file - a required step in any workflow that includes opening a file.
- Returns
- 0 upon success, error code otherwise
Definition at line 74 of file file.h.
◆ exists() [1/2]
bool PropWare::FatFile::exists |
( |
| ) |
const |
Determine if a file exists (file does not have to be open)
- Returns
- True if the file exists, false otherwise
Definition at line 62 of file fatfile.h.
◆ exists() [2/2]
bool PropWare::FatFile::exists |
( |
PropWare::ErrorCode & |
err | ) |
const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
[out] | err | It is possible for an error to occur |
Definition at line 72 of file fatfile.h.
◆ flush()
virtual PropWare::ErrorCode PropWare::File::flush |
( |
| ) |
|
|
pure virtualinherited |
◆ get_name()
const char* PropWare::FatFile::get_name |
( |
| ) |
const |
Determine the name of a file.
- Returns
- Character array containing the file - DO NOT modify the array, it will modify the internals of the file instance
Definition at line 53 of file fatfile.h.
◆ open()
virtual PropWare::ErrorCode PropWare::File::open |
( |
| ) |
|
|
pure virtualinherited |
◆ seek() [1/2]
PropWare::ErrorCode PropWare::File::seek |
( |
const int32_t |
offset, |
|
|
const SeekDir |
way |
|
) |
| |
|
inherited |
Sets the position of the next character to be read or written.
- Parameters
-
[in] | offset | Offset value, relative to the way parameter |
[in] | way | Starting position for the movement and direction of movement |
- Returns
- 0 upon success, error code otherwise
Definition at line 112 of file file.h.
◆ seek() [2/2]
PropWare::ErrorCode PropWare::File::seek |
( |
const int32_t |
position | ) |
|
|
inherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters
-
[in] | position | Absolute position to move the file position indicator |
Definition at line 147 of file file.h.
◆ tell()
int32_t PropWare::File::tell |
( |
| ) |
const |
|
inherited |
Obtain the value of the file position indicator.
- Postcondition
- The next byte to be read from the file
Definition at line 100 of file file.h.
The documentation for this class was generated from the following file: