Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 55 lines (44 sloc) 1.598 kB
fbfc444 First pass at adding JSON support with YAJL.
Craig Hockenberry authored
1 //
2 // MGTwitterYAJLParser.h
3 // MGTwitterEngine
4 //
5 // Created by Matt Gemmell on 18/02/2008.
6 // Copyright 2008 Instinctive Code.
7 //
8
9 #import "MGTwitterEngineGlobalHeader.h"
10 //#include <libxml/xmlreader.h>
11 #include <yajl/yajl_parse.h>
12
13 #import "MGTwitterParserDelegate.h"
14
15 @interface MGTwitterYAJLParser : NSObject {
16 __weak NSObject <MGTwitterParserDelegate> *delegate; // weak ref
17 NSString *identifier;
18 MGTwitterRequestType requestType;
19 MGTwitterResponseType responseType;
20 NSURL *URL;
21 NSData *json;
22 NSMutableArray *parsedObjects;
23
24 // xmlTextReaderPtr _reader;
25 yajl_handle _handle;
26 }
27
28 + (id)parserWithJSON:(NSData *)theJSON delegate:(NSObject *)theDelegate
29 connectionIdentifier:(NSString *)identifier requestType:(MGTwitterRequestType)reqType
30 responseType:(MGTwitterResponseType)respType URL:(NSURL *)URL;
31 - (id)initWithJSON:(NSData *)theJSON delegate:(NSObject *)theDelegate
32 connectionIdentifier:(NSString *)identifier requestType:(MGTwitterRequestType)reqType
33 responseType:(MGTwitterResponseType)respType URL:(NSURL *)URL;
34
35 - (void)parse;
36
37 // subclass utilities
38 /*
39 - (xmlChar *)_nodeValue;
40 - (NSString *)_nodeValueAsString;
41 - (NSDate *)_nodeValueAsDate;
42 - (NSNumber *)_nodeValueAsInt;
43 - (NSNumber *)_nodeValueAsBool;
44 - (NSDictionary *)_statusDictionaryForNodeWithName:(const xmlChar *)parentNodeName;
45 - (NSDictionary *)_userDictionaryForNodeWithName:(const xmlChar *)parentNodeName;
46 - (NSDictionary *)_hashDictionaryForNodeWithName:(const xmlChar *)parentNodeName;
47 */
48
49 // delegate callbacks
50 - (void)_parsingDidEnd;
51 - (void)_parsingErrorOccurred:(NSError *)parseError;
52
53
54 @end
Something went wrong with that request. Please try again.