brentdax/ArchDirectoryObserver — pull request #1 by mralexgray (2014-06-08 15:47:14+00:00)
Title: A little bit of everything.

I apologize for the somewhat disjointed nature of this pull request, but at first was just fiddling around with it, thinking that all the changes I was making would be just for my benefit. However, I got far enough along that I think some/all of it could be of benefit to the project on the whole. Granted, a lot of it is formatting changes, but hopefully you'll agree that they make the code more readable, foldable, clear and concise.

Of note is a simple implementation of the TokenArchive abstract class. Works nicely to aid in testing / using this feature (which seems unique to this wrapper of `FSEvents`).

I understand if you are unwilling or unable to merge this completely right now, but I wanted to at least get the conversation started because I need a little help in making the second feature of the `TokenHelper` class work correctly. Please understand that this is my first time working with the `FSEvents` API and the accompanying naivety I may be exhibiting in the process.

The feature to get a token from a URL works well..
`- (void) getNextToken:(NextToken)nT;` and `- (void) getNextTokenWithOptions:(ArchDirectoryObserverOptions)optns nextToken:(NextToken)nT;`

where I am a bit confused... is when I then want to find out if a change has happened SINCE that token.. how can I know when the "historical" updates have ended? I tried setting a property on the observer once the `kFSEventStreamEventFlagHistoryDone` `FSEventStreamEventFlags` gets called, but the waters around there are murky, and I feel like I'm missing it.

Take a look at what Ive done.. And again, I'm sorry that there's just so much of it - and let me know if you can lend any insight to the matter.. or If I need to explain myself better.

PS heres a screenshot of the revised project structure..

![140608-0001](https://cloud.githubusercontent.com/assets/262517/3211607/14687056-ef24-11e3-84da-32bf953780de.png)