Skip to content

Commit d91d47d

Browse files
committed
Updated Readme to highlight new features in 3.0
1 parent 57f29c4 commit d91d47d

File tree

2 files changed

+53
-34
lines changed

2 files changed

+53
-34
lines changed

Changes.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Changes
66

7-
* Fleshed out [API documentation](http://stig.github.com/json-framework/3.0/)
7+
* Fleshed out the [API documentation][api].
88
* Remove the (admittedly rather cool) JavaScript hack from the Contrib directory, as I don't want to get stuck maintaining JavaScript I don't understand after 3.0.
99
* Moved content of Installation file to Readme.
1010
* [Issue 73][#73]: Project rename, to avoid clashing with Apple's internal JSON.framework
@@ -320,3 +320,4 @@ http://code.google.com/p/json-framework/wiki/ReleaseNotes
320320
[#1]: http://github.com/stig/json-framework/issues/1
321321

322322
[bench]: http://github.com/samsoffes/json-benchmarks
323+
[api]: http://stig.github.com/json-framework/api/3.0

Readme.md

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,60 @@
11
SBJson (aka json-framework)
22
===========================
33

4-
JSON (JavaScript Object Notation) is a light-weight data interchange
5-
format that's easy to read and write for humans and computers alike.
6-
This framework implements a strict JSON parser and generator in
7-
Objective-C.
4+
JSON (JavaScript Object Notation) is a light-weight data interchange format that's easy to read and write for humans and computers alike. This library implements strict JSON parsing and generation in Objective-C.
85

9-
Features
10-
--------
6+
New Features, Changes, and Notable Enhancements in 3.0
7+
------------------------------------------------------
8+
9+
### JSON Stream Support
10+
11+
We now support parsing of documents split into several NSData chunks, like those returned by *NSURLConnection*. This means you can start parsing a JSON document before it is fully downloaded. Depending how you configure the delegates you can chose to have the entire document delivered to your process when it's finished parsing, or delivered bit-by-bit as records on a particular level finishes downloading. For more details see *SBJsonStreamParser* and *SBJsonStreamParserAdapter* in the [API docs][api].
12+
13+
There is also support for *writing to* JSON streams. This means you can write huge JSON documents to disk, or an HTTP destination, without having to hold the entire structure in memory. You can use this to generate a stream of tick data for a stock trading simulation, for example. For more information see *SBJsonStreamWriter* in the [API docs][api].
14+
15+
### Parse and write UTF8-encoded NSData
16+
17+
The internals of *SBJsonParser* and *SBJsonWriter* have been rewritten to be NSData based. It is no longer necessary to convert data returned by NSURLConnection into an NSString before feeding it to the parser. The old NSString-oriented API methods still exists, but now converts their inputs to NSData objects and delegates to the new methods.
18+
19+
### Project renamed to SBJson
20+
21+
The project was renamed to avoid clashing with Apple's private JSON.framework. (And to make it easier to Google for.)
22+
23+
* If you copy the classes into your project then all you need to update is to change the header inclusion from `#import "JSON.h"` to `#import "SBJson.h"`.
24+
* If you link to the library rather than copy the classes you have to change the library you link to. On the Mac `JSON.framework` became `SBJson.framework`. On iOS `libjson.a` became `libsbjson-ios.a`. In both cases you now have to `#import <SBJson/SBJson.h>` in your code.
25+
26+
### API documentation integrated with Xcode
27+
28+
The *InstallDocumentation.sh* script allows you to generate [API documentation][api] from the source and install it into Xcode, so it's always at your fingertips. (This script requires [Doxygen][] to be installed.) After running the script from the top-level directory, open Xcode's documentation window and search for SBJson. (You might have to close and re-open Xcode for the changes to take effect.)
29+
30+
### TweetStream Example Project
31+
32+
An example project showing how to use the new streaming functionality to interact with Twitter's multi-document streams. This also shows how to link to the iOS static lib rather than having to copy the classes into your project.
33+
34+
### DisplayPretty Example Project
35+
36+
A small Mac example project showing how to link to an external JSON framework rather than copying the sources into your project. This is a fully functional (though simplistic) application that takes JSON input from a text field and presents it nicely formatted into another text field.
37+
38+
Features also present in previous versions
39+
------------------------------------------
1140

1241
* BSD license.
13-
* Super-simple high-level API:
14-
* Calling `-JSONValue` on any NSString instance parses the JSON text in that string.
15-
* Calling `-JSONRepresentation` on any NSArray or NSDictionary returns an NSString with the JSON representation of the object.
16-
* Object-oriented API providing a good balance between simplicity and flexibility. Check out:
17-
* `SBJsonParser`
18-
* `SBJsonWriter`
19-
* Streaming JSON support. You can start parsing a JSON document--*and return parsed chunks of it to your program*--before it has finished downloading from the server. Check out:
20-
* `SBJsonStreamParser`
21-
* `SBJsonStreamWriter`
22-
* Works with/without garbage collection.
23-
* Pretty-printing of JSON output.
24-
* Sorted dictionary keys in JSON output.
42+
* Super-simple high-level API: Calling `-JSONValue` on any NSString instance parses the JSON text in that string, and calling `-JSONRepresentation` on any NSArray or NSDictionary returns an NSString with the JSON representation of the object.
43+
* The *SBJsonParser* and *SBJsonWriter* classes provides an object-oriented API providing a good balance between simplicity and flexibility.
2544
* Configurable recursion depth limit for added security.
45+
* Supports (but does not require) garbage collection.
46+
* Sorted dictionary keys in JSON output.
47+
* Pretty-printing of JSON output.
2648

27-
Simple Installation
28-
===================
49+
Installation
50+
============
2951

30-
The simplest way to start using JSON in your application is to simply
31-
copy all the source files (the contents of the `Classes` folder) into
32-
your own Xcode project.
52+
The simplest way to start using JSON in your application is to copy all the source files (the contents of the `Classes` folder) into your own Xcode project.
3353

3454
1. In the Finder, navigate to the `$PATH_TO_SBJSON/Classes` folder and select all the files.
3555
1. Drop-and-drop them into your Xcode project.
3656
1. Tick the **Copy items into destination group's folder** option.
37-
1. Use `#import "SBJson.h"` in your source files. (or simply include the particular classes you wish to use.)
57+
1. Use `#import "SBJson.h"` in your source files.
3858

3959
That should be it. Now create that Twitter client!
4060

@@ -43,25 +63,23 @@ Upgrading
4363

4464
If you're upgrading from a previous version, make sure you're deleting the old SBJson classes first, moving all the files to Trash.
4565

46-
Install API documentation into Xcode
47-
====================================
48-
49-
From the top-level project directory, run the `./InstallDocumentation.sh` program. This compiles the documentation and installs it so it integrates with Xcode. Now open Xcode documentation and search for SBJson. You should see a lot of the classes. (Generating the documentation requires [Doxygen](http://doxygen.org) to be installed.)
5066

67+
Linking rather than copying
68+
---------------------------
5169

52-
Alternative installation instructions
53-
=====================================
54-
55-
Copying the SBJson classes into your project isn't the only way to use this framework. (Though it is the simplest.) I've created a couple of examples that link to this framework rather than copy the sources. Check them out at github:
70+
Copying the SBJson classes into your project isn't the only way to use this framework. (Though it is the simplest.) With Xcode 4's workspaces it has become much simpler to link to dependant projects. The examples in the distribution link to the iOS library and Mac framework, respectively.
5671

5772
* [Linking to JSON Framework on iOS](http://github.com/stig/JsonSampleIPhone)
5873
* [Linking to JSON Framework on the Mac](http://github.com/stig/JsonSampleMac)
5974

6075

6176
Links
62-
-----
77+
=====
6378

6479
* [GitHub project page](http://github.com/stig/json-framework).
6580
* [Example Projects](http://github.com/stig/json-framework/Examples).
6681
* [Online API docs](http://stig.github.com/json-framework/api).
6782
* [Frequently Asked Questions](http://github.com/stig/json-framework/wiki/FrequentlyAskedQuestions)
83+
84+
[api]: http://stig.github.com/json-framework/api/3.0/
85+
[Doxygen]: http://doxygen.org

0 commit comments

Comments
 (0)