Implement -className

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13806 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-06-09 04:57:04 +00:00
parent 395e1058fe
commit cc9e39dd04
3 changed files with 45 additions and 17 deletions

View file

@ -1,3 +1,7 @@
2002-06-09 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSObject.m: Implemented and documented -className
2002-06-06 Adam Fedor <fedor@gnu.org>
* Source/cifframe.m (cifframe_from_info): Set value locations

View file

@ -104,6 +104,11 @@
- (id) mutableCopyWithZone: (NSZone*)zone;
@end
/**
* This protocol must be adopted by any class wishing to support
* saving and restoring instances to an archive, or copying them
* to remote processes via the Distributed Objects mechanism.
*/
@protocol NSCoding
- (void) encodeWithCoder: (NSCoder*)aCoder;
- (id) initWithCoder: (NSCoder*)aDecoder;
@ -120,11 +125,16 @@
+ (BOOL) requiresTypedMemory;
#endif
#endif
+ (void) initialize;
#ifndef STRICT_OPENSTEP
- (NSString*) className;
#endif
+ (id) allocWithZone: (NSZone*)z;
+ (id) alloc;
+ (Class) class;
+ (NSString*) description;
+ (void) initialize;
+ (IMP) instanceMethodForSelector: (SEL)aSelector;
+ (NSMethodSignature*) instanceMethodSignatureForSelector: (SEL)aSelector;
+ (BOOL) instancesRespondToSelector: (SEL)aSelector;
@ -140,7 +150,7 @@
- (Class) classForArchiver;
- (Class) classForCoder;
- (Class) classForPortCoder;
- (BOOL) conformsToProtocol: (Protocol *)aProtocol;
- (BOOL) conformsToProtocol: (Protocol*)aProtocol;
- (id) copy;
- (void) dealloc;
- (NSString*) description;
@ -156,8 +166,11 @@
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector;
- (id) mutableCopy;
- (id) performSelector: (SEL)aSelector;
- (id) performSelector: (SEL)aSelector withObject: anObject;
- (id) performSelector: (SEL)aSelector withObject: object1 withObject: object2;
- (id) performSelector: (SEL)aSelector
withObject: (id)anObject;
- (id) performSelector: (SEL)aSelector
withObject: (id)object1
withObject: (id)object2;
- (void) release;
- (id) replacementObjectForArchiver: (NSArchiver*)anArchiver;
- (id) replacementObjectForCoder: (NSCoder*)anEncoder;

View file

@ -802,6 +802,30 @@ static BOOL double_release_check_enabled = NO;
return [[self alloc] init];
}
/**
* Returns the class of which the receiver is an instance.<br />
* The default implementation returns the private <code>isa</code>
* instance variable of NSObject, which is used to store a pointer
* to the objects class.<br />
* NB. When NSZombie is enabled (see NSDebug.h) this pointer is
* changed upon object deallocation.
*/
- (Class) class
{
return object_get_class(self);
}
/**
* Returns the name of the class of the receiving object by using
* the NSStringFromClass() function.<br />
* This is a MacOS-X addition for apple scripting, which is also
* generally useful.
*/
- (NSString*) className
{
return NSStringFromClass([self class]);
}
/**
* Creates and returns a copy of the reciever by calling -copyWithZone:
* passing NSDefaultMallocZone()
@ -1164,19 +1188,6 @@ static BOOL double_release_check_enabled = NO;
return self;
}
/**
* Returns the class of which the receiver is an instance.<br />
* The default implementation returns the private <code>isa</code>
* instance variable of NSObject, which is used to store a pointer
* to the objects class.<br />
* NB. When NSZombie is enabled (see NSDebug.h) this pointer is
* changed upon object deallocation.
*/
- (Class) class
{
return object_get_class(self);
}
/**
* Returns the hash of the receiver. Subclasses should ensure that their
* implementations of this method obey the rule that if the -isEqual: method