MAV'RIC
Public Member Functions
File Class Reference

Base class for file objects. More...

#include <file.hpp>

Inheritance diagram for File:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual bool open (const char *path)=0
 Open the file.
virtual bool is_open ()=0
 Indicates if the file is currently open.
virtual int8_t exists (const char *path)=0
 Indicates if the file exits.
virtual bool close ()=0
 Close the file.
virtual bool read (uint8_t *data, uint32_t size)=0
 Read from the file.
virtual bool write (const uint8_t *data, uint32_t size)=0
 Write to the file.
virtual bool seek (int32_t offset, file_seekfrom_t origin)=0
 Seek to a given offset within the file.
virtual uint32_t offset ()=0
 Get current location in file.
virtual uint32_t length ()=0
 Get the file length.
virtual bool flush ()=0
 flush buffer to file; Not implemented;
bool newline ()
 write newline character to file ('
')

Detailed Description

Base class for file objects.


Member Function Documentation

virtual bool File::close ( ) [pure virtual]

Close the file.

Returns:
success

Implemented in File_fat_fs, File_dummy, File_linux, and File_flash_avr32.

Here is the caller graph for this function:

virtual int8_t File::exists ( const char *  path) [pure 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

Implemented in File_fat_fs, File_linux, and File_flash_avr32.

virtual bool File::flush ( ) [pure virtual]

flush buffer to file; Not implemented;

Returns:
success

Implemented in File_dummy, File_fat_fs, File_linux, and File_flash_avr32.

Here is the caller graph for this function:

virtual bool File::is_open ( ) [pure virtual]

Indicates if the file is currently open.

Returns:
true if the file is open, false otherwise

Implemented in File_fat_fs, File_dummy, File_linux, and File_flash_avr32.

virtual uint32_t File::length ( ) [pure virtual]

Get the file length.

Returns:
The file length in bytes

Implemented in File_dummy, File_fat_fs, File_linux, and File_flash_avr32.

Here is the caller graph for this function:

bool File::newline ( )

write newline character to file ('
')

Returns:
success

Here is the call graph for this function:

virtual uint32_t File::offset ( ) [pure virtual]

Get current location in file.

Returns:
Offset in bytes

Implemented in File_dummy, File_fat_fs, File_linux, and File_flash_avr32.

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

Open the file.

Returns:
success

Implemented in File_fat_fs, File_linux, and File_flash_avr32.

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

Read from the file.

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

Implemented in File_fat_fs, File_linux, and File_flash_avr32.

Here is the caller graph for this function:

virtual bool File::seek ( int32_t  offset,
file_seekfrom_t  origin 
) [pure 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 file_seekfrom_t enumeration.
Returns:
success

Implemented in File_fat_fs, File_linux, and File_flash_avr32.

Here is the caller graph for this function:

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

Write to the file.

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

Implemented in File_fat_fs, File_linux, and File_flash_avr32.

Here is the caller graph for this function:


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