MAV'RIC
Public Member Functions
File_dummy Class Reference

File objects on linux platforms. More...

#include <file_dummy.hpp>

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

List of all members.

Public Member Functions

 File_dummy (void)
 Constructor.
bool open (const char __attribute__((unused))*path)
 Open the file.
bool is_open ()
 Indicates if the file is currently open.
int8_t exists (const char __attribute__((unused))*path)
 Indicates if the file exits.
bool close ()
 Close the file.
bool read (uint8_t __attribute__((unused))*data, uint32_t __attribute__((unused)) size)
 Read from the file.
bool write (const uint8_t __attribute__((unused))*data, uint32_t __attribute__((unused)) size)
 Write to the file.
bool seek (int32_t __attribute__((unused)) offset, file_seekfrom_t __attribute__((unused)) 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_dummy::close ( ) [inline, virtual]

Close the file.

Returns:
success

Implements File.

int8_t File_dummy::exists ( const char __attribute__((unused))*  path) [inline]

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
bool File_dummy::flush ( void  ) [inline, virtual]

flush buffer to file

Returns:
success

Implements File.

bool File_dummy::is_open ( ) [inline, virtual]

Indicates if the file is currently open.

Returns:
true if the file is open, false otherwise

Implements File.

uint32_t File_dummy::length ( ) [inline, virtual]

Get the file length.

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

Implements File.

uint32_t File_dummy::offset ( ) [inline, virtual]

Get current location in file.

Returns:
Offset in bytes

Implements File.

bool File_dummy::open ( const char __attribute__((unused))*  path) [inline]

Open the file.

Returns:
true if the file is open, false otherwise
bool File_dummy::read ( uint8_t __attribute__((unused))*  data,
uint32_t __attribute__((unused))  size 
) [inline]

Read from the file.

Parameters:
dataCaller supplied buffer to write to.
sizeThe number of bytes to attempt to read.
Returns:
success
bool File_dummy::seek ( int32_t __attribute__((unused))  offset,
file_seekfrom_t __attribute__((unused))  origin 
) [inline]

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
bool File_dummy::write ( const uint8_t __attribute__((unused))*  data,
uint32_t __attribute__((unused))  size 
) [inline]

Write to the file.

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

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