forked from robrohan/WebArchiveExtractor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Extractor.h
72 lines (59 loc) · 1.76 KB
/
Extractor.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//
// Exctractor.h
// ExtractorAction
//
// Created by Vitaly Davidenko on 12/10/06.
// Copyright 2006 Vitaly Davidenko.
//
// Apple Public Source License
// http://www.opensource.apple.com/apsl/
//
// Updated and refactored by Rob Rohan on 2007-09-18
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
@interface Extractor : NSObject
{
WebResource * m_mainResource;
NSMutableSet * m_resources;
//in m_resourceLookupTable HTML resource can be stored with relative or
//absolute path m_resourceLookupTable contains several keys for each resource
// (as least 2: absolute and relative paths)
NSMutableDictionary * m_resourceLookupTable;
/** the index file name */
NSString * entryFileName;
/** what kind of file to create (XML, XHTML, etc) */
int contentKind;
/** URL to add to the begining of the hrefs / srcs */
NSString * URLPrepend;
}
/**
* load web archive file
*/
- (void) loadWebArchive:(NSString*) pathToWebArchive;
/**
* add resource to resource table
*/
- (void) addResource:(WebResource *) resource;
/**
* extract to directory
*/
- (NSString*) extractResources:(NSString*) path;
/**
* private method
* extract resource to existing packagePath (using outputResource)
* (packagePath the same as path of extractResources message)
*/
- (void) extractResource:(WebResource *) resource packagePath: (NSString*) path;
/**
* protected method
* write resource data to filePath
* Parent directory of filePath should exists
*/
-(void) outputResource:(WebResource *) resource filePath: (NSString*) filePath packagePath: (NSString*) packagePath;
- (void) setEntryFileName:(NSString *) filename;
- (NSString *) entryFileName;
- (void) setContentKind:(int) kind;
- (int) contentKind;
- (void) setURLPrepend:(NSString *) url;
- (NSString *) URLPrepend;
@end