CDEvents Class Reference
| Inherits from | NSObject |
| Conforms to | NSCopying |
| Declared in | CDEvents.h |
Overview
An Objective-C wrapper for the FSEvents C API.
@note Inpired by SCEvents class of the SCEvents project by Stuart Connolly.
Tasks
-
CDEventsDelegateThe delegate object the
propertyCDEventsobject calls when it recieves an event. -
notificationLatencyThe (approximate) time intervall between notifications sent to the delegate.
property -
sinceEventIdentifierThe event identifier from which events will be supplied to the delegate.
property -
ignoreEventsFromSubDirectoriesWheter events from sub-directories of the watched URLs should be ignored or not.
property -
lastEventThe last event that occured and thas has been delivered to the delegate.
property -
watchedURLsThe URLs that we watch for events.
property -
excludedURLsThe URLs that we should ignore events from.
property -
+ currentEventIdentifierThe current event identifier.
-
– initWithURLs:delegate:Returns an
CDEventsobject initialized with the given URLs to watch. -
– initWithURLs:delegate:onRunLoop:Returns an
CDEventsobject initialized with the given URLs to watch and schedules the watcher on the given run loop. -
– initWithURLs:delegate:onRunLoop:sinceEventIdentifier:notificationLantency:ignoreEventsFromSubDirs:excludeURLs:streamCreationFlags:Returns an
CDEventsobject initialized with the given URLs to watch, URLs to exclude, wheter events from sub-directories are ignored or not and schedules the watcher on the given run loop. -
– flushSynchronouslyFlushes the event stream synchronously.
-
– flushAsynchronouslyFlushes the event stream asynchronously.
-
– streamDescriptionReturns a NSString containing the description of the current event stream.
Properties
CDEventsDelegate
The delegate object the CDEvents object calls when it recieves an event.
@property (assign) id< CDEventsDelegateParameters
- delegate
Delegate for the events object.
nilremoved the delegate.
Return Value
The events’s delegate.
Availability
1.0.0
Discussion
The delegate object the CDEvents object calls when it recieves an event.
Declared In
CDEvents.hexcludedURLs
The URLs that we should ignore events from.
@property (copy) NSArray *excludedURLsReturn Value
An array of NSURL object for the URLs which we want to ignore.
@discussion Events from concerning these URLs and there sub-directories will not be delivered to the delegate.
Availability
1.0.0
Discussion
The URLs that we should ignore events from.
Declared In
CDEvents.hignoreEventsFromSubDirectories
Wheter events from sub-directories of the watched URLs should be ignored or not.
@property (assign) BOOL ignoreEventsFromSubDirectoriesParameters
- flag
Wheter events from sub-directories of the watched URLs shouled be ignored or not.
Return Value
YES if events from sub-directories should be ignored, otherwise NO.
Availability
1.0.0
Discussion
Wheter events from sub-directories of the watched URLs should be ignored or not.
Declared In
CDEvents.hlastEvent
The last event that occured and thas has been delivered to the delegate.
@property (retain) CDEvent *lastEventReturn Value
The last event that occured and thas has been delivered to the delegate.
Availability
1.0.0
Discussion
The last event that occured and thas has been delivered to the delegate.
Declared In
CDEvents.hnotificationLatency
The (approximate) time intervall between notifications sent to the delegate.
@property (readonly) CFTimeInterval notificationLatencyReturn Value
The time intervall between notifications.
Availability
1.0.0
Discussion
The (approximate) time intervall between notifications sent to the delegate.
Declared In
CDEvents.hsinceEventIdentifier
The event identifier from which events will be supplied to the delegate.
@property (readonly) CDEventIdentifier sinceEventIdentifierReturn Value
The event identifier from which events will be supplied to the delegate.
Availability
1.0.0
Discussion
The event identifier from which events will be supplied to the delegate.
Declared In
CDEvents.hInstance Methods
flushAsynchronously
Flushes the event stream asynchronously.
- (void)flushAsynchronouslyAvailability
1.0.0
Discussion
Flushes the event stream asynchronously.
Flushes the event stream asynchronously by sending events that have already occurred but not yet delivered.
See Also
Declared In
CDEvents.hflushSynchronously
Flushes the event stream synchronously.
- (void)flushSynchronouslyAvailability
1.0.0
Discussion
Flushes the event stream synchronously.
Flushes the event stream synchronously by sending events that have already occurred but not yet delivered.
See Also
Declared In
CDEvents.hinitWithURLs:delegate:
Returns an CDEvents object initialized with the given URLs to watch.
- (id)initWithURLs:(NSArray *)URLs delegate:(id<CDEventsDelegate>)delegateParameters
- URLs
An array of URLs we want to watch.
- delegate
The delegate object the
CDEventsobject calls when it recieves an event.
Return Value
An CDEvents object initialized with the given URLs to watch.
@throws NSInvalidArgumentException if URLs is empty or points to nil.
@throws NSInvalidArgumentException if delegateis nil.
@throws CDEventsEventStreamCreationFailureException if we failed to create a event stream.
Availability
1.0.0
Discussion
Returns an CDEvents object initialized with the given URLs to watch.
See Also
Declared In
CDEvents.hinitWithURLs:delegate:onRunLoop:
Returns an CDEvents object initialized with the given URLs to watch and schedules the watcher on the given run loop.
- (id)initWithURLs:(NSArray *)URLs delegate:(id<CDEventsDelegate>)delegate onRunLoop:(NSRunLoop *)runLoopParameters
- URLs
An array of URLs we want to watch.
- delegate
The delegate object the
CDEventsobject calls when it recieves an event.
- The
run loop which the which the watcher should be schedueled on.
Return Value
An CDEvents object initialized with the given URLs to watch.
@throws NSInvalidArgumentException if URLs is empty or points to nil.
@throws NSInvalidArgumentException if delegateis nil.
@throws CDEventsEventStreamCreationFailureException if we failed to create a event stream.
Availability
1.0.0
Discussion
Returns an CDEvents object initialized with the given URLs to watch and schedules the watcher on the given run loop.
Declared In
CDEvents.hinitWithURLs:delegate:onRunLoop:sinceEventIdentifier:notificationLantency:ignoreEventsFromSubDirs:excludeURLs:streamCreationFlags:
Returns an CDEvents object initialized with the given URLs to watch, URLs to exclude, wheter events from sub-directories are ignored or not and schedules the watcher on the given run loop.
- (id)initWithURLs:(NSArray *)URLs delegate:(id<CDEventsDelegate>)delegate onRunLoop:(NSRunLoop *)runLoop sinceEventIdentifier:(CDEventIdentifier)sinceEventIdentifier notificationLantency:(CFTimeInterval)notificationLatency ignoreEventsFromSubDirs:(BOOL)ignoreEventsFromSubDirs excludeURLs:(NSArray *)exludeURLs streamCreationFlags:(CDEventsEventStreamCreationFlags)streamCreationFlagsParameters
- URLs
An array of URLs we want to watch.
- delegate
The delegate object the
CDEventsobject calls when it recieves an event.
- runLoop
The run loop which the which the watcher should be schedueled on.
- sinceEventIdentifier
Events that have happened after the given event identifier will be supplied.
- notificationLatency
The (approximate) time intervall between notifications sent to the delegate.
- ignoreEventsFromSubDirs
Wheter events from sub-directories of the watched URLs should be ignored or not.
- exludeURLs
An array of URLs that we should ignore events from. Pass
nilif none should be excluded.
- streamCreationFlags
The event stream creation flags.
Return Value
An CDEvents object initialized with the given URLs to watch, URLs to exclude, wheter events from sub-directories are ignored or not and run on the given run loop.
@throws NSInvalidArgumentException if the parameter URLs is empty or points to nil.
@throws NSInvalidArgumentException if delegateis nil.
@throws CDEventsEventStreamCreationFailureException if we failed to create a event stream.
Availability
1.0.0
Discussion
Returns an CDEvents object initialized with the given URLs to watch, URLs to exclude, wheter events from sub-directories are ignored or not and schedules the watcher on the given run loop.
See Also
FSEventStreamCreateFlags
@discussion To ask for events “since now” pass the return value of + currentEventIdentifier as the parameter @property sinceEventIdentifier. CDEventStreamCreationFailureException should be extremely rare.
Declared In
CDEvents.hstreamDescription
Returns a NSString containing the description of the current event stream.
- (NSString *)streamDescriptionReturn Value
A NSString containing the description of the current event stream.
Availability
1.0.0
Discussion
Returns a NSString containing the description of the current event stream.
Declared In
CDEvents.h