mirror of https://github.com/kiwix/libkiwix.git
Add missing implementation of android's getArticleCount and getM… (#282)
Add missing implementation of android's getArticleCount and getMediaCount.
This commit is contained in:
commit
dfd16155af
|
@ -424,6 +424,35 @@ Java_org_kiwix_kiwixlib_JNIKiwixReader_getDescription(JNIEnv* env, jobject obj)
|
||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT jint JNICALL
|
||||||
|
Java_org_kiwix_kiwixlib_JNIKiwixReader_getArticleCount(JNIEnv* env, jobject obj)
|
||||||
|
{
|
||||||
|
jint articleCount = 0;
|
||||||
|
try {
|
||||||
|
auto cArticleCount = READER->getArticleCount();
|
||||||
|
articleCount = c2jni(cArticleCount);
|
||||||
|
} catch (std::exception& e) {
|
||||||
|
__android_log_print(ANDROID_LOG_ERROR, "kiwix", "Unable to get article count.");
|
||||||
|
__android_log_print(ANDROID_LOG_ERROR, "kiwix", e.what());
|
||||||
|
}
|
||||||
|
return articleCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
JNIEXPORT jint JNICALL
|
||||||
|
Java_org_kiwix_kiwixlib_JNIKiwixReader_getMediaCount(JNIEnv* env, jobject obj)
|
||||||
|
{
|
||||||
|
jint mediaCount = 0;
|
||||||
|
try {
|
||||||
|
auto cMediaCount = READER->getMediaCount();
|
||||||
|
mediaCount = c2jni(cMediaCount);
|
||||||
|
} catch (std::exception& e) {
|
||||||
|
__android_log_print(ANDROID_LOG_ERROR, "kiwix", "Unable to get media count.");
|
||||||
|
__android_log_print(ANDROID_LOG_ERROR, "kiwix", e.what());
|
||||||
|
}
|
||||||
|
return mediaCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL Java_org_kiwix_kiwixlib_JNIKiwixReader_getRandomPage(
|
JNIEXPORT jboolean JNICALL Java_org_kiwix_kiwixlib_JNIKiwixReader_getRandomPage(
|
||||||
JNIEnv* env, jobject obj, jobject urlObj)
|
JNIEnv* env, jobject obj, jobject urlObj)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue