Merge "Add jni interface to use on memory dictionary."
This commit is contained in:
commit
68b4f2ada9
2 changed files with 14 additions and 0 deletions
|
@ -151,6 +151,8 @@ public final class BinaryDictionary extends Dictionary {
|
||||||
|
|
||||||
private static native long openNative(String sourceDir, long dictOffset, long dictSize,
|
private static native long openNative(String sourceDir, long dictOffset, long dictSize,
|
||||||
boolean isUpdatable);
|
boolean isUpdatable);
|
||||||
|
private static native long createOnMemoryNative(long formatVersion,
|
||||||
|
String locale, String[] attributeKeyStringArray, String[] attributeValueStringArray);
|
||||||
private static native void getHeaderInfoNative(long dict, int[] outHeaderSize,
|
private static native void getHeaderInfoNative(long dict, int[] outHeaderSize,
|
||||||
int[] outFormatVersion, ArrayList<int[]> outAttributeKeys,
|
int[] outFormatVersion, ArrayList<int[]> outAttributeKeys,
|
||||||
ArrayList<int[]> outAttributeValues);
|
ArrayList<int[]> outAttributeValues);
|
||||||
|
|
|
@ -65,6 +65,13 @@ static jlong latinime_BinaryDictionary_open(JNIEnv *env, jclass clazz, jstring s
|
||||||
return reinterpret_cast<jlong>(dictionary);
|
return reinterpret_cast<jlong>(dictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static jlong latinime_BinaryDictionary_createOnMemory(JNIEnv *env, jclass clazz,
|
||||||
|
jlong formatVersion, jstring locale, jobjectArray attributeKeyStringArray,
|
||||||
|
jobjectArray attributeValueStringArray) {
|
||||||
|
// TODO: Implement.
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void latinime_BinaryDictionary_flush(JNIEnv *env, jclass clazz, jlong dict,
|
static void latinime_BinaryDictionary_flush(JNIEnv *env, jclass clazz, jlong dict,
|
||||||
jstring filePath) {
|
jstring filePath) {
|
||||||
Dictionary *dictionary = reinterpret_cast<Dictionary *>(dict);
|
Dictionary *dictionary = reinterpret_cast<Dictionary *>(dict);
|
||||||
|
@ -467,6 +474,11 @@ static const JNINativeMethod sMethods[] = {
|
||||||
const_cast<char *>("(Ljava/lang/String;JJZ)J"),
|
const_cast<char *>("(Ljava/lang/String;JJZ)J"),
|
||||||
reinterpret_cast<void *>(latinime_BinaryDictionary_open)
|
reinterpret_cast<void *>(latinime_BinaryDictionary_open)
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
const_cast<char *>("createOnMemoryNative"),
|
||||||
|
const_cast<char *>("(JLjava/lang/String;[Ljava/lang/String;[Ljava/lang/String;)J"),
|
||||||
|
reinterpret_cast<void *>(latinime_BinaryDictionary_createOnMemory)
|
||||||
|
},
|
||||||
{
|
{
|
||||||
const_cast<char *>("closeNative"),
|
const_cast<char *>("closeNative"),
|
||||||
const_cast<char *>("(J)V"),
|
const_cast<char *>("(J)V"),
|
||||||
|
|
Loading…
Reference in a new issue