aboutsummaryrefslogtreecommitdiff
path: root/src/3rdParty/efsw/WatcherGeneric.cpp
blob: a6bb10619beda633e96e0918ef6ef6f92992893e (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
26
27
28
29
30
31
32
33
#include <efsw/DirWatcherGeneric.hpp>
#include <efsw/FileSystem.hpp>
#include <efsw/WatcherGeneric.hpp>

namespace efsw {

WatcherGeneric::WatcherGeneric( WatchID id, const std::string& directory, FileWatchListener* fwl,
								FileWatcherImpl* fw, bool recursive ) :
	Watcher( id, directory, fwl, recursive ), WatcherImpl( fw ), DirWatch( NULL ) {
	FileSystem::dirAddSlashAtEnd( Directory );

	DirWatch = new DirWatcherGeneric( NULL, this, directory, recursive, false );

	DirWatch->addChilds( false );
}

WatcherGeneric::~WatcherGeneric() {
	efSAFE_DELETE( DirWatch );
}

void WatcherGeneric::watch() {
	DirWatch->watch();
}

void WatcherGeneric::watchDir( std::string dir ) {
	DirWatch->watchDir( dir );
}

bool WatcherGeneric::pathInWatches( std::string path ) {
	return DirWatch->pathInWatches( path );
}

} // namespace efsw