An Objective-C wrapper for Mac OS X’s FSEvents C API.
Revisión | 966cfd188c271bd4163ef46b95a966659199fa4a (tree) |
---|---|
Tiempo | 2010-04-04 03:01:41 |
Autor | Aron Cedercrantz <aron@cede...> |
Commiter | Aron Cedercrantz |
Added createEventStream method.
@@ -161,6 +161,25 @@ ignoreEventsFromSubDirs:(BOOL)ignoreEventsFromSubDirs | ||
161 | 161 | |
162 | 162 | |
163 | 163 | #pragma mark Private API: |
164 | +- (void)createEventStream | |
165 | +{ | |
166 | + FSEventStreamContext callbackCtx; | |
167 | + | |
168 | + callbackCtx.version = 0; | |
169 | + callbackCtx.info = (void *)self; | |
170 | + callbackCtx.retain = NULL; | |
171 | + callbackCtx.release = NULL; | |
172 | + callbackCtx.copyDescription = NULL; | |
173 | + | |
174 | + _eventStream = FSEventStreamCreate(kCFAllocatorDefault, | |
175 | + &CDEventsCallback, | |
176 | + &callbackCtx, | |
177 | + (CFArrayRef)[self watchedURLs], | |
178 | + (FSEventStreamEventId)[self sinceEventIdentifier], | |
179 | + [self notificationLatency], | |
180 | + kCDEventsEventStreamFlags); | |
181 | +} | |
182 | + | |
164 | 183 | - (void)disposeEventStream |
165 | 184 | { |
166 | 185 | if (!(_eventStream)) { |