ObjFW  Diff

Differences From Artifact [b6e5a88492]:

To Artifact [b2b8e66678]:


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
135

136
137
138
139
140

141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161

162
163
164
165
166

167
168
169
170
171

172
173
174
175
176
177
178
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

135
136
137
138
139

140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160

161
162
163
164
165

166
167
168
169
170

171
172
173
174
175
176
177
178







-
+




-
+




-
+



















-
+




-
+


















-
+




-
+



















-
+




-
+




-
+




















-
+




-
+




-
+







{
	SEL _selector;
	OFString *_name;
	const char *_typeEncoding;
}

/*!
 * The selector of the method.
 * @brief The selector of the method.
 */
@property (readonly, nonatomic) SEL selector;

/*!
 * The name of the method.
 * @brief The name of the method.
 */
@property (readonly, nonatomic) OFString *name;

/*!
 * The type encoding for the method.
 * @brief The type encoding for the method.
 */
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) const char *typeEncoding;

- (instancetype)init OF_UNAVAILABLE;
@end

/*!
 * @class OFProperty OFIntrospection.h ObjFW/OFIntrospection.h
 *
 * @brief A class for describing a property.
 */
@interface OFProperty: OFObject
{
	OFString *_name;
	unsigned int _attributes;
	OFString *_Nullable _getter, *_Nullable _setter;
}

/*!
 * The name of the property.
 * @brief The name of the property.
 */
@property (readonly, nonatomic) OFString *name;

/*!
 * The attributes of the property.
 * @brief The attributes of the property.
 *
 * The attributes are a bitmask with the following possible flags:@n
 * Flag                          | Description
 * ------------------------------|-------------------------------------
 * OF_PROPERTY_READONLY          | The property is declared `readonly`
 * OF_PROPERTY_READWRITE         | The property is declared `readwrite`
 * OF_PROPERTY_ASSIGN            | The property is declared `assign`
 * OF_PROPERTY_RETAIN            | The property is declared `retain`
 * OF_PROPERTY_COPY              | The property is declared `copy`
 * OF_PROPERTY_NONATOMIC         | The property is declared `nonatomic`
 * OF_PROPERTY_ATOMIC            | The property is declared `atomic`
 * OF_PROPERTY_WEAK              | The property is declared `weak`
 * OF_PROPERTY_SYNTHESIZED       | The property is synthesized
 * OF_PROPERTY_DYNAMIC           | The property is dynamic
 */
@property (readonly, nonatomic) unsigned int attributes;

/*!
 * The name of the getter.
 * @brief The name of the getter.
 */
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *getter;

/*!
 * @return The name of the setter.
 * @brief The name of the setter.
 */
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *setter;

- (instancetype)init OF_UNAVAILABLE;
@end

/*!
 * @class OFInstanceVariable OFIntrospection.h ObjFW/OFIntrospection.h
 *
 * @brief A class for describing an instance variable.
 */
@interface OFInstanceVariable: OFObject
{
	OFString *_name;
	const char *_typeEncoding;
	ptrdiff_t _offset;
}

/*!
 * The name of the instance variable.
 * @brief The name of the instance variable.
 */
@property (readonly, nonatomic) OFString *name;

/*!
 * The offset of the instance variable.
 * @brief The offset of the instance variable.
 */
@property (readonly, nonatomic) ptrdiff_t offset;

/*!
 * The type encoding for the instance variable.
 * @brief The type encoding for the instance variable.
 */
@property OF_NULLABLE_PROPERTY (readonly, nonatomic) const char *typeEncoding;

- (instancetype)init OF_UNAVAILABLE;
@end

/*!
 * @class OFIntrospection OFIntrospection.h ObjFW/OFIntrospection.h
 *
 * @brief A class for introspecting classes.
 */
@interface OFIntrospection: OFObject
{
	OFMutableArray OF_GENERIC(OFMethod *) *_classMethods;
	OFMutableArray OF_GENERIC(OFMethod *) *_instanceMethods;
	OFMutableArray OF_GENERIC(OFProperty *) *_properties;
	OFMutableArray OF_GENERIC(OFInstanceVariable *) *_instanceVariables;
}

/*!
 * The class methods of the class.
 * @brief The class methods of the class.
 */
@property (readonly, nonatomic) OFArray OF_GENERIC(OFMethod *) *classMethods;

/*!
 * The instance methods of the class.
 * @brief The instance methods of the class.
 */
@property (readonly, nonatomic) OFArray OF_GENERIC(OFMethod *) *instanceMethods;

/*!
 * The properties of the class.
 * @brief The properties of the class.
 *
 * @warning **Do not rely on this, as this behaves differently depending on the
 *	    compiler and ABI used!**
 *
 * @warning For the ObjFW ABI, Clang only emits data for property introspection
 *	    if `@``synthesize` or `@``dynamic` has been used on the property,
 *	    not if the property has only been implemented by methods. Using
186
187
188
189
190
191
192
193

194
195
196
197
198
199
200
186
187
188
189
190
191
192

193
194
195
196
197
198
199
200







-
+







 *
 * @warning GCC does not emit any data for property introspection for the GNU
 *	    ABI.
 */
@property (readonly, nonatomic) OFArray OF_GENERIC(OFProperty *) *properties;

/*!
 * The instance variables of the class.
 * @brief The instance variables of the class.
 */
@property (readonly, nonatomic)
    OFArray OF_GENERIC(OFInstanceVariable *) *instanceVariables;

/* TODO: protocols */

/*!