forked from mattgemmell/MGTwitterEngine
-
Notifications
You must be signed in to change notification settings - Fork 1
/
MGTwitterYAJLParser.h
60 lines (50 loc) · 1.63 KB
/
MGTwitterYAJLParser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// MGTwitterYAJLParser.h
// MGTwitterEngine
//
// Created by Matt Gemmell on 18/02/2008.
// Copyright 2008 Instinctive Code.
//
#import "MGTwitterEngineGlobalHeader.h"
//#include <yajl/yajl_parse.h>
#import "yajl_parse.h"
#import "MGTwitterParserDelegate.h"
#import "MGTwitterEngineDelegate.h"
@interface MGTwitterYAJLParser : NSObject {
__weak NSObject <MGTwitterParserDelegate> *delegate; // weak ref
NSString *identifier;
MGTwitterRequestType requestType;
MGTwitterResponseType responseType;
NSURL *URL;
NSData *json;
NSMutableArray *parsedObjects;
MGTwitterEngineDeliveryOptions deliveryOptions;
yajl_handle _handle;
NSUInteger arrayDepth;
}
+ (id)parserWithJSON:(NSData *)theJSON
delegate:(NSObject *)theDelegate
connectionIdentifier:(NSString *)identifier
requestType:(MGTwitterRequestType)reqType
responseType:(MGTwitterResponseType)respType
URL:(NSURL *)URL
deliveryOptions:(MGTwitterEngineDeliveryOptions)deliveryOptions;
- (id)initWithJSON:(NSData *)theJSON
delegate:(NSObject *)theDelegate
connectionIdentifier:(NSString *)identifier
requestType:(MGTwitterRequestType)reqType
responseType:(MGTwitterResponseType)respType
URL:(NSURL *)URL
deliveryOptions:(MGTwitterEngineDeliveryOptions)deliveryOptions;
// subclass utilities
- (void)addValue:(id)value forKey:(NSString *)key;
- (void)addValue:(id)value forKey:(NSString *)key;
- (void)startDictionaryWithKey:(NSString *)key;
- (void)endDictionary;
- (void)startArrayWithKey:(NSString *)key;
- (void)endArray;
// delegate callbacks
- (void)_parsingDidEnd;
- (void)_parsingErrorOccurred:(NSError *)parseError;
- (void)_parsedObject:(NSDictionary *)dictionary;
@end