Differences From Artifact [4147582b99]:
- File
src/OFObject.m
— part of check-in
[033054ad75]
at
2009-05-29 19:21:57
on branch trunk
— A few renames.
OFExceptions:
* OFNoMemException to OFOutOfMemoryException.
* OFMemNotPartOfObjException to OFMemoryNotPartOfObjectException.OFObject:
* -[addItemToMemoryPool:] to -[addMemoryToPool:].
* -[allocWithSize:] to -[allocMemoryWithSize:].
* -[allocNItems:withSize] to -[allocMemoryForNItems:withSize:].
* -[resizeMem:toSize] to -[resizeMemory:toSize:].
* -[resizeMem:toNItems:withSize:] to
-[resizeMemoryToNItems:withSize:].
* -[freeMem] to -[freeMemory:].OFString:
* -[urlencode] to -[urlEncodedString].
* -[urldecode] to -[urlDecodedString]. (user: js, size: 8338) [annotate] [blame] [check-ins using]
To Artifact [089ffd7efa]:
- File src/OFObject.m — part of check-in [5008910e85] at 2009-06-01 12:20:58 on branch trunk — Add +[conformsTo:] and -[conformsTo:]. (user: js, size: 8913) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
90 91 92 93 94 95 96 97 98 99 100 101 102 103 | { #ifdef __objc_INCLUDE_GNU return class_get_class_name(self); #else return class_getName(self); #endif } + (IMP)replaceMethod: (SEL)selector withMethodFromClass: (Class)class; { #ifdef __objc_INCLUDE_GNU Method_t method = class_get_instance_method(self, selector); IMP oldimp, newimp; | > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | { #ifdef __objc_INCLUDE_GNU return class_get_class_name(self); #else return class_getName(self); #endif } + (BOOL)conformsTo: (Protocol*)protocol { #ifdef __objc_INCLUDE_GNU Class c; struct objc_protocol_list *pl; size_t i; for (c = self; c != Nil; c = class_get_super_class(c)) for (pl = c->protocols; pl != NULL; pl = pl->next) for (i = 0; i < pl->count; i++) if ([pl->list[i] conformsTo: protocol]) return YES; return NO; #else Class c; for (c = self; c != Nil; c = class_getSuperclass(c)) if (class_conformsToProtocol(c, protocol)) return YES; return NO; #endif } + (IMP)replaceMethod: (SEL)selector withMethodFromClass: (Class)class; { #ifdef __objc_INCLUDE_GNU Method_t method = class_get_instance_method(self, selector); IMP oldimp, newimp; |
︙ | ︙ | |||
168 169 170 171 172 173 174 175 176 177 178 179 180 181 | return class_get_instance_method(isa, selector) != METHOD_NULL; else return class_get_class_method(isa, selector) != METHOD_NULL; #else return class_respondsToSelector(isa, selector); #endif } - (IMP)methodFor: (SEL)selector { #ifdef __objc_INCLUDE_GNU if (object_is_instance(self)) return method_get_imp(class_get_instance_method(isa, selector)); else | > > > > > | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | return class_get_instance_method(isa, selector) != METHOD_NULL; else return class_get_class_method(isa, selector) != METHOD_NULL; #else return class_respondsToSelector(isa, selector); #endif } - (BOOL)conformsTo: (Protocol*)protocol { return [isa conformsTo: protocol]; } - (IMP)methodFor: (SEL)selector { #ifdef __objc_INCLUDE_GNU if (object_is_instance(self)) return method_get_imp(class_get_instance_method(isa, selector)); else |
︙ | ︙ |