#pragma once #include #include #include #include #include namespace os { class Directory { public: static Result> open(const Path& path); enum class Filter { None, Hidden, ParentAndBase }; Result next(Filter filter); Result> list_names(Filter filter); struct Entry { String name; mode_t mode; usize size; time_t mtime; }; Result> list(Filter filter); void rewind(); int fd() { return dirfd(m_dirp); } ~Directory(); private: Directory(Badge); DIR* m_dirp { nullptr }; }; }