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

Public Member Functions

 Fat32Directory (intrusive_ref_ptr< FilesystemBase > parent, FastMutex &mutex, int currentInode, int parentInode)
 
DIR_ * directory ()
 
virtual int getdents (void *dp, int len)
 
virtual ~Fat32Directory ()
 
- Public Member Functions inherited from miosix::DirectoryBase
 DirectoryBase (intrusive_ref_ptr< FilesystemBase > parent)
 
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
 
- 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 ioctl (int cmd, void *arg)
 
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 &)
 
- Static Protected Member Functions inherited from miosix::DirectoryBase
static int addEntry (char **pos, char *end, int ino, char type, const StringPart &n)
 
static int addDefaultEntries (char **pos, int thisIno, int upIno)
 
static int addTerminatingEntry (char **pos, char *end)
 
- Static Protected Attributes inherited from miosix::DirectoryBase
static const int direntHeaderSizeNoPadding =offsetof(struct dirent,d_name)
 
static const int direntHeaderSize =(direntHeaderSizeNoPadding+3+3)/4*4
 
static const int minimumBufferSize =3*direntHeaderSize
 Minimum buffer accepted by getdents, two for . and .., plus terminating.
 

Detailed Description

Directory class for Fat32Fs

Constructor & Destructor Documentation

miosix::Fat32Directory::Fat32Directory ( intrusive_ref_ptr< FilesystemBase parent,
FastMutex mutex,
int  currentInode,
int  parentInode 
)
inline
Parameters
parentparent filesystem
mutexmutex to lock when accessing the fiesystem
currentInodeinode value for '.' entry
parentInodeinode value for '..' entry
miosix::Fat32Directory::~Fat32Directory ( )
virtual

Destructor

Member Function Documentation

DIR_* miosix::Fat32Directory::directory ( )
inline
Returns
the underlying directory object
int miosix::Fat32Directory::getdents ( void *  dp,
int  len 
)
virtual

Also directories can be opened as files. In this case, this system call allows to retrieve directory entries.

Parameters
dppointer to a memory buffer where one or more struct dirent will be placed. dp must be four words aligned.
lenmemory buffer size.
Returns
the number of bytes read on success, or a negative number on failure.

Reimplemented from miosix::FileBase.


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