Skip to content

Commit

Permalink
More doc updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
schwa committed Sep 3, 2010
1 parent a50fe7a commit ed94707
Showing 1 changed file with 24 additions and 16 deletions.
40 changes: 24 additions & 16 deletions README.markdown
Expand Up @@ -20,9 +20,9 @@ The primary author is Jonathan Wight <http://toxicsoftware.com/> with several ot

## What is JSON?

<http://www.ietf.org/rfc/rfc4627.txt?number=4627>
<http://www.json.org/>
<http://en.wikipedia.org/wiki/JSON>
* <http://www.ietf.org/rfc/rfc4627.txt?number=4627>
* <http://www.json.org/>
* <http://en.wikipedia.org/wiki/JSON>

## License

Expand Down Expand Up @@ -99,28 +99,36 @@ It is especially important to validate your JSON before filing bugs.

## Strings vs Data

TODO
TouchJSON can handle JSON represented either as NSData or as NSString objects. It is recommended that you use NSData if at all possible as the NSString based classes and methods might be deprecated in the future.

## String encoding

TODO
TouchJSON will work UTF8, UTF16 & UTF32 (little and big endian) data. However internally it will convert UTF16 & UTF32 to UTF8 so for performance purposes you should try to use UTF8 if at all possible. (Although see <http://github.com/schwa/TouchJSON/issues/issue/1>)

## Date Formats

TODO
JSON doesn't specify a date encoding format. As such various methods are used. As such TouchJSON doesn't dictate which format you use. ISO 8601 style dates (with as much precession as needed) are recoemmended. See <http://en.wikipedia.org/wiki/ISO_8601>. You can use the CExtensibleJSONDataSerializer class to automatically serialize Cocoa's NSDate objects into ISO-8601 strings (this sample code uses TouchFoundation <http://github.com/schwa/TouchFoundation>)

## Extending TouchJSON
CExtensibleJSONDataSerializer *theSerializer = [[[CExtensibleJSONDataSerializer alloc] init] autorelease];

TODO
JSONConversionConverter theConverter = ^(id inObject) {
return((id)[(NSDate *)inObject ISO8601String]);
};
theSerializer.convertersByName = [NSDictionary dictionaryWithObject:theConverter forKey:@"date"];
JSONConversionTest theTest = ^(id inObject) {
NSString *theName = NULL;
if ([inObject isKindOfClass:[NSDate class]])
{
theName = @"date";
}
return(theName);
};

## Roadmap

TODO
theSerializer.tests = [NSSet setWithObject:theTest];

## Performance

TODO
## Roadmap

## FAQ
* Benchmarking application
* Performance optimisations
* JSONPath

TODO

0 comments on commit ed94707

Please sign in to comment.