Skip to content

Commit 6fd7849

Browse files
committed
Fix implementation of method in Archive.
A lot of methods are overloaded, so we must include the argument type in the name.
1 parent 775b55c commit 6fd7849

1 file changed

Lines changed: 17 additions & 22 deletions

File tree

lib/src/main/cpp/libzim/archive.cpp

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -146,54 +146,49 @@ METHOD(jboolean, hasIllustration, jint size) {
146146

147147
GETTER(jlongArray, getIllustrationSizes)
148148

149-
METHOD(jobject, getEntryByPath, jlong index) {
150-
return BUILD_WRAPPER("org/kiwix/libzim/Entry", THIS->getEntryByPath(TO_C(index)));
151-
}
152-
153-
METHOD(jobject, getEntryByPath, jstring path) {
149+
METHOD(jobject, getEntryByPath__Ljava_lang_String_2, jstring path) {
154150
return BUILD_WRAPPER("org/kiwix/libzim/Entry", THIS->getEntryByPath(TO_C(path)));
155151
}
156152

157-
METHOD(jobject, getEntryByTitle, jlong index) {
158-
return BUILD_WRAPPER("org/kiwix/libzim/Entry", THIS->getEntryByTitle(TO_C(index)));
153+
METHOD(jobject, getEntryByPath__I, jint index) {
154+
return BUILD_WRAPPER("org/kiwix/libzim/Entry", THIS->getEntryByPath(TO_C(index)));
159155
}
160156

161-
METHOD(jobject, getEntryByTitle, jstring title) {
162-
return BUILD_WRAPPER("org/kiwix/libzim/Entry", THIS->getEntryByTitle(TO_C(title)));
157+
METHOD(jboolean, hasEntryByPath, jstring path) {
158+
return TO_JNI(THIS->hasEntryByPath(TO_C(path)));
163159
}
164160

165-
METHOD(jobject, getEntryByClusterOrder, jlong index) {
166-
return BUILD_WRAPPER("org/kiwix/libzim/Entry", THIS->getEntryByClusterOrder(TO_C(index)));
161+
METHOD(jobject, getEntryByTitle__Ljava_lang_String_2, jstring title) {
162+
return BUILD_WRAPPER("org/kiwix/libzim/Entry", THIS->getEntryByTitle(TO_C(title)));
167163
}
168164

169-
METHOD0(jobject, getMainEntry) {
170-
return BUILD_WRAPPER("org/kiwix/libzim/Entry", THIS->getMainEntry());
165+
METHOD(jobject, getEntryByTitle__I, jint index) {
166+
return BUILD_WRAPPER("org/kiwix/libzim/Entry", THIS->getEntryByTitle(TO_C(index)));
171167
}
172168

173-
METHOD0(jobject, getRandomEntry) {
174-
return BUILD_WRAPPER("org/kiwix/libzim/Entry", THIS->getRandomEntry());
169+
METHOD(jboolean, hasEntryByTitle, jstring title) {
170+
return TO_JNI(THIS->hasEntryByPath(TO_C(title)));
175171
}
176172

177-
METHOD(jboolean, hasEntryByPath, jstring path) {
178-
return TO_JNI(THIS->hasEntryByPath(TO_C(path)));
173+
METHOD(jobject, getEntryByClusterOrder, jint index) {
174+
return BUILD_WRAPPER("org/kiwix/libzim/Entry", THIS->getEntryByClusterOrder(TO_C(index)));
179175
}
180176

181-
METHOD(jboolean, hasEntryByTitle, jstring title) {
182-
return TO_JNI(THIS->hasEntryByPath(TO_C(title)));
177+
METHOD0(jobject, getMainEntry) {
178+
return BUILD_WRAPPER("org/kiwix/libzim/Entry", THIS->getMainEntry());
183179
}
184180

185181
GETTER(jboolean, hasMainEntry)
186182

187-
METHOD(jboolean, hasIllustration, jlong size) {
188-
return TO_JNI(THIS->hasIllustration(TO_C(size)));
183+
METHOD0(jobject, getRandomEntry) {
184+
return BUILD_WRAPPER("org/kiwix/libzim/Entry", THIS->getRandomEntry());
189185
}
190186

191187
GETTER(jboolean, hasFulltextIndex)
192188
GETTER(jboolean, hasTitleIndex)
193189
GETTER(jboolean, hasChecksum)
194190
GETTER(jstring, getChecksum)
195191
GETTER(jboolean, check)
196-
197192
GETTER(jboolean, isMultiPart)
198193
GETTER(jboolean, hasNewNamespaceScheme)
199194

0 commit comments

Comments
 (0)