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

Properties

CDEventsDelegate

The delegate object the CDEvents object calls when it recieves an event.

@property (assign) id< CDEventsDelegate

Parameters

delegate

Delegate for the events object. nil removed 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.h

excludedURLs

The URLs that we should ignore events from.

@property (copy) NSArray *excludedURLs

Return 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.h

ignoreEventsFromSubDirectories

Wheter events from sub-directories of the watched URLs should be ignored or not.

@property (assign) BOOL ignoreEventsFromSubDirectories

Parameters

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.h

lastEvent

The last event that occured and thas has been delivered to the delegate.

@property (retain) CDEvent *lastEvent

Return 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.h

notificationLatency

The (approximate) time intervall between notifications sent to the delegate.

@property (readonly) CFTimeInterval notificationLatency

Return Value

The time intervall between notifications.

Availability

1.0.0

Discussion

The (approximate) time intervall between notifications sent to the delegate.

Declared In

CDEvents.h

sinceEventIdentifier

The event identifier from which events will be supplied to the delegate.

@property (readonly) CDEventIdentifier sinceEventIdentifier

Return 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.h

watchedURLs

The URLs that we watch for events.

@property (readonly) NSArray *watchedURLs

Return Value

An array of NSURL object for the URLs which we watch for events.

Availability

1.0.0

Discussion

The URLs that we watch for events.

Declared In

CDEvents.h

Class Methods

currentEventIdentifier

The current event identifier.

+ (CDEventIdentifier)currentEventIdentifier

Return Value

The current event identifier.

Availability

1.0.0

Discussion

The current event identifier.

Declared In

CDEvents.h

lastEventIdentifierForURL:time:

The last event identifier for the given device that was returned before the given date and time

+ (CDEventIdentifier)lastEventIdentifierForURL:(NSURL *)URL time:(NSDate *)time

Parameters

URL

The URL of the item the event identifier is sought for, used to find the device.

time

The date and time.

Return Value

The last event identifier for the given URL that was returned before the given time

Availability

1.1.0

Discussion

The last event identifier for the given device that was returned before the given date and time

Declared In

CDEvents.h

Instance Methods

flushAsynchronously

Flushes the event stream asynchronously.

- (void)flushAsynchronously

Availability

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.

Declared In

CDEvents.h

flushSynchronously

Flushes the event stream synchronously.

- (void)flushSynchronously

Availability

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.

Declared In

CDEvents.h

initWithURLs:delegate:

Returns an CDEvents object initialized with the given URLs to watch.

- (id)initWithURLs:(NSArray *)URLs delegate:(id<CDEventsDelegate>)delegate

Parameters

URLs

An array of URLs we want to watch.

delegate

The delegate object the CDEvents object 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.

Declared In

CDEvents.h

initWithURLs: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 *)runLoop

Parameters

URLs

An array of URLs we want to watch.

delegate

The delegate object the CDEvents object 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.h

initWithURLs: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:(NSUInteger)streamCreationFlags

Parameters

URLs

An array of URLs we want to watch.

delegate

The delegate object the CDEvents object 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 nil if 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

Declared In

CDEvents.h

streamDescription

Returns a NSString containing the description of the current event stream.

- (NSString *)streamDescription

Return 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