MAV'RIC
Public Member Functions
File_linux Class Reference

File objects on linux platforms. More...

#include <file_linux.hpp>

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

List of all members.

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

Detailed Description

File objects on linux platforms.


Member Function Documentation

bool File_linux::close ( ) [virtual]

Close the file.

Returns:
success

Implements File.

int8_t File_linux::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_linux::flush ( void  ) [virtual]

flush buffer to file

Returns:
success (always true)

Implements File.

bool File_linux::is_open ( ) [virtual]

Indicates if the file is currently open.

Returns:
true if the file is open, false otherwise

Implements File.

uint32_t File_linux::length ( ) [virtual]

Get the file length.

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

Implements File.

uint32_t File_linux::offset ( ) [virtual]

Get current location in file.

Returns:
Offset in bytes

Implements File.

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

Open the file.

Returns:
true if the file is open, false otherwise

Implements File.

Here is the caller graph for this function:

bool File_linux::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_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.

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

Implements File.

bool File_linux::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