Miosix  2.0alpha1
miosix::Fat32File Class Reference
Inheritance diagram for miosix::Fat32File:
Collaboration diagram for miosix::Fat32File:

Public Member Functions

 Fat32File (intrusive_ref_ptr< FilesystemBase > parent, FastMutex &mutex)
 
virtual ssize_t write (const void *data, size_t len)
 
virtual ssize_t read (void *data, size_t len)
 
virtual off_t lseek (off_t pos, int whence)
 
virtual int fstat (struct stat *pstat) const
 
virtual int ioctl (int cmd, void *arg)
 
FIL * fil ()
 
void setInode (int inode)
 
 ~Fat32File ()
 
- Public Member Functions inherited from miosix::FileBase
 FileBase (intrusive_ref_ptr< FilesystemBase > parent)
 
virtual int isatty () const
 
virtual int fcntl (int cmd, int opt)
 
virtual int getdents (void *dp, int len)
 
const intrusive_ref_ptr
< FilesystemBase
getParent () const
 
virtual ~FileBase ()
 

Additional Inherited Members

- Protected Member Functions inherited from miosix::IntrusiveRefCounted
 IntrusiveRefCounted ()
 
 IntrusiveRefCounted (const IntrusiveRefCounted &)
 
IntrusiveRefCountedoperator= (const IntrusiveRefCounted &)
 

Detailed Description

Files of the Fat32Fs filesystem

Constructor & Destructor Documentation

miosix::Fat32File::Fat32File ( intrusive_ref_ptr< FilesystemBase parent,
FastMutex mutex 
)

Constructor

Parameters
parentthe filesystem to which this file belongs
miosix::Fat32File::~Fat32File ( )

Destructor

Member Function Documentation

FIL* miosix::Fat32File::fil ( )
inline
Returns
the FatFs FIL object
int miosix::Fat32File::fstat ( struct stat *  pstat) const
virtual

Return file information.

Parameters
pstatpointer to stat struct
Returns
0 on success, or a negative number on failure

Implements miosix::FileBase.

int miosix::Fat32File::ioctl ( int  cmd,
void *  arg 
)
virtual

Perform various operations on a file descriptor

Parameters
cmdspecifies the operation to perform
argoptional argument that some operation require
Returns
the exact return value depends on CMD, -1 is returned on error

Reimplemented from miosix::FileBase.

off_t miosix::Fat32File::lseek ( off_t  pos,
int  whence 
)
virtual

Move file pointer, if the file supports random-access.

Parameters
posoffset to sum to the beginning of the file, current position or end of file, depending on whence
whenceSEEK_SET, SEEK_CUR or SEEK_END
Returns
the offset from the beginning of the file if the operation completed, or a negative number in case of errors

Implements miosix::FileBase.

ssize_t miosix::Fat32File::read ( void *  data,
size_t  len 
)
virtual

Read data from the file, if the file supports reading.

Parameters
databuffer to store read data
lenthe number of bytes to read
Returns
the number of read characters, or a negative number in case of errors

Implements miosix::FileBase.

void miosix::Fat32File::setInode ( int  inode)
inline
Parameters
inodefile inode
ssize_t miosix::Fat32File::write ( const void *  data,
size_t  len 
)
virtual

Write data to the file, if the file supports writing.

Parameters
datathe data to write
lenthe number of bytes to write
Returns
the number of written characters, or a negative number in case of errors

Implements miosix::FileBase.


The documentation for this class was generated from the following file: