aboutsummaryrefslogtreecommitdiff
path: root/src/3rdParty/efsw/FileWatcherImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdParty/efsw/FileWatcherImpl.cpp')
-rw-r--r--[-rwxr-xr-x]src/3rdParty/efsw/FileWatcherImpl.cpp57
1 files changed, 34 insertions, 23 deletions
diff --git a/src/3rdParty/efsw/FileWatcherImpl.cpp b/src/3rdParty/efsw/FileWatcherImpl.cpp
index f6b86a5..bf69a45 100755..100644
--- a/src/3rdParty/efsw/FileWatcherImpl.cpp
+++ b/src/3rdParty/efsw/FileWatcherImpl.cpp
@@ -1,23 +1,34 @@
1#include <efsw/FileWatcherImpl.hpp> 1#include <efsw/FileWatcherImpl.hpp>
2#include <efsw/String.hpp> 2#include <efsw/String.hpp>
3#include <efsw/System.hpp> 3#include <efsw/System.hpp>
4 4
5namespace efsw { 5namespace efsw {
6 6
7FileWatcherImpl::FileWatcherImpl( FileWatcher* parent ) : 7FileWatcherImpl::FileWatcherImpl( FileWatcher* parent ) :
8 mFileWatcher( parent ), mInitOK( false ), mIsGeneric( false ) { 8 mFileWatcher( parent ), mInitOK( false ), mIsGeneric( false ) {
9 System::maxFD(); 9 System::maxFD();
10} 10}
11 11
12FileWatcherImpl::~FileWatcherImpl() {} 12FileWatcherImpl::~FileWatcherImpl() {}
13 13
14bool FileWatcherImpl::initOK() { 14bool FileWatcherImpl::initOK() {
15 return static_cast<bool>( mInitOK ); 15 return static_cast<bool>( mInitOK );
16} 16}
17 17
18bool FileWatcherImpl::linkAllowed( const std::string& curPath, const std::string& link ) { 18bool FileWatcherImpl::linkAllowed( const std::string& curPath, const std::string& link ) {
19 return ( mFileWatcher->followSymlinks() && mFileWatcher->allowOutOfScopeLinks() ) || 19 return ( mFileWatcher->followSymlinks() && mFileWatcher->allowOutOfScopeLinks() ) ||
20 -1 != String::strStartsWith( curPath, link ); 20 -1 != String::strStartsWith( curPath, link );
21} 21}
22 22
23} // namespace efsw 23int FileWatcherImpl::getOptionValue( const std::vector<WatcherOption>& options, Option option,
24 int defaultValue ) {
25 for ( size_t i = 0; i < options.size(); i++ ) {
26 if ( options[i].mOption == option ) {
27 return options[i].mValue;
28 }
29 }
30
31 return defaultValue;
32}
33
34} // namespace efsw