diff options
| author | Li Jin <dragon-fly@qq.com> | 2022-11-15 17:23:46 +0800 |
|---|---|---|
| committer | Li Jin <dragon-fly@qq.com> | 2022-11-15 17:52:09 +0800 |
| commit | 94f8330613877b3582d32bd11abd83a97b4399ad (patch) | |
| tree | 5359de314be1ebde17f8d1e48632a97d18f9e50f /src/3rdParty/efsw/WatcherGeneric.cpp | |
| parent | 60f8f00a022ac08701792b2897b72d8c99b50f52 (diff) | |
| download | yuescript-94f8330613877b3582d32bd11abd83a97b4399ad.tar.gz yuescript-94f8330613877b3582d32bd11abd83a97b4399ad.tar.bz2 yuescript-94f8330613877b3582d32bd11abd83a97b4399ad.zip | |
adding -w option to Yuescript tool.
Diffstat (limited to 'src/3rdParty/efsw/WatcherGeneric.cpp')
| -rwxr-xr-x | src/3rdParty/efsw/WatcherGeneric.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/3rdParty/efsw/WatcherGeneric.cpp b/src/3rdParty/efsw/WatcherGeneric.cpp new file mode 100755 index 0000000..a6bb106 --- /dev/null +++ b/src/3rdParty/efsw/WatcherGeneric.cpp | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | #include <efsw/DirWatcherGeneric.hpp> | ||
| 2 | #include <efsw/FileSystem.hpp> | ||
| 3 | #include <efsw/WatcherGeneric.hpp> | ||
| 4 | |||
| 5 | namespace efsw { | ||
| 6 | |||
| 7 | WatcherGeneric::WatcherGeneric( WatchID id, const std::string& directory, FileWatchListener* fwl, | ||
| 8 | FileWatcherImpl* fw, bool recursive ) : | ||
| 9 | Watcher( id, directory, fwl, recursive ), WatcherImpl( fw ), DirWatch( NULL ) { | ||
| 10 | FileSystem::dirAddSlashAtEnd( Directory ); | ||
| 11 | |||
| 12 | DirWatch = new DirWatcherGeneric( NULL, this, directory, recursive, false ); | ||
| 13 | |||
| 14 | DirWatch->addChilds( false ); | ||
| 15 | } | ||
| 16 | |||
| 17 | WatcherGeneric::~WatcherGeneric() { | ||
| 18 | efSAFE_DELETE( DirWatch ); | ||
| 19 | } | ||
| 20 | |||
| 21 | void WatcherGeneric::watch() { | ||
| 22 | DirWatch->watch(); | ||
| 23 | } | ||
| 24 | |||
| 25 | void WatcherGeneric::watchDir( std::string dir ) { | ||
| 26 | DirWatch->watchDir( dir ); | ||
| 27 | } | ||
| 28 | |||
| 29 | bool WatcherGeneric::pathInWatches( std::string path ) { | ||
| 30 | return DirWatch->pathInWatches( path ); | ||
| 31 | } | ||
| 32 | |||
| 33 | } // namespace efsw | ||
