-
Notifications
You must be signed in to change notification settings - Fork 1
/
MGTwitterLibXMLParser.h
50 lines (40 loc) · 1.5 KB
/
MGTwitterLibXMLParser.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
//
// MGTwitterLibXMLParser.h
// MGTwitterEngine
//
// Created by Matt Gemmell on 18/02/2008.
// Copyright 2008 Instinctive Code.
//
#import "MGTwitterEngineGlobalHeader.h"
#include <libxml/xmlreader.h>
#import "MGTwitterParserDelegate.h"
@interface MGTwitterLibXMLParser : NSObject {
__weak NSObject <MGTwitterParserDelegate> *delegate; // weak ref
NSString *identifier;
MGTwitterRequestType requestType;
MGTwitterResponseType responseType;
NSURL *URL;
NSData *xml;
NSMutableArray *parsedObjects;
xmlTextReaderPtr _reader;
}
+ (id)parserWithXML:(NSData *)theXML delegate:(NSObject *)theDelegate
connectionIdentifier:(NSString *)identifier requestType:(MGTwitterRequestType)reqType
responseType:(MGTwitterResponseType)respType URL:(NSURL *)URL;
- (id)initWithXML:(NSData *)theXML delegate:(NSObject *)theDelegate
connectionIdentifier:(NSString *)identifier requestType:(MGTwitterRequestType)reqType
responseType:(MGTwitterResponseType)respType URL:(NSURL *)URL;
- (void)parse;
// subclass utilities
- (xmlChar *)_nodeValue;
- (NSString *)_nodeValueAsString;
- (NSDate *)_nodeValueAsDate;
- (NSNumber *)_nodeValueAsInt;
- (NSNumber *)_nodeValueAsBool;
- (NSDictionary *)_statusDictionaryForNodeWithName:(const xmlChar *)parentNodeName;
- (NSDictionary *)_userDictionaryForNodeWithName:(const xmlChar *)parentNodeName;
- (NSDictionary *)_hashDictionaryForNodeWithName:(const xmlChar *)parentNodeName;
// delegate callbacks
- (void)_parsingDidEnd;
- (void)_parsingErrorOccurred:(NSError *)parseError;
@end