add io::directory_iterator

This commit is contained in:
MihailRis
2025-01-31 10:07:05 +03:00
parent c3066eebd3
commit 347d76870a
13 changed files with 182 additions and 64 deletions
+5
View File
@@ -23,6 +23,7 @@ namespace io {
virtual void mkdirs(std::string_view path) = 0;
virtual bool remove(std::string_view path) = 0;
virtual uint64_t removeAll(std::string_view path) = 0;
virtual std::unique_ptr<PathsGenerator> list(std::string_view path) = 0;
};
class SubDevice : public Device {
@@ -69,6 +70,10 @@ namespace io {
uint64_t removeAll(std::string_view path) override {
return parent->removeAll((root / path).pathPart());
}
std::unique_ptr<PathsGenerator> list(std::string_view path) override {
return parent->list((root / path).pathPart());
}
private:
std::shared_ptr<Device> parent;
path root;