This commit is contained in:
Adam D. Ruppe 2020-01-09 20:15:51 -05:00
parent 0fed9f70de
commit acf94a0fef
1 changed files with 6 additions and 1 deletions

7
jni.d
View File

@ -568,7 +568,7 @@ void rawClassStructToD()(ref ClassFile cf, string dPackagePrefix, string outputD
mainThing ~= proto;
if(oargs.length == 0 && name == "toString_" && !(method.flags & 0x0008))
mainThing ~= "\toverride string toString() { return toString_(); }\n";
mainThing ~= "\toverride string toString() { return arsd.jni.javaObjectToString(this); }\n";
}
}
@ -1808,6 +1808,11 @@ interface IJavaObject {
enum Export; /// UDA to indicate you are exporting the method to Java. Put a D implementation body on these. Only put these on implementation classes, not interfaces.
}
string javaObjectToString(IJavaObject i) {
return "FIXME";
}
static T fromExistingJavaObject(T)(jobject o) if(is(T : IJavaObject) && !is(T == interface)) {
import core.memory;
auto ptr = GC.malloc(__traits(classInstanceSize, T));