openMSX
ReadDir.cc
Go to the documentation of this file.
1 #include "ReadDir.hh"
2 
3 namespace openmsx {
4 
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
struct dirent * getEntry()
Get directory entry for next file.
Definition: ReadDir.cc:17
ReadDir(const ReadDir &)=delete
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
Definition: zstring_view.hh:22
constexpr const char * c_str() const
Definition: zstring_view.hh:49
constexpr auto empty() const
Definition: zstring_view.hh:40
This file implemented 3 utility functions:
Definition: Autofire.cc:9