Backlog/lib/watcher/src/watcher.cpp

18 lines
443 B
C++

#include <FileWatch.hpp>
extern "C" void* createWatchPoint(
const char* watchPath,
void(*cb)(const char*, void*),
void* ctx
){
auto* watch = new filewatch::FileWatch<std::string>(
watchPath,
[cb, ctx] (const std::string& path, const filewatch::Event change_type) {
// std::cout << event_to_string(change_type) << std::endl;
cb(path.c_str(), ctx);
}
);
return watch;
}