-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package idl.helper; | ||
|
||
import idl.IDLBase; | ||
|
||
public class IDLStringView extends IDLBase { | ||
|
||
public static IDLStringView TMP_EMPTY_1 = new IDLStringView((byte)0, '0'); | ||
|
||
public static IDLStringView TMP_1 = new IDLStringView(); | ||
public static IDLStringView TMP_2 = new IDLStringView(); | ||
|
||
public static void disposeTEMP() { | ||
TMP_1.dispose(); | ||
TMP_2.dispose(); | ||
} | ||
|
||
public IDLStringView() { | ||
} | ||
|
||
public IDLStringView(byte b, char c) {} | ||
|
||
public String data() { | ||
String text = dataNATIVE(getCPointer()); | ||
return text; | ||
} | ||
|
||
/*[-JNI;-NATIVE] | ||
IDLStringView* nativeObject = (IDLStringView*)this_addr; | ||
const char* str = nativeObject->data(); | ||
jstring jstrBuf = env->NewStringUTF(str); | ||
return jstrBuf; | ||
*/ | ||
/*[-TEAVM;-NATIVE] | ||
var jsObj = [MODULE].wrapPointer(this_addr, [MODULE].IDLStringView); | ||
var returnedJSObj = jsObj.data(); | ||
return returnedJSObj; | ||
*/ | ||
private static native String dataNATIVE(long this_addr); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters