PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
A write-only file interface. More...
#include <PropWare/filesystem/filewriter.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 | |
FileWriter (Filesystem &fs, const char name[], BlockStorage::Buffer buffer, const Printer &logger=pwOut) | |
virtual PropWare::ErrorCode | safe_put_char (const char c)=0 |
Write a character to the file. More... | |
void | put_char (const char c) |
Write a character to the file. More... | |
virtual PropWare::ErrorCode | safe_puts (const char string[]) |
Write a character array to the file. More... | |
void | puts (const char string[]) |
Write a character array to the file. More... | |
void | print_status (const bool printBlocks=false, const bool printParentStatus=true) 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 Public Attributes | |
static const unsigned int | MAX_FILENAME_LENGTH = 32 |
A write-only file interface.
Definition at line 36 of file filewriter.h.
|
inherited |
|
stronginherited |
|
virtualinherited |
|
pure virtualinherited |
Flush any modified data back to the SD card.
Implemented in PropWare::FatFileWriter, and PropWare::FileReader.
|
pure virtualinherited |
Open the file.
Implemented in PropWare::FatFileReader, and PropWare::FatFileWriter.
|
virtual |
Write a character to the file.
[in] | c | Character that should be written |
Implements PropWare::PrintCapable.
Definition at line 57 of file filewriter.h.
|
virtual |
Write a character array to the file.
[in] | string | Null-terminated character array that should be written |
Implements PropWare::PrintCapable.
Definition at line 85 of file filewriter.h.
|
pure virtual |
Write a character to the file.
[in] | c | Character that should be written |
Implemented in PropWare::FatFileWriter.
|
virtual |
Write a character array to the file.
[in] | string | Null-terminated character array that should be written |
Definition at line 68 of file filewriter.h.
|
inherited |
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.
|
inherited |
|
inherited |