Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions
mbed::Dir Class Reference

#include <Dir.h>

Inheritance diagram for mbed::Dir:
mbed::DirHandle mbed::NonCopyable< DirHandle >

Public Member Functions

 Dir ()
 
 Dir (FileSystem *fs, const char *path)
 
virtual ~Dir ()
 
virtual int open (FileSystem *fs, const char *path)
 
virtual int close ()
 
virtual ssize_t read (struct dirent *ent)
 
virtual void seek (off_t offset)
 
virtual off_t tell ()
 
virtual void rewind ()
 
virtual size_t size ()
 
- Public Member Functions inherited from mbed::DirHandle
virtual int closedir ()
 
virtual struct direntreaddir ()
 
virtual void rewinddir ()
 
virtual off_t telldir ()
 
virtual void seekdir (off_t location)
 

Detailed Description

Dir class

Constructor & Destructor Documentation

mbed::Dir::Dir ( )

Create an uninitialized directory

Must call open to initialize the directory on a file system

mbed::Dir::Dir ( FileSystem fs,
const char *  path 
)

Open a directory on a filesystem

Parameters
fsFilesystem as target for a directory
pathName of the directory to open
mbed::Dir::~Dir ( )
virtual

Destroy a file

Closes file if the file is still open

Member Function Documentation

int mbed::Dir::close ( )
virtual

Close a directory

Returns
0 on success, negative error code on failure

Implements mbed::DirHandle.

int mbed::Dir::open ( FileSystem fs,
const char *  path 
)
virtual

Open a directory on the filesystem

Parameters
fsFilesystem as target for a directory
pathName of the directory to open
Returns
0 on success, negative error code on failure
ssize_t mbed::Dir::read ( struct dirent ent)
virtual

Read the next directory entry

Parameters
entThe directory entry to fill out
Returns
1 on reading a filename, 0 at end of directory, negative error on failure

Implements mbed::DirHandle.

void mbed::Dir::rewind ( )
virtual

Rewind the current position to the beginning of the directory

Implements mbed::DirHandle.

void mbed::Dir::seek ( off_t  offset)
virtual

Set the current position of the directory

Parameters
offsetOffset of the location to seek to, must be a value returned from tell

Implements mbed::DirHandle.

size_t mbed::Dir::size ( )
virtual

Get the sizeof the directory

Returns
Number of files in the directory

Reimplemented from mbed::DirHandle.

off_t mbed::Dir::tell ( )
virtual

Get the current position of the directory

Returns
Position of the directory that can be passed to rewind

Implements mbed::DirHandle.


The documentation for this class was generated from the following files:
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.