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.
Dependents: mbed-os-example-blinky-gr-lychee GR-Boads_Camera_sample GR-Boards_Audio_Recoder GR-Boads_Camera_DisplayApp ... more
Dir Class Reference
[Filesystem]
#include <Dir.h>
Inherited by ManagedDir.
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. | |
Detailed Description
Dir class.
Definition at line 29 of file Dir.h.
Constructor & Destructor Documentation
| Dir | ( | ) |
Create an uninitialized directory.
Must call open to initialize the directory on a file system
| Dir | ( | FileSystem * | fs, |
| const char * | path | ||
| ) |
Open a directory on a filesystem.
- Parameters:
-
fs Filesystem as target for a directory path Name of the directory to open
| virtual ~Dir | ( | ) | [virtual] |
Destroy a file.
Closes file if the file is still open
Member Function Documentation
| virtual int close | ( | ) | [virtual] |
Close a directory.
return 0 on success, negative error code on failure
| virtual int open | ( | FileSystem * | fs, |
| const char * | path | ||
| ) | [virtual] |
Open a directory on the filesystem.
- Parameters:
-
fs Filesystem as target for a directory path Name of the directory to open
- Returns:
- 0 on success, negative error code on failure
| virtual ssize_t read | ( | struct dirent * | ent ) | [virtual] |
Read the next directory entry.
- Parameters:
-
path The buffer to read the null terminated path name in to ent The directory entry to fill out
- Returns:
- 1 on reading a filename, 0 at end of directory, negative error on failure
| virtual void rewind | ( | ) | [virtual] |
Rewind the current position to the beginning of the directory.
| virtual void seek | ( | off_t | offset ) | [virtual] |
Set the current position of the directory.
- Parameters:
-
offset Offset of the location to seek to, must be a value returned from tell
| virtual size_t size | ( | ) | [virtual] |
Get the sizeof the directory.
- Returns:
- Number of files in the directory
| virtual off_t tell | ( | ) | [virtual] |
Get the current position of the directory.
- Returns:
- Position of the directory that can be passed to rewind
Generated on Tue Jul 12 2022 11:02:42 by
1.7.2