openMSX
ReadDir.cc
Go to the documentation of this file.
1#include "ReadDir.hh"
2
3namespace openmsx {
4
6 : dir(opendir(directory.empty() ? "." : directory.c_str()))
7{
8}
9
11{
12 if (dir) {
13 closedir(dir);
14 }
15}
16
17struct 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(zstring_view directory)
Definition ReadDir.cc:5
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
This file implemented 3 utility functions:
Definition Autofire.cc:11