Merge pull request #316 from kiwix/tagging_system

Tagging system
This commit is contained in:
Matthieu Gautier 2020-01-30 18:21:28 +01:00 committed by GitHub
commit 0cf2cedfdf
2 changed files with 16 additions and 0 deletions

View File

@ -58,6 +58,7 @@ GETTER(jstring, getPublisher)
GETTER(jstring, getDate) GETTER(jstring, getDate)
GETTER(jstring, getUrl) GETTER(jstring, getUrl)
GETTER(jstring, getName) GETTER(jstring, getName)
GETTER(jstring, getFlavour)
GETTER(jstring, getTags) GETTER(jstring, getTags)
GETTER(jlong, getArticleCount) GETTER(jlong, getArticleCount)
GETTER(jlong, getMediaCount) GETTER(jlong, getMediaCount)
@ -66,4 +67,11 @@ GETTER(jstring, getFavicon)
GETTER(jstring, getFaviconUrl) GETTER(jstring, getFaviconUrl)
GETTER(jstring, getFaviconMimeType) 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 #undef GETTER

View File

@ -19,7 +19,15 @@ public class Book
public native String getDate(); public native String getDate();
public native String getUrl(); public native String getUrl();
public native String getName(); public native String getName();
public native String getFlavour();
public native String getTags(); 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 getArticleCount();
public native long getMediaCount(); public native long getMediaCount();