mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
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:
parent
dfb3caad5a
commit
e2a88e91e3
2 changed files with 28 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue