42 using clock_t = std::chrono::steady_clock;
52 static auto watch(
const fs::path& path,
56 clock_t::duration poll_interval,
58 const std::string& watcher_name =
"") -> std::uint64_t;
66 static void unwatch(std::uint64_t key);
83 static void touch(
const fs::path& path,
bool recursive, fs::file_time_type time = fs::now());
108 using namespace std::chrono;
110 const auto now_file = fs::file_time_type::clock::now();
111 const auto now_sys = system_clock::now();
113 return now_sys + (ft - now_file);
A filter that combines include and exclude patterns for file/directory filtering.
static void unwatch(std::uint64_t key)
Un-watches a previously registered file or directory.
static void resume()
Resumes all watchers.
std::function< void(const std::vector< entry > &, bool)> notify_callback
static void pause()
Pauses all watchers.
static void unwatch_all()
Un-watches all previously registered file or directory.
static void touch(const fs::path &path, bool recursive, fs::file_time_type time=fs::now())
Sets the last modification time of a file or directory. by default sets the time to the current time.
std::chrono::steady_clock clock_t
static auto watch(const fs::path &path, const pattern_filter &filter, bool recursive, bool initial_list, clock_t::duration poll_interval, notify_callback callback, const std::string &watcher_name="") -> std::uint64_t
Watches a file or directory for modification and call back the specified std::function....
auto filetime_to_system_clock(fs::file_time_type ft) -> std::chrono::system_clock::time_point
auto to_string(const watcher::entry &e) -> std::string
fs::file_time_type last_mod_time
std::chrono::system_clock::time_point event_time