Differences From Artifact [28d5671231]:
- File src/OFIntrospection.m — part of check-in [cfd374b906] at 2015-01-03 20:57:18 on branch trunk — Update copyright (user: js, size: 12874) [annotate] [blame] [check-ins using]
To Artifact [521053ff4d]:
- File
src/OFIntrospection.m
— part of check-in
[48980f2297]
at
2015-11-29 11:43:05
on branch trunk
— Make properties a requirement and clean up code
This increases the required GCC version from 4.0 to 4.6 (exception:
Apple GCC, which already supports this with >= 4.0 starting with OS X
10.5). Since even GCC 4.6 is really old by now, there is no point in
still supporting something even older and making the code ugly because
of that. While some hardware and OS support was dropped from GCC 4.6
compared to GCC 4.0, there is nothing in there that would be an
interesting target with the exception of BeOS maybe - but a port to BeOS
can also be achieved using the Haiku support. The other dropped OSes are
mostly old versions of OSes while newer ones are still being supported
(and those newer versions of those OSes still support the same
hardware). (user: js, size: 12539) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #import "OFIntrospection.h" #import "OFString.h" #import "OFArray.h" #import "OFInitializationFailedException.h" @implementation OFMethod #if defined(OF_OBJFW_RUNTIME) - (instancetype)OF_initWithMethod: (struct objc_method*)method { self = [super init]; @try { _selector = (SEL)&method->sel; | > > | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #import "OFIntrospection.h" #import "OFString.h" #import "OFArray.h" #import "OFInitializationFailedException.h" @implementation OFMethod @synthesize selector = _selector, name = _name, typeEncoding = _typeEncoding; #if defined(OF_OBJFW_RUNTIME) - (instancetype)OF_initWithMethod: (struct objc_method*)method { self = [super init]; @try { _selector = (SEL)&method->sel; |
︙ | ︙ | |||
72 73 74 75 76 77 78 | - (void)dealloc { [_name release]; [super dealloc]; } | < < < < < < < < < < < < < < < | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | - (void)dealloc { [_name release]; [super dealloc]; } - (OFString*)description { return [OFString stringWithFormat: @"<%@: %@ [%s]>", [self class], _name, _typeEncoding]; } - (bool)isEqual: (id)object |
︙ | ︙ | |||
142 143 144 145 146 147 148 149 150 151 152 153 154 155 | OF_HASH_FINALIZE(hash); return hash; } @end @implementation OFProperty #if defined(OF_OBJFW_RUNTIME) - (instancetype)OF_initWithProperty: (struct objc_property*)property { self = [super init]; @try { _name = [[OFString alloc] initWithUTF8String: property->name]; | > > > | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | OF_HASH_FINALIZE(hash); return hash; } @end @implementation OFProperty @synthesize name = _name, attributes = _attributes; @synthesize getter = _getter, setter = _setter; #if defined(OF_OBJFW_RUNTIME) - (instancetype)OF_initWithProperty: (struct objc_property*)property { self = [super init]; @try { _name = [[OFString alloc] initWithUTF8String: property->name]; |
︙ | ︙ | |||
312 313 314 315 316 317 318 | [_name release]; [_getter release]; [_setter release]; [super dealloc]; } | < < < < < < < < < < < < < < < < < < < < | 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | [_name release]; [_getter release]; [_setter release]; [super dealloc]; } - (OFString*)description { return [OFString stringWithFormat: @"<%@: %@\n" @"\tAttributes = 0x%03X\n" @"\tGetter = %@\n" @"\tSetter = %@\n" |
︙ | ︙ | |||
384 385 386 387 388 389 390 391 392 393 394 395 396 397 | OF_HASH_FINALIZE(hash); return hash; } @end @implementation OFInstanceVariable #if defined(OF_OBJFW_RUNTIME) - (instancetype)OF_initWithIvar: (struct objc_ivar*)ivar { self = [super init]; @try { _name = [[OFString alloc] initWithUTF8String: ivar->name]; | > > | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | OF_HASH_FINALIZE(hash); return hash; } @end @implementation OFInstanceVariable @synthesize name = _name, offset = _offset, typeEncoding = _typeEncoding; #if defined(OF_OBJFW_RUNTIME) - (instancetype)OF_initWithIvar: (struct objc_ivar*)ivar { self = [super init]; @try { _name = [[OFString alloc] initWithUTF8String: ivar->name]; |
︙ | ︙ | |||
433 434 435 436 437 438 439 | - (void)dealloc { [_name release]; [super dealloc]; } | < < < < < < < < < < < < < < < > > > | 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | - (void)dealloc { [_name release]; [super dealloc]; } - (OFString*)description { return [OFString stringWithFormat: @"<OFInstanceVariable: %@ [%s] @ 0x%tx>", _name, _typeEncoding, _offset]; } @end @implementation OFIntrospection @synthesize classMethods = _classMethods, instanceMethods = _instanceMethods; @synthesize properties = _properties, instanceVariables = _instanceVariables; + (instancetype)introspectionWithClass: (Class)class { return [[[self alloc] initWithClass: class] autorelease]; } - initWithClass: (Class)class { |
︙ | ︙ | |||
618 619 620 621 622 623 624 | { [_classMethods release]; [_instanceMethods release]; [_instanceVariables release]; [super dealloc]; } | < < < < < < < < < < < < < < < < < < < < | 578 579 580 581 582 583 584 585 | { [_classMethods release]; [_instanceMethods release]; [_instanceVariables release]; [super dealloc]; } @end |