libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
dir.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_CORE
13#include <promeki/namespace.h>
14#include <promeki/filepath.h>
15#include <promeki/string.h>
16#include <promeki/list.h>
17#include <promeki/error.h>
18#include <promeki/numnameseq.h>
19
20PROMEKI_NAMESPACE_BEGIN
21
44class Dir {
45 public:
47 Dir() = default;
48
53 Dir(const FilePath &path) : _path(path) {}
54
59 Dir(const String &path) : _path(path) {}
60
65 Dir(const char *path) : _path(path) {}
66
71 FilePath path() const { return _path; }
72
77 bool exists() const;
78
85 bool isEmpty() const;
86
91 List<FilePath> entryList() const;
92
100 List<FilePath> entryList(const String &filter) const;
101
126 NumNameSeq::List numberedSequences() const;
127
134 Error mkdir() const;
135
140 Error mkpath() const;
141
146 Error remove() const;
147
152 Error removeRecursively() const;
153
158 static Dir current();
159
164 static Dir home();
165
189 static Dir temp();
190
214 static Dir ipc();
215
221 static Error setCurrent(const FilePath &path);
222
223 private:
224 FilePath _path;
225};
226
227PROMEKI_NAMESPACE_END
228
229#endif // PROMEKI_ENABLE_CORE