SBJsonParser

@interface SBJsonParser : SBJsonBase <SBJsonParser> {
  const char *c;
}

@brief The JSON parser class.

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

@li Null -> NSNull @li String -> NSMutableString @li Array -> NSMutableArray @li Object -> NSMutableDictionary @li Boolean -> NSNumber (initialised with -initWithBool:) @li 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.)

  • c

    Undocumented

    Declaration

    Objective-C

    const char *c
  • Undocumented

    Declaration

    Objective-C

    - (id)fragmentWithString:(id)repr;

    Swift

    func fragment(withString repr: Any!) -> Any!