forked from unixpickle/ANHTML
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathANHTMLParser.h
More file actions
39 lines (27 loc) · 970 Bytes
/
ANHTMLParser.h
File metadata and controls
39 lines (27 loc) · 970 Bytes
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
//
// ANHTMLParser.h
// ANHTML
//
// Created by Alex Nichol on 11/17/11.
// Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "StringFeed.h"
@class ANHTMLParser;
@protocol ANHTMLParserDelegate <NSObject>
- (void)htmlParser:(ANHTMLParser *)parser didStartElement:(NSString *)name attributes:(NSDictionary *)attributes;
- (void)htmlParser:(ANHTMLParser *)parser didEndElement:(NSString *)name;
- (void)htmlParser:(ANHTMLParser *)parser didEncounterPlainText:(NSString *)text;
@optional
- (unichar)htmlParser:(ANHTMLParser *)parser characterForEscapeCode:(NSString *)code;
@end
@interface ANHTMLParser : NSObject {
StringFeed * feed;
NSMutableString * plainBuffer;
__unsafe_unretained id<ANHTMLParserDelegate> delegate;
}
@property (nonatomic, assign) id<ANHTMLParserDelegate> delegate;
- (id)initWithDocumentData:(NSData *)data;
- (id)initWithDocumentString:(NSString *)string;
- (void)parse;
@end