Refactor FileSystemWatcher interface to make it simpler

This commit is contained in:
Wojtek Figat
2021-05-30 14:12:17 +02:00
parent 2a3a15533c
commit 3c72abad37
2 changed files with 22 additions and 49 deletions

View File

@@ -87,7 +87,7 @@ VOID CALLBACK NotificationCompletion(DWORD dwErrorCode, DWORD dwNumberOfBytesTra
{
// Build path
String path(notify->FileName, notify->FileNameLength / sizeof(WCHAR));
path = watcher->GetDirectory() / path;
path = watcher->Directory / path;
// Send event
watcher->OnEvent(path, action);
@@ -106,7 +106,7 @@ BOOL RefreshWatch(WindowsFileSystemWatcher* watcher)
watcher->DirectoryHandle,
watcher->Buffer[watcher->CurrentBuffer],
FileSystemWatcher::BufferSize,
watcher->WithSubDirs() ? TRUE : FALSE,
watcher->WithSubDirs ? TRUE : FALSE,
FILE_NOTIFY_CHANGE_CREATION | FILE_NOTIFY_CHANGE_SIZE | FILE_NOTIFY_CHANGE_FILE_NAME,
&dwBytesReturned,
(OVERLAPPED*)&watcher->Overlapped,