Yini
1.0
|
The JSON parser class. More...
#import <DBJsonParser.h>
Public Member Functions | |
(id) | - fragmentWithString: |
![]() | |
(void) | - addErrorWithCode:description: |
(void) | - clearErrorTrace |
![]() | |
(id) | - objectWithString: |
Return the object represented by the given string. |
Additional Inherited Members | |
![]() | |
NSMutableArray * | errorTrace |
NSUInteger | depth |
![]() | |
NSUInteger | maxDepth |
The maximum recursing depth. | |
NSArray * | errorTrace |
Return an error trace, or nil if there was no errors. |
The JSON parser class.
JSON is mapped to Objective-C types in the following way:
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.)
- (id) fragmentWithString: | (id) | repr |