Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c46e39e703
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 51 lines (40 sloc) 1.536 kb
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
Something went wrong with that request. Please try again.