Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 61 lines (50 sloc) 1.834 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
ff9733a Finished parsing code with YAJL: status, message, user and misc result s...
Craig Hockenberry authored
35 //- (void)parse;
fbfc444 First pass at adding JSON support with YAJL.
Craig Hockenberry authored
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 */
a40780d Started work on YAJL callbacks to instantiate objects.
Craig Hockenberry authored
48 - (void)addValue:(id)value forKey:(NSString *)key;
49 - (void)addValue:(id)value forKey:(NSString *)key;
50 - (void)startDictionaryWithKey:(NSString *)key;
ff9733a Finished parsing code with YAJL: status, message, user and misc result s...
Craig Hockenberry authored
51 - (void)endDictionary;
a40780d Started work on YAJL callbacks to instantiate objects.
Craig Hockenberry authored
52 - (void)startArrayWithKey:(NSString *)key;
ff9733a Finished parsing code with YAJL: status, message, user and misc result s...
Craig Hockenberry authored
53 - (void)endArray;
fbfc444 First pass at adding JSON support with YAJL.
Craig Hockenberry authored
54
55 // delegate callbacks
56 - (void)_parsingDidEnd;
57 - (void)_parsingErrorOccurred:(NSError *)parseError;
58
59
60 @end
Something went wrong with that request. Please try again.