1#ifndef NEFORCE_CORE_FILE_FILE_WATCHER_HPP__
2#define NEFORCE_CORE_FILE_FILE_WATCHER_HPP__
15#include "NeForce/core/exception/system_exception.hpp"
19NEFORCE_BEGIN_NAMESPACE__
45 mutex callback_mutex_;
47#ifdef NEFORCE_PLATFORM_WINDOWS
50 ::OVERLAPPED overlapped_{};
64 void watch_thread_func();
107 NEFORCE_NODISCARD
const path&
watch_path() const noexcept {
return watch_path_; }
119 NEFORCE_NODISCARD
bool is_watching() const noexcept {
return watching_.load(); }
125 NEFORCE_NODISCARD
bool is_recursive() const noexcept {
return recursive_; }
148NEFORCE_END_NAMESPACE__
bool is_watching() const noexcept
检查是否正在监视
bool start(callback_t callback, file_watch_event events=file_watch_event::ALL)
开始监视
const path & watch_path() const noexcept
获取监视的目录路径
bool is_recursive() const noexcept
检查是否递归监视子目录
bool update_recursive(bool recursive)
更新递归设置
file_watcher(path watch_path, bool recursive=false)
构造函数
bool update_watch(file_watch_event events)
更新监视的事件类型
file_watch_event current_events() const noexcept
获取当前监视的事件类型
void * native_handle_type
系统句柄类型