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

namespace efsw {

WatcherInotify::WatcherInotify() : Watcher(), Parent( NULL ) {}

WatcherInotify::WatcherInotify( WatchID id, std::string directory, FileWatchListener* listener,
								bool recursive, WatcherInotify* parent ) :
	Watcher( id, directory, listener, recursive ), Parent( parent ), DirInfo( directory ) {}

bool WatcherInotify::inParentTree( WatcherInotify* parent ) {
	WatcherInotify* tNext = Parent;

	while ( NULL != tNext ) {
		if ( tNext == parent ) {
			return true;
		}

		tNext = tNext->Parent;
	}

	return false;
}

} // namespace efsw