ObjFW  Check-in [5f47e81a9e]

Overview
Comment:Add +[instancesRespondToSelector:] to OFObject.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5f47e81a9e6e4ce717184cacd2397dd37fb709078288711cca418f1396074bf0
User & Date: js on 2009-06-30 14:15:12
Other Links: manifest | tags
Context
2009-06-30
14:22
Add +[instanceMethodForSelector:] to OFObject. check-in: 0707c56762 user: js tags: trunk
14:15
Add +[instancesRespondToSelector:] to OFObject. check-in: 5f47e81a9e user: js tags: trunk
13:38
Implement OFCopying and OFMutableCopying in OFDictionary. check-in: eddc0ba58c user: js tags: trunk
Changes

Modified src/OFObject.h from [f2a66cf4f4] to [2922396d0b].

49
50
51
52
53
54
55








56
57
58
59
60
61
62
+ (Class)class;

/**
 * \return The name of the class as a C string
 */
+ (const char*)name;









/**
 * \param protocol The protocol which should be checked for conformance
 *
 * \return A boolean whether the class conforms to the specified protocol
 */
+ (BOOL)conformsToProtocol: (Protocol*)protocol;








>
>
>
>
>
>
>
>







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
+ (Class)class;

/**
 * \return The name of the class as a C string
 */
+ (const char*)name;

/**
 * \param selector The selector which should be checked for respondance
 *
 * \return A boolean whether instances of the class respond to the specified
 *	   selector
 */
+ (BOOL)instancesRespondToSelector: (SEL)selector;

/**
 * \param protocol The protocol which should be checked for conformance
 *
 * \return A boolean whether the class conforms to the specified protocol
 */
+ (BOOL)conformsToProtocol: (Protocol*)protocol;

Modified src/OFObject.m from [434aadda8c] to [b8dec711ff].

92
93
94
95
96
97
98









99
100
101
102
103
104
105
{
#ifdef __objc_INCLUDE_GNU
	return class_get_class_name(self);
#else
	return class_getName(self);
#endif
}










+ (BOOL)conformsToProtocol: (Protocol*)protocol
{
#ifdef __objc_INCLUDE_GNU
	Class c;
	struct objc_protocol_list *pl;
	size_t i;







>
>
>
>
>
>
>
>
>







92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
{
#ifdef __objc_INCLUDE_GNU
	return class_get_class_name(self);
#else
	return class_getName(self);
#endif
}

+ (BOOL)instancesRespondToSelector: (SEL)selector
{
#ifdef __objc_INCLUDE_GNU
	return class_get_instance_method(self, selector) != METHOD_NULL;
#else
	return class_respondsToSelector(self, selector);
#endif
}

+ (BOOL)conformsToProtocol: (Protocol*)protocol
{
#ifdef __objc_INCLUDE_GNU
	Class c;
	struct objc_protocol_list *pl;
	size_t i;