List of all members.
Detailed Description
JSON document interface.
NSData *data = [NSData dataWithContentsOfFile:@"example.json"];
NSError *error = nil;
YAJLDocument *document = [[YAJLDocument alloc] initWithData:data parserOptions:YAJLParserOptionsNone error:&error];
NSLog(@"Root: %@", document.root);
[document release];
Example for streaming:
YAJLDocument *document = [[YAJLDocument alloc] init];
document.delegate = self;
NSError *error = nil;
[document parse:chunk1 error:error];
[document parse:chunk2 error:error];
NSLog(@"Root: %@", document.root);
[document release];
- (void)document:(YAJLDocument *)document didAddDictionary:(NSDictionary *)dict { }
- (void)document:(YAJLDocument *)document didAddArray:(NSArray *)array { }
- (void)document:(YAJLDocument *)document didAddObject:(id)object toArray:(NSArray *)array { }
- (void)document:(YAJLDocument *)document didSetObject:(id)object forKey:(id)key inDictionary:(NSDictionary *)dict { }
Member Function Documentation
- (id) initWithData: |
|
(NSData *) |
data |
parserOptions: |
|
(YAJLParserOptions) |
parserOptions |
capacity: |
|
(NSInteger) |
capacity |
error: |
|
(NSError **) |
error | |
|
|
| | |
Create document from data.
- Parameters:
-
| data | Data to parse |
| parserOptions | Parse options
- YAJLParserOptionsNone: No options
- YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both / / and //)
- YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
- YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
|
| capacity | Initial capacity for NSArray and NSDictionary objects (Defaults to 20) |
| error | Error to set on failure |
- (id) initWithData: |
|
(NSData *) |
data |
parserOptions: |
|
(YAJLParserOptions) |
parserOptions |
error: |
|
(NSError **) |
error | |
|
|
| | |
Delegate.
Create document from data.
- Parameters:
-
| data | Data to parse |
| parserOptions | Parse options
- YAJLParserOptionsNone: No options
- YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both / / and //)
- YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
- YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
|
| error | Error to set on failure |
- (id) initWithParserOptions: |
|
(YAJLParserOptions) |
parserOptions |
|
|
Create empty document with parser options.
- Parameters:
-
| parserOptions | Parse options
- YAJLParserOptionsNone: No options
- YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both / / and //)
- YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
- YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
|
- (id) initWithParserOptions: |
|
(YAJLParserOptions) |
parserOptions |
capacity: |
|
(NSInteger) |
capacity | |
|
|
| | |
Create empty document with parser options.
- Parameters:
-
| parserOptions | Parse options
- YAJLParserOptionsNone: No options
- YAJLParserOptionsAllowComments: Javascript style comments will be allowed in the input (both / / and //)
- YAJLParserOptionsCheckUTF8: Invalid UTF8 strings will cause a parse error
- YAJLParserOptionsStrictPrecision: If YES will force strict precision and return integer overflow error
|
| capacity | Initial capacity for NSArray and NSDictionary objects (Defaults to 20) |
- (YAJLParserStatus) parse: |
|
(NSData *) |
data |
error: |
|
(NSError **) |
error | |
|
|
| | |
Parse data.
- Parameters:
-
| data | Data to parse |
| error | Out error to set on failure |
- Returns:
- Parser status
- YAJLParserStatusNone: No status
- YAJLParserStatusOK: Parsed OK
- YAJLParserStatusInsufficientData: There was insufficient data
- YAJLParserStatusError: Parser errored
The documentation for this class was generated from the following files: