mirror of
https://github.com/kiwix/java-libkiwix.git
synced 2025-09-09 07:08:49 -04:00
Add missing implementation of Searcher setNativeSearcherMulti
This commit is contained in:
parent
6fd7849241
commit
1dd170bd59
@ -47,7 +47,23 @@ METHOD(void, setNativeSearcher, jobject archive)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
METHOD(void, setNativeSearcherMulti, jobjectArray archives)
|
||||
{
|
||||
std::vector<zim::Archive> cArchives;
|
||||
jsize nbArchives = env->GetArrayLength(archives);
|
||||
for(int i=0; i<nbArchives; i++) {
|
||||
jobject archive = env->GetObjectArrayElement(archives, i);
|
||||
auto cArchive = getPtr<zim::Archive>(env, archive);
|
||||
cArchives.push_back(*cArchive);
|
||||
}
|
||||
try {
|
||||
auto searcher = std::make_shared<zim::Searcher>(cArchives);
|
||||
SET_PTR(searcher);
|
||||
} catch (std::exception& e) {
|
||||
LOG("Cannot create searcher");
|
||||
LOG("%s", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
DISPOSE
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user