openMSX
Public Member Functions | List of all members
openmsx::ReadDir Class Reference

Simple wrapper around openmdir() / readdir() / closedir() functions. More...

#include <ReadDir.hh>

Public Member Functions

 ReadDir (const ReadDir &)=delete
 
ReadDiroperator= (const ReadDir &)=delete
 
 ReadDir (const std::string &directory)
 
 ~ReadDir ()
 
struct dirent * getEntry ()
 Get directory entry for next file. More...
 
bool isValid () const
 Is the given directory valid (does it exist)? More...
 

Detailed Description

Simple wrapper around openmdir() / readdir() / closedir() functions.

Mainly useful to automatically call closedir() when object goes out of scope.

Definition at line 15 of file ReadDir.hh.

Constructor & Destructor Documentation

◆ ReadDir() [1/2]

openmsx::ReadDir::ReadDir ( const ReadDir )
delete

◆ ReadDir() [2/2]

openmsx::ReadDir::ReadDir ( const std::string &  directory)
explicit

Definition at line 5 of file ReadDir.cc.

◆ ~ReadDir()

openmsx::ReadDir::~ReadDir ( )

Definition at line 10 of file ReadDir.cc.

Member Function Documentation

◆ getEntry()

struct dirent * openmsx::ReadDir::getEntry ( )

Get directory entry for next file.

Returns nullptr when there are no more entries or in case of error (e.g. given directory does not exist).

Definition at line 17 of file ReadDir.cc.

Referenced by openmsx::Reactor::getHwConfigs().

◆ isValid()

bool openmsx::ReadDir::isValid ( ) const
inline

Is the given directory valid (does it exist)?

Definition at line 32 of file ReadDir.hh.

◆ operator=()

ReadDir& openmsx::ReadDir::operator= ( const ReadDir )
delete

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