Reorder methods' definitions.

For better comparaison with the generated header.
This commit is contained in:
Matthieu Gautier 2023-01-24 15:12:15 +01:00
parent fe1de03b23
commit 28f0acde24
2 changed files with 26 additions and 9 deletions

View File

@ -47,21 +47,43 @@ METHOD(void, update__Lorg_kiwix_libkiwix_JNIKiwixReader_2, jobject archive)
}
GETTER(jstring, getId)
GETTER(jstring, getPath)
GETTER(jboolean, isPathValid)
GETTER(jstring, getTitle)
GETTER(jstring, getDescription)
GETTER(jstring, getLanguage)
GETTER(jstring, getCreator)
GETTER(jstring, getPublisher)
GETTER(jstring, getDate)
GETTER(jstring, getUrl)
GETTER(jstring, getName)
GETTER(jstring, getFlavour)
GETTER(jstring, getCategory)
GETTER(jstring, getTags)
METHOD(jstring, getTagStr, jstring tagName) try {
return TO_JNI(THIS->getTagStr(TO_C(tagName)));
} catch(...) {
return c2jni<std::string>("", env);
}
GETTER(jlong, getArticleCount)
GETTER(jlong, getMediaCount)
GETTER(jlong, getSize)
METHOD0(jobjectArray, getIllustrations) {
@ -78,8 +100,3 @@ METHOD0(jobjectArray, getIllustrations) {
METHOD(jobject, getIllustration, jint size) {
return BUILD_WRAPPER("org/kiwix/libkiwix/Illustration", THIS->getIllustration(TO_C(size)));
}
METHOD(jstring, getTagStr, jstring tagName) try {
return TO_JNI(THIS->getTagStr(TO_C(tagName)));
} catch(...) {
return c2jni<std::string>("", env);
}

View File

@ -70,13 +70,13 @@ METHOD(jint, getBookCount, jboolean localBooks, jboolean remoteBooks) {
}
GETTER(jobjectArray, getBooksIds)
GETTER(jobjectArray, getBooksLanguages)
GETTER(jobjectArray, getBooksCategories)
GETTER(jobjectArray, getBooksCreators)
GETTER(jobjectArray, getBooksPublishers)
METHOD(jobjectArray, filter, jobject filterObj) {
auto filter = getPtr<kiwix::Filter>(env, filterObj);
return c2jni(THIS->filter(*filter), env);
}
GETTER(jobjectArray, getBooksLanguages)
GETTER(jobjectArray, getBooksCategories)
GETTER(jobjectArray, getBooksCreators)
GETTER(jobjectArray, getBooksPublishers)