Add support for NSData conversion in the libclang introspection generator.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/dbuskit/trunk@37562 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Niels Grewe 2014-01-09 08:30:34 +00:00
parent 0ab49a825b
commit 56074cd6c0
2 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2014-01-09 Niels Grewe <niels.grewe@halbordnung.de>
* Source/DKBoxingUtils.m:
Add support for NSData conversion in the libclang
introspection generator.
2014-01-09 Niels Grewe <niels.grewe@halbordnung.de>
* Examples/GlobalMenu/GlobalMenuTheme.m:

View File

@ -27,6 +27,7 @@
#import "config.h"
#import <Foundation/NSData.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSException.h>
#import <Foundation/NSFileHandle.h>
@ -621,6 +622,7 @@ DKDBusTypeSignatureForCXType(CXType ty)
// 1 < 1 : NSArray
// 1 < 2 : NSDictionary
// 1 < 3 : NSFileHandle
// 1 < 4 : NSData
char field = 0;
// Prefetch class pointers
@ -628,7 +630,7 @@ DKDBusTypeSignatureForCXType(CXType ty)
Class array = [NSArray class];
Class dict = [NSDictionary class];
Class fd = [NSFileHandle class];
Class data = [NSData class];
// Check whether theClass inherits from one of those:
while ((theClass != Nil) && (0 == field))
{
@ -648,6 +650,10 @@ DKDBusTypeSignatureForCXType(CXType ty)
{
field = 1 < 3;
}
else if (data == theClass)
{
field = 1 < 4;
}
else
{
// Check the superclass next time:
@ -684,6 +690,9 @@ DKDBusTypeSignatureForCXType(CXType ty)
case 8:
DBusType = DBUS_TYPE_UNIX_FD;
break;
case 16:
// NSData is converted to byte arrays on the bus
return @"ay";
default:
break;
}