aboutsummaryrefslogtreecommitdiff
path: root/src/3rdParty/efsw/FileWatcherGeneric.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdParty/efsw/FileWatcherGeneric.hpp')
-rw-r--r--[-rwxr-xr-x]src/3rdParty/efsw/FileWatcherGeneric.hpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/3rdParty/efsw/FileWatcherGeneric.hpp b/src/3rdParty/efsw/FileWatcherGeneric.hpp
index 4cb0b67..47f7e04 100755..100644
--- a/src/3rdParty/efsw/FileWatcherGeneric.hpp
+++ b/src/3rdParty/efsw/FileWatcherGeneric.hpp
@@ -4,7 +4,7 @@
4#include <efsw/DirWatcherGeneric.hpp> 4#include <efsw/DirWatcherGeneric.hpp>
5#include <efsw/FileWatcherImpl.hpp> 5#include <efsw/FileWatcherImpl.hpp>
6#include <efsw/WatcherGeneric.hpp> 6#include <efsw/WatcherGeneric.hpp>
7#include <list> 7#include <vector>
8 8
9namespace efsw { 9namespace efsw {
10 10
@@ -12,7 +12,7 @@ namespace efsw {
12/// @class FileWatcherGeneric 12/// @class FileWatcherGeneric
13class FileWatcherGeneric : public FileWatcherImpl { 13class FileWatcherGeneric : public FileWatcherImpl {
14 public: 14 public:
15 typedef std::list<WatcherGeneric*> WatchList; 15 typedef std::vector<WatcherGeneric*> WatchList;
16 16
17 FileWatcherGeneric( FileWatcher* parent ); 17 FileWatcherGeneric( FileWatcher* parent );
18 18
@@ -20,23 +20,24 @@ class FileWatcherGeneric : public FileWatcherImpl {
20 20
21 /// Add a directory watch 21 /// Add a directory watch
22 /// On error returns WatchID with Error type. 22 /// On error returns WatchID with Error type.
23 WatchID addWatch( const std::string& directory, FileWatchListener* watcher, bool recursive ); 23 WatchID addWatch( const std::string& directory, FileWatchListener* watcher, bool recursive,
24 const std::vector<WatcherOption> &options ) override;
24 25
25 /// Remove a directory watch. This is a brute force lazy search O(nlogn). 26 /// Remove a directory watch. This is a brute force lazy search O(nlogn).
26 void removeWatch( const std::string& directory ); 27 void removeWatch( const std::string& directory ) override;
27 28
28 /// Remove a directory watch. This is a map lookup O(logn). 29 /// Remove a directory watch. This is a map lookup O(logn).
29 void removeWatch( WatchID watchid ); 30 void removeWatch( WatchID watchid ) override;
30 31
31 /// Updates the watcher. Must be called often. 32 /// Updates the watcher. Must be called often.
32 void watch(); 33 void watch() override;
33 34
34 /// Handles the action 35 /// Handles the action
35 void handleAction( Watcher* watch, const std::string& filename, unsigned long action, 36 void handleAction( Watcher* watch, const std::string& filename, unsigned long action,
36 std::string oldFilename = "" ); 37 std::string oldFilename = "" ) override;
37 38
38 /// @return Returns a list of the directories that are being watched 39 /// @return Returns a list of the directories that are being watched
39 std::list<std::string> directories(); 40 std::vector<std::string> directories() override;
40 41
41 protected: 42 protected:
42 Thread* mThread; 43 Thread* mThread;
@@ -49,7 +50,7 @@ class FileWatcherGeneric : public FileWatcherImpl {
49 50
50 Mutex mWatchesLock; 51 Mutex mWatchesLock;
51 52
52 bool pathInWatches( const std::string& path ); 53 bool pathInWatches( const std::string& path ) override;
53 54
54 private: 55 private:
55 void run(); 56 void run();