openMSX
ReadDir.cc
Go to the documentation of this file.
1 #include "ReadDir.hh"
2 
3 namespace openmsx {
4 
5 ReadDir::ReadDir(const std::string& directory)
6 {
7  dir = opendir(directory.empty() ? "." : directory.c_str());
8 }
9 
11 {
12  if (dir) {
13  closedir(dir);
14  }
15 }
16 
17 struct dirent* ReadDir::getEntry()
18 {
19  if (!dir) {
20  return nullptr;
21  }
22  return readdir(dir);
23 }
24 
25 } // namespace openmsx
ReadDir(const ReadDir &)=delete
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
struct dirent * getEntry()
Get directory entry for next file.
Definition: ReadDir.cc:17