* Use new header layout in PathMonitor.h
* Honor 80 char/line limit in PathMonitor.cpp git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26788 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -18,17 +18,19 @@
|
|||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
class BPathMonitor {
|
class BPathMonitor {
|
||||||
public:
|
public:
|
||||||
static status_t StartWatching(const char* path, uint32 flags, BMessenger target);
|
static status_t StartWatching(const char* path, uint32 flags,
|
||||||
|
BMessenger target);
|
||||||
|
|
||||||
static status_t StopWatching(const char* path, BMessenger target);
|
static status_t StopWatching(const char* path,
|
||||||
static status_t StopWatching(BMessenger target);
|
BMessenger target);
|
||||||
|
static status_t StopWatching(BMessenger target);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BPathMonitor();
|
BPathMonitor();
|
||||||
~BPathMonitor();
|
~BPathMonitor();
|
||||||
|
|
||||||
static status_t _InitIfNeeded();
|
static status_t _InitIfNeeded();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace BPrivate
|
} // namespace BPrivate
|
||||||
|
|||||||
@@ -189,7 +189,8 @@ PathHandler::PathHandler(const char* path, uint32 flags, BMessenger target)
|
|||||||
|
|
||||||
fStatus = _AddDirectory(nodeRef);
|
fStatus = _AddDirectory(nodeRef);
|
||||||
|
|
||||||
// TODO: work-around for existing files (should not watch the directory in this case)
|
// TODO: work-around for existing files (should not watch the directory in
|
||||||
|
// this case)
|
||||||
BEntry entry(path);
|
BEntry entry(path);
|
||||||
if (entry.Exists() && !entry.IsDirectory())
|
if (entry.Exists() && !entry.IsDirectory())
|
||||||
_AddFile(entry);
|
_AddFile(entry);
|
||||||
@@ -223,7 +224,8 @@ PathHandler::Dump()
|
|||||||
printf("WATCHING DIRECTORIES:\n");
|
printf("WATCHING DIRECTORIES:\n");
|
||||||
DirectorySet::iterator i = fDirectories.begin();
|
DirectorySet::iterator i = fDirectories.begin();
|
||||||
for (; i != fDirectories.end(); i++) {
|
for (; i != fDirectories.end(); i++) {
|
||||||
printf(" %ld:%Ld (%s)\n", i->node.device, i->node.node, i->contained ? "contained" : "-");
|
printf(" %ld:%Ld (%s)\n", i->node.device, i->node.node, i->contained
|
||||||
|
? "contained" : "-");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("WATCHING FILES:\n");
|
printf("WATCHING FILES:\n");
|
||||||
@@ -539,7 +541,8 @@ PathHandler::_IsContained(BEntry& entry) const
|
|||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
PathHandler::_HasDirectory(const node_ref& nodeRef, bool* _contained /* = NULL */) const
|
PathHandler::_HasDirectory(const node_ref& nodeRef,
|
||||||
|
bool* _contained /* = NULL */) const
|
||||||
{
|
{
|
||||||
watched_directory directory;
|
watched_directory directory;
|
||||||
directory.node = nodeRef;
|
directory.node = nodeRef;
|
||||||
|
|||||||
Reference in New Issue
Block a user