1/*
2 * Copyright 2007-2008, Haiku Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _PATH_MONITOR_H
6#define _PATH_MONITOR_H
7
8
9#include <NodeMonitor.h>
10
11
12// additional flags (combined with those in NodeMonitor.h)
13#define	B_WATCH_FILES_ONLY		0x0100
14#define B_WATCH_RECURSIVELY		0x0200
15#define	B_WATCH_FOLDERS_ONLY	0x0400
16// NOTE: B_WATCH_RECURSIVELY usually implies to watch for file changes as well,
17// if that is not desired, add B_WATCH_FOLDERS_ONLY to the flags.
18
19#define B_PATH_MONITOR		'_PMN'
20
21namespace BPrivate {
22
23class BPathMonitor {
24public:
25	static	status_t			StartWatching(const char* path, uint32 flags,
26									BMessenger target);
27
28	static	status_t			StopWatching(const char* path,
29									BMessenger target);
30	static	status_t			StopWatching(BMessenger target);
31
32private:
33								BPathMonitor();
34								~BPathMonitor();
35
36	static	status_t			_InitLockerIfNeeded();
37	static	status_t			_InitLooperIfNeeded();
38};
39
40}	// namespace BPrivate
41
42#endif	// _PATH_MONITOR_H
43