-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (28 loc) · 695 Bytes
/
Copy pathmain.cpp
File metadata and controls
34 lines (28 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// WatchFolder.cpp : Defines the entry point for the console application.
//
#include "WatchDirectory.h"
int main()
{
//implements a DirectoryWatcher interface
class MyClass : public DirectoryWatcher
{
public:
virtual void OnDirChanged(const char* path)
{
//The Directory was changed
};
};
//Make a WatchDirectory and tell it which dir to watch
WatchDirectory watchDir;
watchDir.Watch("C:\\Users\\davep\\Dropbox\\Public");
//Set who is the listener for changes
MyClass watcher;
watchDir.SetCallBack(watcher);
//call process once per frame or at interval you would like to monitor for changes
while ( true )
{
watchDir.Process();
Sleep(2000);
}
return 0;
}