PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Basic file interface for opening and closing files. More...
#include <PropWare/filesystem/file.h>
Public Types | |
enum | ErrorCode { NO_ERROR = 0, BEG_ERROR = Filesystem::BEG_ERROR + 1, EOF_ERROR, INVALID_FILENAME, FILE_NOT_OPEN, END_ERROR = FILE_NOT_OPEN } |
enum | SeekDir { SeekDir::BEG, SeekDir::CUR, SeekDir::END } |
Public Member Functions | |
virtual | ~File () |
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 Public Attributes | |
static const unsigned int | MAX_FILENAME_LENGTH = 32 |
|
strong |
|
virtual |
|
pure virtual |
Flush any modified data back to the SD card.
Implemented in PropWare::FatFileWriter, and PropWare::FileReader.
|
pure virtual |
Open the file.
Implemented in PropWare::FatFileReader, and PropWare::FatFileWriter.
PropWare::ErrorCode PropWare::File::seek | ( | const int32_t | offset, |
const SeekDir | way | ||
) |
Sets the position of the next character to be read or written.
[in] | offset | Offset value, relative to the way parameter |
[in] | way | Starting position for the movement and direction of movement |
Definition at line 112 of file file.h.
PropWare::ErrorCode PropWare::File::seek | ( | const int32_t | position | ) |
int32_t PropWare::File::tell | ( | ) | const |