IFS::Directory Class Reference

Wrapper class for enumerating a directory. More...

#include <Directory.h>

Inheritance diagram for IFS::Directory:
Collaboration diagram for IFS::Directory:

Public Member Functions

 ~Directory ()
 
bool open (const String &dirName=nullptr)
 Open a directory and attach this stream object to it. More...
 
void close ()
 Close directory. More...
 
bool rewind ()
 Rewind directory stream to start so it can be re-enumerated. More...
 
const StringgetDirName () const
 Name of directory stream is attached to. More...
 
bool dirExist () const
 Determine if directory exists. More...
 
String getPath () const
 Get path with leading separator /path/to/dir. More...
 
String getParent () const
 Get parent directory. More...
 
int index () const
 
uint32_t count () const
 
bool isValid () const
 
file_size_t size () const
 
const Statstat () const
 
bool next ()
 
 FsBase (IFileSystem *filesys=nullptr)
 
- Public Member Functions inherited from IFS::FsBase
 FsBase (IFileSystem *filesys=nullptr)
 
bool isValid () const
 
int getLastError ()
 determine if an error occurred during operation More...
 
String getErrorString (int err) const
 
String getLastErrorString () const
 
FileSystemgetFileSystem () const
 

Additional Inherited Members

- Protected Member Functions inherited from IFS::FsBase
bool check (int64_t res)
 Check file operation result and note error code. More...
 
- Protected Attributes inherited from IFS::FsBase
int lastError {FS_OK}
 

Detailed Description

Wrapper class for enumerating a directory.

Constructor & Destructor Documentation

◆ ~Directory()

IFS::Directory::~Directory ( )
inline

Member Function Documentation

◆ close()

void IFS::Directory::close ( )

Close directory.

◆ count()

uint32_t IFS::Directory::count ( ) const
inline

◆ dirExist()

bool IFS::Directory::dirExist ( ) const
inline

Determine if directory exists.

Return values
booltrue if stream is attached to a directory

◆ FsBase()

IFS::FsBase::FsBase
inline

◆ getDirName()

const String& IFS::Directory::getDirName ( ) const
inline

Name of directory stream is attached to.

Return values
Stringinvalid if stream isn't open

◆ getParent()

String IFS::Directory::getParent ( ) const

Get parent directory.

Return values
Stringinvalid if there is no parent directory

◆ getPath()

String IFS::Directory::getPath ( ) const

Get path with leading separator /path/to/dir.

◆ index()

int IFS::Directory::index ( ) const
inline

◆ isValid()

bool IFS::Directory::isValid ( ) const
inline

◆ next()

bool IFS::Directory::next ( )

◆ open()

bool IFS::Directory::open ( const String dirName = nullptr)

Open a directory and attach this stream object to it.

Parameters
dirNameDefault is root directory
Return values
booltrue on success, false on error
Note
call getLastError() to determine cause of failure

◆ rewind()

bool IFS::Directory::rewind ( )

Rewind directory stream to start so it can be re-enumerated.

Return values
booltrue on success, false on error
Note
call getLastError() to determine cause of failure

◆ size()

file_size_t IFS::Directory::size ( ) const
inline

◆ stat()

const Stat& IFS::Directory::stat ( ) const
inline

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