diff -r 000000000000 -r 629c7605ab2a MYDirectoryWatcher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MYDirectoryWatcher.h Wed Apr 08 16:31:19 2009 -0700 @@ -0,0 +1,57 @@ +// +// MYDirectoryWatcher.h +// Murky +// +// Copyright 2008 Jens Alfke. All rights reserved. +// + +#import + + +/* A wrapper for FSEvents, which notifies its delegate when filesystem changes occur. */ +@interface MYDirectoryWatcher : NSObject +{ + NSString *_path; + id _target; + SEL _action; + UInt64 _lastEventID; + BOOL _historyDone; + CFTimeInterval _latency; + FSEventStreamRef _stream; +} + +- (id) initWithDirectory: (NSString*)path target: (id)target action: (SEL)action; + +@property (readonly,nonatomic) NSString* path; + +@property UInt64 lastEventID; +@property CFTimeInterval latency; + +- (BOOL) start; +- (void) pause; +- (void) stop; +- (void) stopTemporarily; // stop, but re-start on next runloop cycle + +@end + + + +@interface MYDirectoryEvent : NSObject +{ + MYDirectoryWatcher *watcher; + NSString *path; + UInt64 eventID; + UInt32 flags; +} + +@property (readonly, nonatomic) MYDirectoryWatcher *watcher; +@property (readonly, nonatomic) NSString *path, *relativePath; +@property (readonly, nonatomic) UInt64 eventID; +@property (readonly, nonatomic) UInt32 flags; + +@property (readonly, nonatomic) BOOL mustScanSubdirectories; +@property (readonly, nonatomic) BOOL eventsWereDropped; +@property (readonly, nonatomic) BOOL isHistorical; +@property (readonly, nonatomic) BOOL rootChanged; + +@end