Tidied method signature stuff

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2984 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1998-09-26 05:07:02 +00:00
parent dfb3caad5a
commit e2a88e91e3
2 changed files with 28 additions and 2 deletions

View file

@ -24,6 +24,7 @@
#include <config.h>
#include <Foundation/DistributedObjects.h>
#include <Foundation/NSMethodSignature.h>
#include <Foundation/NSException.h>
static int debug_proxy;
@ -299,6 +300,30 @@ format: @"NSDistantObject objects only encode with PortEncoder class"];
return self;
}
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector
{
const char *types = 0;
if (_protocol) {
struct objc_method_description* mth;
mth = [_protocol descriptionForInstanceMethod: aSelector];
if (mth == 0) {
mth = [_protocol descriptionForClassMethod: aSelector];
}
if (mth != 0) {
types = mth->types;
}
}
else {
types = [self selectorTypeForProxy: aSelector];
}
if (types == 0) {
return nil;
}
return [NSMethodSignature signatureWithObjCTypes: types];
}
- (void) setProtocolForProxy: (Protocol*)aProtocol
{
_protocol = aProtocol;

View file

@ -120,7 +120,7 @@
- (void) forwardInvocation: (NSInvocation*)anInvocation
{
[NSException raise: NSInvalidArgumentException
format: @"NSProxy should does not implement '%s'",
format: @"NSProxy should not implement '%s'",
sel_get_name(_cmd)];
}
@ -171,7 +171,8 @@
- (NSMethodSignature*) methodSignatureForSelector: (SEL)aSelector
{
[self notImplemented: _cmd];
[NSException raise: NSInvalidArgumentException format:
@"NSProxy should not implement 'methodSignatureForSelector:'"];
return nil;
}