#include <FAT16.hh>
Definition at line 558 of file FAT16.hh.
Construct file access instance. Must be use open() before any operation are possible.
Definition at line 564 of file FAT16.hh.
bool FAT16::File::addCluster |
( |
| ) |
|
|
protected |
int IOStream::Device::available |
( |
| ) |
|
|
virtualinherited |
void IOStream::Device::blocking |
( |
| ) |
|
|
inlineinherited |
bool FAT16::File::close |
( |
| ) |
|
|
inline |
Close a file and force cached data and directory information to be written to the storage device.
- Returns
- bool, true if successful otherwise false for failure. Reasons for failure include the file is not open for write or an I/O error occurred.
Definition at line 613 of file FAT16.hh.
void IOStream::Device::empty |
( |
| ) |
|
|
virtualinherited |
void IOStream::Device::eol |
( |
Mode |
mode | ) |
|
|
inlineinherited |
Set end of line mode.
- Parameters
-
Definition at line 103 of file IOStream.hh.
Mode IOStream::Device::eol |
( |
| ) |
const |
|
inlineinherited |
Get end of line mode.
- Returns
- mode.
Definition at line 112 of file IOStream.hh.
int IOStream::Device::flush |
( |
| ) |
|
|
virtualinherited |
bool FAT16::File::freeChain |
( |
fat_t |
cluster | ) |
|
|
protected |
int FAT16::File::getchar |
( |
| ) |
|
|
virtual |
char * IOStream::Device::gets |
( |
char * |
s, |
|
|
size_t |
count |
|
) |
| |
|
virtualinherited |
Read string terminated by new-line or until size into given string buffer. Returns pointer to string or NULL if empty line.
- Parameters
-
[in] | s | string buffer to read into. |
[in] | count | max number of bytes to read. |
- Returns
- string pointer or NULL.
Definition at line 118 of file IOStream_Device.cpp.
bool IOStream::Device::is_blocking |
( |
| ) |
const |
|
inlineinherited |
Is blocking mode?
- Returns
- bool.
Definition at line 94 of file IOStream.hh.
bool FAT16::File::is_open |
( |
void |
| ) |
const |
|
inline |
Checks the file's open/closed status.
- Returns
- the value true if a file is open otherwise false;
Definition at line 584 of file FAT16.hh.
static uint8_t FAT16::File::isEOC |
( |
fat_t |
cluster | ) |
|
|
inlinestaticprotected |
void IOStream::Device::non_blocking |
( |
| ) |
|
|
inlineinherited |
Set non-blocking mode.
Definition at line 77 of file IOStream.hh.
bool FAT16::File::open |
( |
const char * |
fileName, |
|
|
uint8_t |
oflag |
|
) |
| |
Open a file by file name and mode flags. The file must be in the root directory and must have a DOS 8.3 name. Returns true if successful otherwise false for failure. Reasons for failure include the FAT volume has not been initialized, a file is already open, file name, is invalid, the file does not exist, is a directory, or can't be opened in the access mode specified by oflag.
- Parameters
-
[in] | fileName | a valid 8.3 DOS name for a file in the root. |
[in] | oflag | mode of file open (create, read, write, etc). |
- Returns
- bool.
Definition at line 143 of file FAT16.cpp.
bool FAT16::File::open |
( |
uint16_t |
entry, |
|
|
uint8_t |
oflag |
|
) |
| |
|
protected |
int IOStream::Device::peekchar |
( |
| ) |
|
|
virtualinherited |
int IOStream::Device::peekchar |
( |
char |
c | ) |
|
|
virtualinherited |
Peek for the given character in device buffer. Return number of characters or EOF(-1).
- Parameters
-
[in] | c | character to peek for. |
- Returns
- available or EOF(-1).
Reimplemented in Soft::UART, UART, and IOBuffer< SIZE >.
Definition at line 105 of file IOStream_Device.cpp.
int FAT16::File::putchar |
( |
char |
c | ) |
|
|
virtual |
Write character to the file.
- Parameters
-
- Returns
- character written or EOF(-1).
Reimplemented from IOStream::Device.
Definition at line 377 of file FAT16.cpp.
int IOStream::Device::puts |
( |
const char * |
s | ) |
|
|
virtualinherited |
Write null terminated string to device. Terminating null is not written.
- Parameters
-
- Returns
- zero(0) or negative error code.
Definition at line 43 of file IOStream_Device.cpp.
int IOStream::Device::puts |
( |
str_P |
s | ) |
|
|
virtualinherited |
Write null terminated string from program memory to device. Terminating null is not written.
- Parameters
-
[in] | s | string in program memory to write. |
- Returns
- zero(0) or negative error code.
Definition at line 54 of file IOStream_Device.cpp.
int IOStream::Device::read |
( |
iovec_t * |
vec | ) |
|
|
virtualinherited |
Read data to given buffers in null terminated io vector.
- Parameters
-
[in] | vec | io vector with buffers to read into. |
- Returns
- number of bytes read or EOF(-1).
Definition at line 157 of file IOStream_Device.cpp.
int FAT16::File::read |
( |
void * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
virtual |
Read data to given buffer with given size from the file.
- Parameters
-
[in] | buf | buffer to read into. |
[in] | size | number of bytes to read. |
- Returns
- number of bytes read or EOF(-1).
Reimplemented from IOStream::Device.
Definition at line 248 of file FAT16.cpp.
bool FAT16::File::remove |
( |
void |
| ) |
|
Remove a file. The directory entry and all data for the file are deleted. This function should not be used to delete the 8.3 version of a file that has a long name. For example if a file has the long name "New Text Document.txt" you should not delete
- Returns
- bool, true if successful otherwise false for failure. Reasons for failure include the file is not open for write or an I/O error occurred.
Definition at line 228 of file FAT16.cpp.
void FAT16::File::rewind |
( |
| ) |
|
|
inline |
Rewind to the start of the file.
Definition at line 637 of file FAT16.hh.
int IOStream::Device::room |
( |
| ) |
|
|
virtualinherited |
bool FAT16::File::seek |
( |
uint32_t |
pos, |
|
|
uint8_t |
whence = SEEK_SET |
|
) |
| |
Sets the file's read/write position relative to mode.
- Parameters
-
[in] | pos | new position in bytes from given mode. |
[in] | mode | absolute, relative and from end. |
- Returns
- bool, true if successful otherwise false for failure.
Definition at line 383 of file FAT16.cpp.
uint32_t FAT16::File::size |
( |
| ) |
|
|
inline |
Return number of bytes in file.
Definition at line 642 of file FAT16.hh.
bool FAT16::File::sync |
( |
void |
| ) |
|
The sync() call causes all modified data and directory fields to be written to the storage device.
- Returns
- true if successful otherwise false for failure. Reasons for failure include a call to sync() before a file has been opened or an I/O error.
Definition at line 121 of file FAT16.cpp.
uint32_t FAT16::File::tell |
( |
| ) |
|
|
inline |
Return current position.
Definition at line 632 of file FAT16.hh.
bool FAT16::File::truncate |
( |
uint32_t |
size | ) |
|
Truncate a file to a specified length. The current file position will be maintained if it is less than or equal to length otherwise it will be set to end of file.
- Parameters
-
[in] | length | The desired length for the file. |
- Returns
- bool, true if successful otherwise false for failure. Reasons for failure include file is read only, file is a directory, length is greater than the current file size or an I/O error occurs.
Definition at line 413 of file FAT16.cpp.
int IOStream::Device::write |
( |
const iovec_t * |
vec | ) |
|
|
virtualinherited |
Write data from buffers in null terminated io vector.
- Parameters
-
[in] | vec | io vector with buffers to write. |
- Returns
- number of bytes written or EOF(-1).
Definition at line 87 of file IOStream_Device.cpp.
int FAT16::File::write |
( |
const void * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
virtual |
Write data from buffer with given size to the file.
- Parameters
-
[in] | buf | buffer to write. |
[in] | size | number of bytes to write. |
- Returns
- number of bytes written or EOF(-1).
Reimplemented from IOStream::Device.
Definition at line 299 of file FAT16.cpp.
int IOStream::Device::write_P |
( |
const void * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
virtualinherited |
Write data from buffer in program memory with given size to device.
- Parameters
-
[in] | buf | buffer to write. |
[in] | size | number of bytes to write. |
- Returns
- number of bytes written or EOF(-1).
Reimplemented in CFFS::File, Socket, and CC3000::Driver.
Definition at line 76 of file IOStream_Device.cpp.
bool IOStream::Device::m_blocking |
|
protectedinherited |
fat_t FAT16::File::m_curCluster |
|
protected |
uint32_t FAT16::File::m_curPosition |
|
protected |
int16_t FAT16::File::m_dirEntryIndex |
|
protected |
Mode IOStream::Device::m_eol |
|
protectedinherited |
uint32_t FAT16::File::m_fileSize |
|
protected |
fat_t FAT16::File::m_firstCluster |
|
protected |
uint8_t FAT16::File::m_flags |
|
protected |
The documentation for this class was generated from the following files: