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/FileWatcherImpl.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 '')
| -rwxr-xr-x | src/3rdParty/efsw/FileWatcherImpl.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/3rdParty/efsw/FileWatcherImpl.cpp b/src/3rdParty/efsw/FileWatcherImpl.cpp new file mode 100755 index 0000000..f6b86a5 --- /dev/null +++ b/src/3rdParty/efsw/FileWatcherImpl.cpp | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #include <efsw/FileWatcherImpl.hpp> | ||
| 2 | #include <efsw/String.hpp> | ||
| 3 | #include <efsw/System.hpp> | ||
| 4 | |||
| 5 | namespace efsw { | ||
| 6 | |||
| 7 | FileWatcherImpl::FileWatcherImpl( FileWatcher* parent ) : | ||
| 8 | mFileWatcher( parent ), mInitOK( false ), mIsGeneric( false ) { | ||
| 9 | System::maxFD(); | ||
| 10 | } | ||
| 11 | |||
| 12 | FileWatcherImpl::~FileWatcherImpl() {} | ||
| 13 | |||
| 14 | bool FileWatcherImpl::initOK() { | ||
| 15 | return static_cast<bool>( mInitOK ); | ||
| 16 | } | ||
| 17 | |||
| 18 | bool FileWatcherImpl::linkAllowed( const std::string& curPath, const std::string& link ) { | ||
| 19 | return ( mFileWatcher->followSymlinks() && mFileWatcher->allowOutOfScopeLinks() ) || | ||
| 20 | -1 != String::strStartsWith( curPath, link ); | ||
| 21 | } | ||
| 22 | |||
| 23 | } // namespace efsw | ||
