Partial implementation, gaps and impossibilities noted internally as TODO comments.
* CPProgress.j: Introduce CPProgress, modelled on NSProgress.
- Count units of work, with fraction completed, finished and indeterminate states.
- Compose progress trees through explicit children and the current progress object.
- Cancel, pause and resume, with handlers, propagating to children.
- Announce unit-count changes through key-value observing across the tree.
* CPError.j: Add CPUserCancelledError.
* CPItemProvider.j:
- Return a CPProgress from each load, counting bytes read for files and aborting the read on cancellation.
- Pass file contents to CPData as a binary string rather than a byte array.
- Implement -canLoadObjectOfClass: and -loadObjectOfClass:completionHandler:.
- Add the CPString (CPItemProvider) reading category.
* CPString+Encoding.j: Decode data held as a binary string through a Uint8Array, without building a byte array.
* Foundation.j: Import CPProgress.j.
* CPProgressTest.j: Add unit tests covering counts, children, the current progress object, cancellation, pausing, observation and user information.
* CPItemProviderTest.j: Add unit tests covering read progress, cancellation, completion and string loading.
As we have a tool-free bridges between many classes and JavaScript types by setting the isa property on the type, for example CPArray and Array. Using the for...in enumeration the isa property will be included in the loop if the property is enumerable (this is the default behavior). This commit set the property as not enumerable.
Also added test case for check that the isa property on classes are not enumerable using a for...in loop.