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

Managing the Delegate

  •   delegate

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

    property

Getting Event Block

Getting Event Watcher Properties

Configuring the Event watcher

Current Event Identifier

Creating CDEvents Objects With a Delegate

Creating CDEvents Objects With a Block

Flushing Events

Events Description

Properties

delegate

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

@property (unsafe_unretained) id<CDEventsDelegate> delegate

Parameters

delegate

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

See Also

Declared In

CDEvents.h

eventBlock

The event block.

@property (readonly) CDEventsEventBlock eventBlock

Return Value

The CDEventsEventBlock block which is executed when an event occurs.

Availability

head

Discussion

The event block.

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 has been delivered to the delegate.

@property (strong, readonly) CDEvent *lastEvent

Return Value

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

Availability

1.0.0

Discussion

The last event that occured and 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 (copy, 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

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:block:

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

- (id)initWithURLs:(NSArray *)URLs block:(CDEventsEventBlock)block

Parameters

URLs

An array of URLs we want to watch.

block

The block which the CDEvents object executes 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

head

Discussion

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

See Also

Declared In

CDEvents.h

initWithURLs:block: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 block:(CDEventsEventBlock)block onRunLoop:(NSRunLoop *)runLoop

Parameters

URLs

An array of URLs we want to watch.

block

The block which the CDEvents object executes when it recieves an event.

runLoop

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

head

Discussion

Returns an CDEvents object initialized with the given URLs to watch and schedules the watcher on the given run loop.

See Also

Declared In

CDEvents.h

initWithURLs:block: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 block:(CDEventsEventBlock)block onRunLoop:(NSRunLoop *)runLoop sinceEventIdentifier:(CDEventIdentifier)sinceEventIdentifier notificationLantency:(CFTimeInterval)notificationLatency ignoreEventsFromSubDirs:(BOOL)ignoreEventsFromSubDirs excludeURLs:(NSArray *)exludeURLs streamCreationFlags:(CDEventsEventStreamCreationFlags)streamCreationFlags

Parameters

URLs

An array of URLs (NSURL) we want to watch.

block

The block which the CDEvents object executes 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

head

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

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.

See Also

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.

runLoop

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.

See Also

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

Parameters

URLs

An array of URLs (NSURL) 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