mirror of
https://github.com/kiwix/java-libkiwix.git
synced 2025-09-13 09:07:48 -04:00
Add method to get value of tag from a book.
Only the `getTagStr` method is available on android because we need a proper exception handling on wrapping side. Fix #298
This commit is contained in:
parent
5c3c637664
commit
ed66344f31
@ -66,4 +66,11 @@ GETTER(jstring, getFavicon)
|
||||
GETTER(jstring, getFaviconUrl)
|
||||
GETTER(jstring, getFaviconMimeType)
|
||||
|
||||
METHOD(jstring, Book, getTagStr, jstring tagName) try {
|
||||
auto cRet = Book->getTagStr(jni2c(tagName, env));
|
||||
return c2jni(cRet, env);
|
||||
} catch(...) {
|
||||
return c2jni<std::string>("", env);
|
||||
}
|
||||
|
||||
#undef GETTER
|
||||
|
@ -20,6 +20,13 @@ public class Book
|
||||
public native String getUrl();
|
||||
public native String getName();
|
||||
public native String getTags();
|
||||
/**
|
||||
* Return the value associated to the tag tagName
|
||||
*
|
||||
* @param tagName the tag name to search for.
|
||||
* @return The value of the tag. If the tag is not found, return empty string.
|
||||
*/
|
||||
public native String getTagStr(String tagName);
|
||||
|
||||
public native long getArticleCount();
|
||||
public native long getMediaCount();
|
||||
|
Loading…
x
Reference in New Issue
Block a user