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

The JSON parser class. More...

#import <DBJsonParser.h>

Inheritance diagram for DBJsonParser:
DBJsonBase <DBJsonParser>

Public Member Functions

(id) - fragmentWithString:
- Public Member Functions inherited from DBJsonBase
(void) - addErrorWithCode:description:
(void) - clearErrorTrace
- Public Member Functions inherited from
(id) - objectWithString:
 Return the object represented by the given string.

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.

Detailed Description

The JSON parser class.

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

  • Null -> NSNull
  • String -> NSMutableString
  • Array -> NSMutableArray
  • Object -> NSMutableDictionary
  • Boolean -> NSNumber (initialised with -initWithBool:)
  • Number -> NSDecimalNumber

Since Objective-C doesn't have a dedicated class for boolean values, these turns into NSNumber instances. These are initialised with the -initWithBool: method, and round-trip back to JSON properly. (They won't silently suddenly become 0 or 1; they'll be represented as 'true' and 'false' again.)

JSON numbers turn into NSDecimalNumber instances, as we can thus avoid any loss of precision. (JSON allows ridiculously large numbers.)

Member Function Documentation

- (id) fragmentWithString: (id)  repr

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