-
Notifications
You must be signed in to change notification settings - Fork 5
/
SCKProject.h
111 lines (99 loc) · 3.18 KB
/
SCKProject.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#import <Foundation/Foundation.h>
#import <EtoileFoundation/EtoileFoundation.h>
@class SCKSourceCollection;
/**
* SCKProject represents an IDE project that tracks several source files usually
* put together in a directory.
*
* In addition, SCKProject provides access to the program components declared
* in the project files. See -classes, -functions and -globals.
*
* Custom presentation in the IDE source list (or similar UI) are supported by
* setting a custom project content class, that implements the collection
* protocols on the behalf of SCKProject instance. The collection returned by
* -content depends on the class set with -setContentClass:.
*/
@interface SCKProject : NSObject //<ETCollection, ETCollectionMutation>
/**
* <init />
* Initializes and returns a new project based on the directory URL (to resolve
* relative paths) and the provided source collection to retrieve the SCKFile
* objects.
*
* A source collection can be shared between several projects (it caches SCKFile
* objects).
*
* When aSourceCollection is nil, raises a NSInvalidArgumentException.
*/
- (id) initWithDirectoryURL: (NSURL *)aURL
sourceCollection: (SCKSourceCollection *)aSourceCollection;
/**
* The project directory URL used to resolve relative paths (such as -fileURLs).
*/
@property (nonatomic, readonly) NSURL *directoryURL;
/**
* Returns the URLs of the files that belong to the project.
*/
@property (nonatomic, readonly) NSArray *fileURLs;
/**
* Adds the file that corresponds to the URL to the project.
*
* When the URL is nil, raises a NSInvalidArgumentException.
*/
- (void)addFileURL: (NSURL *)aURL;
/**
* Removes the file that corresponds to the URL from the project.
*
* When the URL is nil, raises a NSInvalidArgumentException.
*/
- (void)removeFileURL: (NSURL *)aURL;
/**
* The files that belong to the project.
*
* The returned array contains SCKFile objects.
*/
@property (nonatomic, readonly) NSArray *files;
/**
* All the classes declared in the files that belong to the project.
*
* The returned array contains SCKClass objects.
*/
@property (nonatomic, readonly) NSArray *classes;
/**
* All the functions declared in the files that belong to the project.
*
* The returned array contains SCKFunction objects.
*/
@property (nonatomic, readonly) NSArray *functions;
/**
* All the global variables declared in the files that belong to the project.
*
* The returned array contains SCKGlobal objects.
*/
@property (nonatomic, readonly) NSArray *globals;
/**
* The content class that controls the current content exposed through the
* collection protocols.
*
* The content class must conform to SCKProjectContent protocol.
*/
@property (nonatomic) Class contentClass;
@end
/**
* Protocol to which SCKProject content class must conform to.
* See -[SCKProject setContentClass:].
*/
@protocol SCKProjectContent
- (id)content;
@end
/**
* Content class to present the project files.
*/
@interface SCKFileBrowsingProjectContent : NSObject <SCKProjectContent>
@end
/**
* Content class to present the project program components grouped into classes,
* functions and globals.
*/
@interface SCKSymbolBrowsingProjectContent : NSObject <SCKProjectContent>
@end