MAV'RIC
|
File objects on linux platforms. More...
#include <file_linux.hpp>
Public Member Functions | |
File_linux () | |
Constructor. | |
bool | open (const char *path) |
Open the file. | |
bool | is_open () |
Indicates if the file is currently open. | |
int8_t | exists (const char *path) |
Indicates if the file exits. | |
bool | close () |
Close the file. | |
bool | read (uint8_t *data, uint32_t size) |
Read from the file. | |
bool | write (const uint8_t *data, uint32_t size) |
Write to the file. | |
bool | seek (int32_t offset, file_seekfrom_t origin) |
Seek to a given offset within the file. | |
uint32_t | offset () |
Get current location in file. | |
uint32_t | length () |
Get the file length. | |
bool | flush () |
flush buffer to file |
File objects on linux platforms.
bool File_linux::close | ( | ) | [virtual] |
int8_t File_linux::exists | ( | const char * | path | ) | [virtual] |
Indicates if the file exits.
Implements File.
bool File_linux::flush | ( | void | ) | [virtual] |
bool File_linux::is_open | ( | ) | [virtual] |
Indicates if the file is currently open.
Implements File.
uint32_t File_linux::length | ( | ) | [virtual] |
uint32_t File_linux::offset | ( | ) | [virtual] |
bool File_linux::open | ( | const char * | path | ) | [virtual] |
Open the file.
Implements File.
bool File_linux::read | ( | uint8_t * | data, |
uint32_t | size | ||
) | [virtual] |
Read from the file.
data | Caller supplied buffer to write to. |
size | The number of bytes to attempt to read. |
Implements File.
bool File_linux::seek | ( | int32_t | offset, |
file_seekfrom_t | origin | ||
) | [virtual] |
Seek to a given offset within the file.
Valid locations to seek to are from zero to the file length. Seeking to the file length moves the pointer to one past the end of the file data so that subsequent file writes append to the existing file.
offset | The distance to move from the origin_ parameter. |
origin | One of the SeekFrom enumeration. |
Implements File.
bool File_linux::write | ( | const uint8_t * | data, |
uint32_t | size | ||
) | [virtual] |
Write to the file.
data | The buffer to write. |
size | The number of bytes to write. |
Implements File.