blob: 72920c2c1f14b89bcf32bfebef440e3415ce0408 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#pragma once
#include <AK/AKString.h>
#include <dirent.h>
class CDirIterator {
public:
enum Flags
{
NoFlags = 0x0,
SkipDots = 0x1,
};
CDirIterator(const String& path, Flags = Flags::NoFlags);
~CDirIterator();
bool has_error() const { return m_error != 0; }
int error() const { return m_error; }
const char* error_string() const { return strerror(m_error); }
bool has_next();
String next_path();
private:
DIR* m_dir = nullptr;
int m_error = 0;
String m_next;
int m_flags;
bool advance_next();
};
|