< SBJsonWriter > Protocol Reference

Options for the writer class. More...

Inheritance diagram for < SBJsonWriter >:

SBJSON SBJsonWriter

List of all members.

Public Member Functions

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

Properties

BOOL humanReadable
 Whether we are generating human-readable (multiline) JSON.
BOOL sortKeys
 Whether or not to sort the dictionary keys in the output.


Detailed Description

This exists so the SBJSON facade can implement the options in the writer without having to re-declare them.

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

- (BOOL) humanReadable [read, write, assign]

Set whether or not to generate human-readable JSON. The default is NO, which produces JSON without any whitespace. (Except inside strings.) If set to YES, generates human-readable JSON with linebreaks after each array value and dictionary key/value pair, indented two spaces per nesting level.

- (BOOL) sortKeys [read, write, assign]

If this is set to YES, the dictionary keys in the JSON output will be in sorted order. (This is useful if you need to compare two structures, for example.) The default is NO.


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

Generated on Sun Mar 7 15:41:17 2010 by  doxygen 1.5.9