2007-05-04 20:02:04 +04:00
|
|
|
/*
|
2008-08-06 20:56:24 +04:00
|
|
|
* Copyright 2007-2008, Haiku Inc. All Rights Reserved.
|
2007-05-04 20:02:04 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _PATH_MONITOR_H
|
|
|
|
#define _PATH_MONITOR_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <NodeMonitor.h>
|
|
|
|
|
|
|
|
|
|
|
|
// additional flags (combined with those in NodeMonitor.h)
|
2008-08-12 00:02:59 +04:00
|
|
|
#define B_WATCH_FILES_ONLY 0x0100
|
|
|
|
#define B_WATCH_RECURSIVELY 0x0200
|
|
|
|
#define B_WATCH_FOLDERS_ONLY 0x0400
|
|
|
|
// NOTE: B_WATCH_RECURSIVELY usually implies to watch for file changes as well,
|
|
|
|
// if that is not desired, add B_WATCH_FOLDERS_ONLY to the flags.
|
2007-05-04 20:02:04 +04:00
|
|
|
|
|
|
|
#define B_PATH_MONITOR '_PMN'
|
|
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
|
|
|
|
class BPathMonitor {
|
2008-08-04 17:04:45 +04:00
|
|
|
public:
|
|
|
|
static status_t StartWatching(const char* path, uint32 flags,
|
2008-08-12 00:02:59 +04:00
|
|
|
BMessenger target);
|
2007-05-04 20:02:04 +04:00
|
|
|
|
2008-08-04 17:04:45 +04:00
|
|
|
static status_t StopWatching(const char* path,
|
|
|
|
BMessenger target);
|
|
|
|
static status_t StopWatching(BMessenger target);
|
2007-05-04 20:02:04 +04:00
|
|
|
|
2008-08-04 17:04:45 +04:00
|
|
|
private:
|
|
|
|
BPathMonitor();
|
|
|
|
~BPathMonitor();
|
2007-05-08 04:30:59 +04:00
|
|
|
|
2008-08-06 20:56:24 +04:00
|
|
|
static status_t _InitLockerIfNeeded();
|
|
|
|
static status_t _InitLooperIfNeeded();
|
2007-05-04 20:02:04 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
#endif // _PATH_MONITOR_H
|