4 #include <FileSystemEvent.h>
5 #include <experimental/filesystem>
8 namespace fs
= std::experimental::filesystem
;
14 NotifyService() : inotify
{IN_MODIFY
| IN_MOVED_TO
} {}
16 void watch(std::shared_ptr
<Project
> project
) {
17 inotify
.watchDirectoryRecursively(project
->basepath
);
18 projects
[project
->basepath
]= project
;
22 auto event
= inotify
.nb_getNextEvent();
24 if (event
->recursive_root_path
) {
25 auto path
= *event
->recursive_root_path
;
26 if (projects
.find(path
) != projects
.end()) {
27 std::cout
<< "=== reloading shaders ===\n";
28 projects
[path
]->reload_shaders();
36 std::map
<fs::path
, std::shared_ptr
<Project
>> projects
;