SBJsonWriter Class Reference

The JSON writer class. More...

Inheritance diagram for SBJsonWriter:

SBJsonBase < SBJsonWriter >

List of all members.

Public Member Functions

(NSString *) - stringWithObject:
 Return JSON representation (or fragment) for the given object.

Properties

NSArray * errorTrace
 Return an error trace, or nil if there was no errors.
NSUInteger maxDepth
 The maximum recursing depth.
NSUInteger maxDepth
 The maximum recursing depth.


Detailed Description

Objective-C types are mapped to JSON types in the following way:

In JSON the keys of an object must be strings. NSDictionary keys need not be, but attempting to convert an NSDictionary with non-string keys into JSON will throw an exception.

NSNumber instances created with the +initWithBool: method are converted into the JSON boolean "true" and "false" values, and vice versa. Any other NSNumber instances are converted to a JSON number the way you would expect.


Member Function Documentation

- (NSString*) stringWithObject: (id)  value  

Returns a string containing JSON representation of the passed in value, or nil on error. If nil is returned and error is not NULL, *error can be interrogated to find the cause of the error.

Parameters:
value any instance that can be represented as a JSON fragment


Property Documentation

- (NSArray*) errorTrace [read, copy, inherited]

Note that this method returns the trace of the last method that failed. You need to check the return value of the call you're making to figure out if the call actually failed, before you know call this method.

- (NSUInteger) maxDepth [read, write, assign, inherited]

Defaults to 512. If the input is nested deeper than this the input will be deemed to be malicious and the parser returns nil, signalling an error. ("Nested too deep".) You can turn off this security feature by setting the maxDepth value to 0.

- (NSUInteger) maxDepth [read, write, assign, inherited]

Defaults to 512. If the input is nested deeper than this the input will be deemed to be malicious and the parser returns nil, signalling an error. ("Nested too deep".) You can turn off this security feature by setting the maxDepth value to 0.


The documentation for this class was generated from the following file:

Generated on Mon May 25 10:11:47 2009 by  doxygen 1.5.9