aboutsummaryrefslogtreecommitdiff
path: root/dep/efsw/src/efsw/WatcherGeneric.cpp
blob: 94170d3ce879e522307fdf289c6eea45b0b42a42 (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
34
35
36
37
38
39
40
#include <efsw/WatcherGeneric.hpp>
#include <efsw/FileSystem.hpp>
#include <efsw/DirWatcherGeneric.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 );
}

}