42 std::string file_name;
45 std::vector<File> children;
50 void add_dir(std::string dir);
53 void add_dir(File& dir);
54 void poll_files_in(std::vector<std::string>& changes, File& dir);
55 void rescan(std::vector<std::string>& changes, File& dir);
57 void add_kevent(File& file);
59 void close_file(File& file);
62 const std::string _dir;
63 bool _recursive =
true;
64 bool _check_files =
true;
65 std::vector<File> _dirs;
66 std::vector<kevent> _events;
82 const unsigned _frame_delay;
84 std::set<std::string> _dirty_files;
85 unsigned _frames_since_last_change = 0;
Acts like DirWatcher but with a delay of a few frames to let things 'settle'.
Definition: dir_watcher.hpp:73
Watches for any changes in a directory (file changed, added, removed).
Definition: dir_watcher.hpp:23
std::vector< std::string > poll_files()
Returns a list of absolute paths to files that where added, removed or changed.
DirWatcher(std::string dir)
Feel free to end with a slash or not.
Definition: coroutine.hpp:18