Mercurial > projects > dwt-linux
comparison dwt/dnd/URLTransfer.d @ 255:5a30aa9820f3
removed tango.stdc.stringz imports and allow null for arrays and string arguments.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 15 Jun 2008 22:32:20 +0200 |
parents | ce446666f5a2 |
children | c0d810de7093 |
comparison
equal
deleted
inserted
replaced
254:8bca790583c3 | 255:5a30aa9820f3 |
---|---|
94 */ | 94 */ |
95 public Object nativeToJava(TransferData transferData){ | 95 public Object nativeToJava(TransferData transferData){ |
96 if (!isSupportedType(transferData) || transferData.pValue is null) return null; | 96 if (!isSupportedType(transferData) || transferData.pValue is null) return null; |
97 int size = (transferData.format * transferData.length / 8); | 97 int size = (transferData.format * transferData.length / 8); |
98 if (size <= 0) return null; | 98 if (size <= 0) return null; |
99 String string = tango.stdc.stringz.fromStringz(cast(char*)transferData.pValue).dup; | 99 String string = fromStringz(cast(char*)transferData.pValue).dup; |
100 int end = string.indexOf('\0'); | 100 int end = string.indexOf('\0'); |
101 return new ArrayWrapperString((end is -1) ? string : string.substring(0, end)); | 101 return new ArrayWrapperString((end is -1) ? string : string.substring(0, end)); |
102 } | 102 } |
103 | 103 |
104 protected int[] getTypeIds(){ | 104 protected int[] getTypeIds(){ |