1 #ifndef WREPORT_INTERNALS_FS_H
2 #define WREPORT_INTERNALS_FS_H
29 struct const_iterator :
public std::iterator<std::input_iterator_tag, struct dirent>
32 struct dirent* cur_entry = 0;
40 : dir(o.dir), cur_entry(o.cur_entry)
43 o.cur_entry =
nullptr;
51 struct dirent& operator*()
const {
return *cur_entry; }
52 struct dirent* operator->()
const {
return cur_entry; }
Access a directory on the file system.
Definition: fs.h:15
bool exists() const
Check if the directory exists.
Definition: fs.h:66
const_iterator begin() const
Begin iterator on all directory entries.
Definition: fs.h:60
int fd
O_PATH file descriptor pointing at the directory, or -1 if the directory does not exist...
Definition: fs.h:24
void stat(struct stat &st)
Call stat(2) on the directory.
const std::string & pathname
Pathname of the directory.
Definition: fs.h:18
const_iterator end() const
End iterator on all directory entries.
Definition: fs.h:63
Iterator for directory entries.
Definition: fs.h:29