mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-23 19:49:43 +01:00
25 lines
532 B
C++
25 lines
532 B
C++
#pragma once
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#define NOMINMAX
|
|
#include <Windows.h>
|
|
|
|
#include <thread>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <functional>
|
|
|
|
class FileWatcher
|
|
{
|
|
std::wstring m_path;
|
|
std::wstring m_file_name;
|
|
std::optional<FILETIME> m_lastWrite;
|
|
std::function<void()> m_callback;
|
|
wil::unique_folder_change_reader_nothrow m_folder_change_reader;
|
|
|
|
std::optional<FILETIME> MyFileTime();
|
|
public:
|
|
FileWatcher(const std::wstring& path, std::function<void()> callback);
|
|
~FileWatcher();
|
|
};
|