ObjFW  Check-in [8830166fe8]

Overview
Comment:Add -[OFObject isMemberOfClass:] and -[OFObject isProxy].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8830166fe833d173b4f227d4202c3ca7cd347afa447411061230921643eeeddf
User & Date: js on 2012-02-27 22:11:47
Other Links: manifest | tags
Context
2012-02-27
22:59
Add void to parameter list. check-in: e53bf9f3fc user: js tags: trunk
22:11
Add -[OFObject isMemberOfClass:] and -[OFObject isProxy]. check-in: 8830166fe8 user: js tags: trunk
17:15
Rename OFJSON/OFJSONEncoding to OFJSONRepresentation. check-in: 3c0235cd81 user: js tags: trunk
Changes

Modified src/OFObject.h from [e279082981] to [131792314e].

108
109
110
111
112
113
114









115
116
117
118
119
120
121
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130







+
+
+
+
+
+
+
+
+







 * \brief Returns a boolean whether the object of the specified kind.
 *
 * \param class_ The class whose kind is checked
 * \return A boolean whether the object is of the specified kind
 */
- (BOOL)isKindOfClass: (Class)class_;

/**
 * \brief Returns a boolean whether the object is a member of the specified
 *	  class.
 *
 * \param class_ The class for which the receiver is checked
 * \return A boolean whether the object is a member of the specified class
 */
- (BOOL)isMemberOfClass: (Class)class_;

/**
 * \brief Returns a boolean whether the object responds to the specified
 *	  selector.
 *
 * \param selector The selector which should be checked for respondance
 * \return A boolean whether the objects responds to the specified selector
 */
232
233
234
235
236
237
238







239
240
241
242
243
244
245
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261







+
+
+
+
+
+
+








/**
 * \brief Returns the receiver.
 *
 * \return The receiver
 */
- self;

/**
 * \brief Returns whether the object is a proxy object.
 *
 * \return A boolean whether the object is a proxy object
 */
- (BOOL)isProxy;
@end

/**
 * \brief The root class for all other classes inside ObjFW.
 */
@interface OFObject <OFObject>
{

Modified src/OFObject.m from [0093660075] to [76ac8473f2].

777
778
779
780
781
782
783





784
785
786
787
788
789
790
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795







+
+
+
+
+








	for (iter = isa; iter != Nil; iter = class_getSuperclass(iter))
		if (iter == class)
			return YES;

	return NO;
}

- (BOOL)isMemberOfClass: (Class)class
{
	return (isa == class);
}

- (BOOL)respondsToSelector: (SEL)selector
{
#ifdef OF_OLD_GNU_RUNTIME
	if (object_is_instance(self))
		return class_get_instance_method(isa, selector) != METHOD_NULL;
	else
1108
1109
1110
1111
1112
1113
1114





1115
1116
1117
1118
1119
1120
1121
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131







+
+
+
+
+







	return self;
}

- self
{
	return self;
}

- (BOOL)isProxy
{
	return NO;
}

- (void)dealloc
{
	Class class;
	void (*last)(id, SEL) = NULL;
	void **iter;