MAV'RIC
Public Member Functions
File_fat_fs Class Reference

File objects on linux platforms. More...

#include <file_fat_fs.hpp>

Inheritance diagram for File_fat_fs:
Inheritance graph
[legend]
Collaboration diagram for File_fat_fs:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 File_fat_fs (bool debug_, fat_fs_mounting_t *fat_fs_mounting_)
 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

Detailed Description

File objects on linux platforms.


Member Function Documentation

bool File_fat_fs::close ( ) [virtual]

Close the file.

Returns:
success

Implements File.

int8_t File_fat_fs::exists ( const char *  path) [virtual]

Indicates if the file exits.

Returns:
1 if the file exists, 0 if the file doesn't exist, -1 if the file system is not responding properly

Implements File.

bool File_fat_fs::flush ( ) [virtual]

flush buffer to file

Returns:
success

Implements File.

bool File_fat_fs::is_open ( ) [virtual]

Indicates if the file is currently open.

Returns:
true if the file is open, false otherwise

Implements File.

uint32_t File_fat_fs::length ( ) [virtual]

Get the file length.

Returns:
The file length up to the maximum supported 4Gb.

Implements File.

uint32_t File_fat_fs::offset ( ) [virtual]

Get current location in file.

Returns:
Offset in bytes

Implements File.

bool File_fat_fs::open ( const char *  path) [virtual]

Open the file.

Returns:
true if the file is open, false otherwise

Implements File.

bool File_fat_fs::read ( uint8_t *  data,
uint32_t  size 
) [virtual]

Read from the file.

Parameters:
dataCaller supplied buffer to write to.
sizeThe number of bytes to attempt to read.
Returns:
success

Implements File.

bool File_fat_fs::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.

Parameters:
offsetThe distance to move from the origin_ parameter.
originOne of the SeekFrom enumeration.
Returns:
success

Implements File.

bool File_fat_fs::write ( const uint8_t *  data,
uint32_t  size 
) [virtual]

Write to the file.

Parameters:
dataThe buffer to write.
sizeThe number of bytes to write.
Returns:
success

Implements File.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines