Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dir Class Reference
[Filesystem]
#include <Dir.h>
Inherits mbed::DirHandle.
Public Member Functions | |
Dir () | |
Create an uninitialized directory. | |
Dir (FileSystem *fs, const char *path) | |
Open a directory on a filesystem. | |
virtual | ~Dir () |
Destroy a file. | |
virtual int | open (FileSystem *fs, const char *path) |
Open a directory on the filesystem. | |
virtual int | close () |
Close a directory. | |
virtual ssize_t | read (struct dirent *ent) |
Read the next directory entry. | |
virtual void | seek (off_t offset) |
Set the current position of the directory. | |
virtual off_t | tell () |
Get the current position of the directory. | |
virtual void | rewind () |
Rewind the current position to the beginning of the directory. | |
virtual size_t | size () |
Get the sizeof the directory. | |
MBED_DEPRECATED_SINCE ("mbed-os-5.4","Replaced by DirHandle::close") virtual int closedir() | |
Closes the directory. | |
MBED_DEPRECATED_SINCE ("mbed-os-5.4","Replaced by DirHandle::read") virtual struct dirent *readdir() | |
Return the directory entry at the current position, and advances the position to the next entry. | |
MBED_DEPRECATED_SINCE ("mbed-os-5.4","Replaced by DirHandle::rewind") virtual void rewinddir() | |
Resets the position to the beginning of the directory. | |
MBED_DEPRECATED_SINCE ("mbed-os-5.4","Replaced by DirHandle::tell") virtual off_t telldir() | |
Returns the current position of the DirHandle. | |
MBED_DEPRECATED_SINCE ("mbed-os-5.4","Replaced by DirHandle::seek") virtual void seekdir(off_t location) | |
Sets the position of the DirHandle. |
Detailed Description
Dir class.
Definition at line 30 of file Dir.h.
Constructor & Destructor Documentation
Dir | ( | ) |
Dir | ( | FileSystem * | fs, |
const char * | path | ||
) |
~Dir | ( | ) | [virtual] |
Member Function Documentation
int close | ( | void | ) | [virtual] |
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.4" | , |
"Replaced by DirHandle::close" | |||
) | [inherited] |
Closes the directory.
- Returns:
- 0 on success, -1 on error.
Definition at line 110 of file DirHandle.h.
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.4" | , |
"Replaced by DirHandle::tell" | |||
) | [inherited] |
Returns the current position of the DirHandle.
- Returns:
- the current position, -1 on error.
Definition at line 148 of file DirHandle.h.
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.4" | , |
"Replaced by DirHandle::read" | |||
) | [inherited] |
Return the directory entry at the current position, and advances the position to the next entry.
- Returns:
- A pointer to a dirent structure representing the directory entry at the current position, or NULL on reaching end of directory or error.
Definition at line 125 of file DirHandle.h.
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.4" | , |
"Replaced by DirHandle::rewind" | |||
) | [inherited] |
Resets the position to the beginning of the directory.
Definition at line 135 of file DirHandle.h.
MBED_DEPRECATED_SINCE | ( | "mbed-os-5.4" | , |
"Replaced by DirHandle::seek" | |||
) | [inherited] |
Sets the position of the DirHandle.
- Parameters:
-
location The location to seek to. Must be a value returned by telldir.
Definition at line 159 of file DirHandle.h.
int open | ( | FileSystem * | fs, |
const char * | path | ||
) | [virtual] |
ssize_t read | ( | struct dirent * | ent ) | [virtual] |
void rewind | ( | ) | [virtual] |
void seek | ( | off_t | offset ) | [virtual] |
size_t size | ( | ) | [virtual] |
Generated on Tue Aug 9 2022 00:37:38 by
