Index: src/OFIntrospection.h ================================================================== --- src/OFIntrospection.h +++ src/OFIntrospection.h @@ -94,27 +94,10 @@ * \return The type encoding for the instance variable */ - (const char*)typeEncoding; @end -#ifdef OF_HAVE_PROPERTIES -/** - * \brief A class for describing a property. - */ -@interface OFProperty: OFObject -{ - OFString *name; - const char *attributes; -} - -/// The name of the property. -@property (readonly, copy) OFString *name; -/// The attributes of the property. -@property (readonly) const char *attributes; -@end -#endif - /** * \brief A class for introspecting classes. */ @interface OFIntrospection: OFObject { @@ -128,17 +111,10 @@ #ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFArray *classMethods; @property (readonly, copy) OFArray *instanceMethods; @property (readonly, copy) OFArray *instanceVariables; - -/** - * \brief The properties of the class. - * - * Only available if OF_HAVE_PROPERTIES is defined. - */ -@property (readonly, copy) OFArray *properties; #endif /** * \brief Creates a new introspection for the specified class. * Index: src/OFIntrospection.m ================================================================== --- src/OFIntrospection.m +++ src/OFIntrospection.m @@ -164,53 +164,11 @@ @"", name, typeEncoding, offset]; } @end -#ifdef OF_HAVE_PROPERTIES -@implementation OFProperty -@synthesize name, attributes; - -#if defined(OF_APPLE_RUNTIME) -- _initWithProperty: (objc_property_t)property -{ - self = [super init]; - - @try { - name = [[OFString alloc] - initWithCString: property_getName(property) - encoding: OF_STRING_ENCODING_ASCII]; - attributes = property_getAttributes(property); - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} -#endif - -- (void)dealloc -{ - [name release]; - - [super dealloc]; -} - -- (OFString*)description -{ - return [OFString stringWithFormat: @"", - name, attributes]; -} -@end -#endif - @implementation OFIntrospection -#ifdef OF_HAVE_PROPERTIES -@synthesize properties; -#endif - + introspectionWithClass: (Class)class { return [[[self alloc] initWithClass: class] autorelease]; } @@ -222,22 +180,16 @@ #if defined(OF_OBJFW_RUNTIME) struct objc_method_list *methodList; #elif defined(OF_APPLE_RUNTIME) Method *methodList; Ivar *ivarList; -# ifdef OF_HAVE_PROPERTIES - objc_property_t *propertyList; -# endif unsigned i, count; #endif classMethods = [[OFMutableArray alloc] init]; instanceMethods = [[OFMutableArray alloc] init]; instanceVariables = [[OFMutableArray alloc] init]; -#ifdef OF_HAVE_PROPERTIES - properties = [[OFMutableArray alloc] init]; -#endif #if defined(OF_OBJFW_RUNTIME) for (methodList = object_getClass(class)->methodlist; methodList != NULL; methodList = methodList->next) { int i; @@ -278,12 +230,10 @@ [ivar autorelease]]; objc_autoreleasePoolPop(pool); } } - - /* TODO: properties */ #elif defined(OF_APPLE_RUNTIME) methodList = class_copyMethodList(object_getClass(class), &count); @try { for (i = 0; i < count; i++) { @@ -320,32 +270,15 @@ objc_autoreleasePoolPop(pool); } } @finally { free(ivarList); } - - propertyList = class_copyPropertyList(class, &count); - @try { - for (i = 0; i < count; i++) { - void *pool = objc_autoreleasePoolPush(); - [properties addObject: - [[[OFProperty alloc] - _initWithProperty: propertyList[i]] - autorelease]]; - objc_autoreleasePoolPop(pool); - } - } @finally { - free(propertyList); - } #endif [classMethods makeImmutable]; [instanceMethods makeImmutable]; [instanceVariables makeImmutable]; -#ifdef OF_HAVE_PROPERTIES - [properties makeImmutable]; -#endif } @catch (id e) { [self release]; @throw e; } @@ -355,13 +288,10 @@ - (void)dealloc { [classMethods release]; [instanceMethods release]; [instanceVariables release]; -#ifdef OF_HAVE_PROPERTIES - [properties release]; -#endif [super dealloc]; } - (OFArray*)classMethods