Commits on Mar 25, 2011
  1. Update and include an example of the new unsupported cla…

    …ss formatting feature.
    committed Mar 25, 2011
  2. Two major changes and one minor change in this commit.

    Minor change: When JKSerializeOptionPretty is enabled, JSONKit now sorts the keys.
    Major changes:
    The way that JSONKit implements the collection classes was modified.  Specifically, JSONKit now follows the same strategy that the Cocoa collection classes use, which is to have a single subclass of the mutable collection class.  This concrete subclass has an ivar bit that determines whether or not that instance is mutable, and when an immutable instance receives a mutating message, it throws an exception.
    The second change is a new feature.  Normally, JSONKit can only serialize NSNull, NSNumber, NSString, NSArray, and NSDictioonary like objects.  It is now possible to serialize an object of any class via either a delegate or a ^block.
    The delegate or ^block must return an object that can be serialized by JSONKit, however, otherwise JSONKit will fail to serialize the object.  In other words, JSONKit tries to serialize an unsupported class of the object just once, and if the delegate or ^block returns another unsupported class, the second attempt to serialize will fail.  In practice, this is not a problem at all, but it does prevent endless recursive attempts to serialize an unsupported class.
    This makes it trivial to serialize objects like NSDate or NSData.  A NSDate object can be formatted using a NSDateFormatter to return a ISO-8601 'YYYY-MM-DDTHH:MM:SS.sssZ' type object, for example.  Or a NSData object could be Base64 encoded.
    This greatly simplifies things when you have a complex, nested objects with objects that do not belong to the classes that JSONKit can serialize.
    It should be noted that the same caching that JSONKit does for the supported class types also applies to the objects of an unsupported class- if the same object is serialized more than once and the object is still in the serialization cache, JSONKit will copy the previous serialization result instead of invoking the delegate or ^block again.  Therefore, you should not expect or depend on your delegate or block being called each time the same object needs to be serialized AND the delegate or block MUST return a "formatted object" that is STRICTLY invariant (that is to say the same object must always return the exact same formatted output).
    committed Mar 25, 2011
Commits on Mar 23, 2011
  1. This commit includes the "Serialize a single NSString" feature/pull r…

    …equest from issue #4 and issue #11.  Also replaces jk_encode() function with the JKSerializer class.  This is a forward looking change as placing the state in to an autoreleased object that does serializing means that we can always make sure that any resources we might have allocated will get released, no matter what.  This could be a problem, for example, if something throws an exception while we are serializing.
    committed Mar 23, 2011
Commits on Mar 22, 2011
  1. Fix a couple of potential memory leaks in extremely unlikely and rare…

    … circumstances. Modify the primary parsing initial token matcher to use a if/else if/else if structure instead of switch()/case and organize the if statements to occur in the order they are statistically likely to appear in JSON for a performance win. Also make a minor tweak.
    committed Mar 22, 2011
  2. Minor tidies.

    committed Mar 22, 2011
  3. Misc documentation updates.

    committed Mar 22, 2011
Commits on Mar 21, 2011
  1. Catch a few additional NSInvalidArgument exception cases that the Cco…

    …ca collection classes catch.
    committed Mar 21, 2011
  2. Minor change to the method swizzling functions. It doesn't make a dif…

    …ference in the way we use it, but this corrects it so that it is more 'correct'.
    committed Mar 21, 2011
  3. Changed the way jk_encode_write1 is handled so that the optimizer is …

    …able to do a better job. Also modified jk_encode_printf to fix a potential bug wrt/ va_end, and used a va_copy() to make a copy of the varArgs. This is needed if the first vsnprintf overruns the buffer and we need to call it again, the first call may leave the passed varArgs in a state that is unusable by the next call- hence we make a va_copy and use the copy on the second call. Also did some tidies on various jk_encode_write|print functions.
    committed Mar 21, 2011
Commits on Mar 17, 2011
  1. Update with additional information and bring it up to date …

    …with the 1.4 changes.
    committed Mar 17, 2011
  2. Additional assertion checks wrt/ issue #9. Issue #9 looks like it cou…

    …ld be a stack smash? The assertion checks make sure we're only copying legal values and not writing past a buffer by accident.
    committed Mar 17, 2011
Commits on Mar 11, 2011
  1. Fixes a bug. See issue #8.

    committed Mar 11, 2011
Commits on Mar 8, 2011
Commits on Mar 6, 2011
  1. Significantly improve writing/serializing performance by caching the …

    …offset in the buffer for the last conversion for an object.
    committed Mar 6, 2011
Commits on Mar 4, 2011
  1. JSONKit v1.4 can now return mutable collection objects. See the CHANG…

    … for more info.
    committed Mar 4, 2011
Commits on Mar 3, 2011
  1. Some changes to the way cache aging is handled that improves L1 cache…

    … locality. Changes some of the convience functions so that they leave as little autorelease pending allocations hanging around as possible to minimize our memory footprint.
    committed Mar 3, 2011
Commits on Feb 28, 2011
  1. Initial push of JSONKit v1.4. May not be the final v1.4 commit. See C…

    … for info. The biggest news is JSONKit is anywhere from 30% to 60% faster than JSONKit v1.3 for reading / parsing JSON!
    committed Feb 28, 2011
Commits on Feb 21, 2011
  1. Fixed a bug wrt/ not correctly handling < 0x20 characters in strings …

    …when the slow string parsing path was active.
    committed Feb 21, 2011
Commits on Feb 19, 2011
  1. Fixes a bug in parsing unicode strings with high surrogates. Changed …

    …some illegal unicode escapes such that JKParseOptionLooseUnicode was honored. Modified the way floating point values are serialized: previously, the printf format conversion '%.16g' was used, changed to '%.17g' which should theoretically allow for up to a full 'float' (aka single precision) of precision when converting to decimal representation.
    committed Feb 19, 2011
Commits on Feb 5, 2011
Commits on Jan 16, 2011
  1. Changed the hash function for numbers to the generic standard hash fu…

    …nction. The (now removed) hash function for numbers was originally put in place during the initial development of JSONKit in an attempt to avoid hash collisions and table probe / accelerated cache ageing due to similar hashes. This problem was fixed using a different technique, but the old hash function remained for some reason. Although it depends heavily on the JSON being parsed, this change can result in a 2-6% increase in parsing speed.
    committed Jan 16, 2011
Commits on Jan 11, 2011
  1. Add backticks around NULL.

    committed Jan 11, 2011
Commits on Jan 9, 2011
  1. Fixed a serious crashing bug. Fixed a memory leak. Fixed an off by on…

    …e error. Updated the file. Added
    committed Jan 9, 2011
Commits on Aug 10, 2010
  1. Fixed a memory leak when the JSON being parsed contained associative …

    …arrays where the same key appeared more than once. Also hacked around the CFNumber limitation where CFNumbers only have a signed type for numbers and do not have an explicity unsigned type. Switched the README to
    committed Aug 10, 2010
Commits on Jul 30, 2010
  1. Improve the performance of NSNumber serialization, add a few more con…

    …venience methods, plus a few other bits and pieces.
    committed Jul 30, 2010
Commits on Jul 28, 2010
  1. Initial check in.

    committed Jul 28, 2010
Commits on Jul 27, 2010
  1. first commit

    John Engelhart committed Jul 27, 2010