-
Notifications
You must be signed in to change notification settings - Fork 5
/
SCKIntrospection.h
134 lines (119 loc) · 4.18 KB
/
SCKIntrospection.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#import <Foundation/NSObject.h>
@class NSString;
@class NSAttributedString;
@class SCKSourceLocation;
@class NSMutableArray;
@class NSMutableDictionary;
@class SCKIvar, SCKProperty;
/**
* SCKProgramComponent is an abstract class representing properties of some
* component of a program. This includes classes, functions, methods, and so
* on.
*
* Program components in SourceCodeKit can be obtained both by runtime
* introspection and by parsing source code.
*/
@interface SCKProgramComponent : NSObject
/**
* The name of this program component.
*/
@property (nonatomic, retain) NSString *name;
/**
* The location where the component is defined, if visible.
*/
@property (nonatomic, retain) SCKSourceLocation *definition;
/**
* The location where the component is declared, if visible.
*/
// FIXME: We should allow multiple declaration locations.
@property (nonatomic, retain) SCKSourceLocation *declaration;
/**
* Documentation associated with this object. This may be generated by an IDE,
* extracted from headers, or read from some external source.
*/
@property (nonatomic, retain) NSAttributedString *documentation;
/**
* The parent of this component.
*/
@property (nonatomic, unsafe_unretained) SCKProgramComponent *parent;
/**
* Returns whether the program component has only been parsed as a forward
* declaration in the source code.
*/
@property (nonatomic, readonly, assign) BOOL isForwardDeclaration;
@end
/**
* A program component with a type.
*/
@interface SCKTypedProgramComponent : SCKProgramComponent
/** Objective-C type encoding of the component. */
@property (retain, nonatomic) NSString *typeEncoding;
@end
@interface SCKBundle : SCKProgramComponent
/**
* All of the public symbols exported by the bundle.
*/
@property (retain, nonatomic) NSMutableArray *classes;
@property (retain, nonatomic) NSMutableArray *functions;
@end
@interface SCKClass : SCKProgramComponent
@property (nonatomic, unsafe_unretained) SCKClass *superclass;
@property (nonatomic, readonly, retain) NSMutableArray *subclasses;
@property (nonatomic, readonly, retain) NSMutableDictionary *categories;
@property (nonatomic, readonly, retain) NSMutableDictionary *methods;
@property (nonatomic, readonly, retain) NSMutableArray *ivars;
@property (nonatomic, readonly, retain) NSMutableArray *properties;
- (SCKIvar*)ivarForName: (NSString *)name;
- (SCKProperty*)propertyForName: (NSString *)aProperty;
- (id) initWithClass: (Class)cls;
@end
@interface SCKProtocol : SCKProgramComponent
@property (nonatomic, readonly, retain) NSMutableDictionary *requiredMethods;
@property (nonatomic, readonly, retain) NSMutableDictionary *optionalMethods;
@property (nonatomic, readonly, retain) NSMutableArray *requiredProperties;
@property (nonatomic, readonly, retain) NSMutableArray *optionalProperties;
- (SCKProperty*)requiredPropertyForName: (NSString *)aProperty;
- (SCKProperty*)optionalPropertyForName: (NSString *)aProperty;
@end
@interface SCKCategory : SCKProgramComponent
@property (nonatomic, readonly, retain) NSMutableDictionary *methods;
@property (nonatomic, readonly, retain) NSMutableArray *properties;
- (SCKProperty*)propertyForName: (NSString *)aProperty;
@end
@interface SCKMethod : SCKTypedProgramComponent
@property (nonatomic, assign) BOOL isClassMethod;
@end
@interface SCKIvar : SCKTypedProgramComponent
@property (nonatomic, assign) BOOL isIBOutlet;
@end
@interface SCKFunction : SCKTypedProgramComponent
@end
@interface SCKGlobal : SCKTypedProgramComponent
@end
@interface SCKProperty : SCKTypedProgramComponent
@property (nonatomic, retain) NSString *attributes;
@property (nonatomic, assign) BOOL isIBOutlet;
@end
@interface SCKMacro : SCKTypedProgramComponent
@end
/**
* Enumerated type value. This encapsulates the name and value of the
* enumeration value.
*/
@interface SCKEnumerationValue : SCKProgramComponent
/**
* Returns the value of the enumeration.
*/
@property long long longLongValue;
/**
* The name of the enumeration.
*/
@property (nonatomic, retain) NSString *enumerationName;
@end
@interface SCKEnumeration : SCKTypedProgramComponent
/**
* Array of SCKEnumerationValue instances that describe the values in this
* enumeration.
*/
@property (nonatomic, retain) NSMutableDictionary *values;
@end