mirror of
https://github.com/corda/corda.git
synced 2025-01-21 03:55:00 +00:00
implement JNIEnv::NewString()
This commit is contained in:
parent
476a0d70f2
commit
46ac6f92ee
@ -102,6 +102,21 @@ ReleaseStringUTFChars(Thread* t, jstring, const char* chars)
|
|||||||
t->m->system->free(chars);
|
t->m->system->free(chars);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jstring JNICALL
|
||||||
|
NewString(Thread* t, const jchar* chars, jsize size)
|
||||||
|
{
|
||||||
|
ENTER(t, Thread::ActiveState);
|
||||||
|
|
||||||
|
object a = 0;
|
||||||
|
if (size) {
|
||||||
|
object a = makeCharArray(t, size, false);
|
||||||
|
memcpy(&charArrayBody(t, a, 0), chars, size);
|
||||||
|
}
|
||||||
|
object s = makeString(t, a, 0, size, 0);
|
||||||
|
|
||||||
|
return makeLocalReference(t, s);
|
||||||
|
}
|
||||||
|
|
||||||
jstring JNICALL
|
jstring JNICALL
|
||||||
NewStringUTF(Thread* t, const char* chars)
|
NewStringUTF(Thread* t, const char* chars)
|
||||||
{
|
{
|
||||||
@ -1688,6 +1703,7 @@ populateJNITables(JavaVMVTable* vmTable, JNIEnvVTable* envTable)
|
|||||||
envTable->GetStringUTFLength = ::GetStringUTFLength;
|
envTable->GetStringUTFLength = ::GetStringUTFLength;
|
||||||
envTable->GetStringUTFChars = ::GetStringUTFChars;
|
envTable->GetStringUTFChars = ::GetStringUTFChars;
|
||||||
envTable->ReleaseStringUTFChars = ::ReleaseStringUTFChars;
|
envTable->ReleaseStringUTFChars = ::ReleaseStringUTFChars;
|
||||||
|
envTable->NewString = ::NewString;
|
||||||
envTable->NewStringUTF = ::NewStringUTF;
|
envTable->NewStringUTF = ::NewStringUTF;
|
||||||
envTable->FindClass = ::FindClass;
|
envTable->FindClass = ::FindClass;
|
||||||
envTable->ThrowNew = ::ThrowNew;
|
envTable->ThrowNew = ::ThrowNew;
|
||||||
|
Loading…
Reference in New Issue
Block a user