forked from atg/Ingredients
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IGKScraper.h
81 lines (58 loc) · 1.92 KB
/
IGKScraper.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
73
74
75
76
77
78
79
80
81
//
// IGKScraper.h
// Ingredients
//
// Created by Alex Gordon on 24/01/2010.
// Written in 2010 by Fileability.
//
#import <Cocoa/Cocoa.h>
@class IGKLaunchController;
@class IGKDocRecordManagedObject;
//A scraper takes a .docset and populates a core data database
@interface IGKScraper : NSObject
{
NSString *docsetpath;
NSURL *docsetURL;
NSURL *url;
NSManagedObjectContext *ctx;
IGKLaunchController *launchController;
dispatch_queue_t dbQueue;
NSUInteger pathsCount;
NSUInteger pathsCounter;
NSMutableArray *paths;
NSManagedObject *scraperDocset;
NSString *developerDirectory;
}
- (id)initWithDocsetURL:(NSURL *)theDocsetURL managedObjectContext:(NSManagedObjectContext *)moc launchController:(IGKLaunchController*)lc dbQueue:(dispatch_queue_t)dbq developerDirectory:(NSString *)devDir;
- (void)findPathCount;
- (BOOL)findPaths;
- (void)index;
@end
@interface IGKFullScraper : NSObject
{
IGKDocRecordManagedObject *persistobj;
IGKDocRecordManagedObject *transientObject;
NSManagedObjectContext *transientContext;
//We use instance variables in IGKFullScraper as a way of maintaining state without passing arguments
NSManagedObject *docset;
NSXMLDocument *doc;
NSArray *methodNodes;
BOOL isParsingDeprecatedAppendix;
//Some caching of entities
NSEntityDescription *ObjCMethodEntity;
NSEntityDescription *ObjCNotificationEntity;
NSEntityDescription *ParameterEntity;
NSEntityDescription *SeeAlsoEntity;
NSEntityDescription *SampleCodeProjectEntity;
NSEntityDescription *MetaTaskGroupEntity;
NSEntityDescription *MetaTaskGroupItemEntity;
NSEntityDescription *ObjCBindingEntity;
NSEntityDescription *ObjCBindingOptionEntity;
NSEntityDescription *ObjCBindingPlaceholderEntity;
}
@property (readonly) NSManagedObject *transientObject;
@property (readonly) NSManagedObjectContext *transientContext;
- (id)initWithManagedObject:(IGKDocRecordManagedObject *)persistentObject;
- (void)start;
- (void)cleanUp;
@end