forked from iMediaSandboxing/iMedia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UKFNSubscribeFileWatcher.h
48 lines (36 loc) · 1.79 KB
/
UKFNSubscribeFileWatcher.h
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
41
42
43
44
45
46
47
48
/* =============================================================================
FILE: UKFNSubscribeFileWatcher.m
PROJECT: Filie
COPYRIGHT: (c) 2005 M. Uli Kusterer, all rights reserved.
AUTHORS: M. Uli Kusterer - UK
LICENSES: MIT License
REVISIONS:
2008-11-07 UK Made more similar to UKKQueue.
2006-03-13 UK Commented, added singleton.
2005-03-02 UK Created.
========================================================================== */
// -----------------------------------------------------------------------------
// Headers:
// -----------------------------------------------------------------------------
#import <Cocoa/Cocoa.h>
#import "UKFileWatcher.h"
#import <Carbon/Carbon.h>
/*
NOTE: FNSubscribe has a built-in delay: If your application is in the
background while the changes happen, all notifications will be queued up
and sent to your app at once the moment it is brought to front again. If
your app really needs to do live updates in the background, use a KQueue
instead.
*/
// -----------------------------------------------------------------------------
// Class declaration:
// -----------------------------------------------------------------------------
@interface UKFNSubscribeFileWatcher : NSObject <UKFileWatcher>
{
id delegate; // Delegate must respond to UKFileWatcherDelegate protocol.
NSMutableArray* subscribedPaths; // List of pathnames we've subscribed to. This maps to subscribedObjects, like a dictionary that can have duplicate keys.
NSMutableArray* subscribedObjects; // List of FNSubscription pointers in NSValues. This maps to subscribedPaths, like a dictionary that can have duplicate keys.
}
+(id) sharedFileWatcher;
// UKFileWatcher defines the methods: addPath: removePath:, removeAllPaths and delegate accessors.
@end