aboutsummaryrefslogtreecommitdiff
path: root/src/3rdParty/efsw/FileWatcherImpl.cpp
blob: f6b86a57f3b9c1b0761ddd3c640fc79d242aec27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <efsw/FileWatcherImpl.hpp>
#include <efsw/String.hpp>
#include <efsw/System.hpp>

namespace efsw {

FileWatcherImpl::FileWatcherImpl( FileWatcher* parent ) :
	mFileWatcher( parent ), mInitOK( false ), mIsGeneric( false ) {
	System::maxFD();
}

FileWatcherImpl::~FileWatcherImpl() {}

bool FileWatcherImpl::initOK() {
	return static_cast<bool>( mInitOK );
}

bool FileWatcherImpl::linkAllowed( const std::string& curPath, const std::string& link ) {
	return ( mFileWatcher->followSymlinks() && mFileWatcher->allowOutOfScopeLinks() ) ||
		   -1 != String::strStartsWith( curPath, link );
}

} // namespace efsw