Yini  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
DBJsonWriter Class Reference

The JSON writer class. More...

#import <DBJsonWriter.h>

Inheritance diagram for DBJsonWriter:
DBJsonBase <DBJsonWriter>

Public Member Functions

(NSString *) - stringWithFragment:
- Public Member Functions inherited from DBJsonBase
(void) - addErrorWithCode:description:
(void) - clearErrorTrace
- Public Member Functions inherited from
(NSString *) - stringWithObject:
 Return JSON representation (or fragment) for the given object.

Additional Inherited Members

- Protected Attributes inherited from DBJsonBase
NSMutableArray * errorTrace
NSUInteger depth
- Properties inherited from DBJsonBase
NSUInteger maxDepth
 The maximum recursing depth.
NSArray * errorTrace
 Return an error trace, or nil if there was no errors.
- Properties inherited from
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

The JSON writer class.

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

  • NSNull -> Null
  • NSString -> String
  • NSArray -> Array
  • NSDictionary -> Object
  • NSNumber (-initWithBool:) -> Boolean
  • NSNumber -> Number

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*) stringWithFragment: (id)  value

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