Implement ZIM reader getTags() and getName()

This commit is contained in:
Kelson 2016-09-04 20:11:34 +02:00 committed by kelson42
parent fc9f3a3a25
commit 1500cb8329
3 changed files with 18 additions and 0 deletions

View File

@ -104,6 +104,12 @@ namespace kiwix {
if (itr->url.empty())
itr->url = book.url;
if (itr->tags.empty())
itr->tags = book.tags;
if (itr->name.empty())
itr->name = book.name;
if (itr->indexPath.empty()) {
itr->indexPath = book.indexPath;
itr->indexType = book.indexType;

View File

@ -67,6 +67,8 @@ namespace kiwix {
string publisher;
string date;
string url;
string name;
string tags;
string origId;
string articleCount;
string mediaCount;

View File

@ -50,6 +50,8 @@ namespace kiwix {
book.indexPath = bookNode.attribute("indexPath").value();
book.indexType = XAPIAN;
book.title = bookNode.attribute("title").value();
book.name = bookNode.attribute("name").value();
book.tags = bookNode.attribute("tags").value();
book.description = bookNode.attribute("description").value();
book.language = bookNode.attribute("language").value();
book.date = bookNode.attribute("date").value();
@ -159,6 +161,12 @@ namespace kiwix {
if (!itr->title.empty())
bookNode.append_attribute("title") = itr->title.c_str();
if (!itr->name.empty())
bookNode.append_attribute("name") = itr->title.c_str();
if (!itr->tags.empty())
bookNode.append_attribute("tags") = itr->tags.c_str();
if (!itr->description.empty())
bookNode.append_attribute("description") = itr->description.c_str();
@ -262,6 +270,8 @@ namespace kiwix {
book->creator = reader->getCreator();
book->publisher = reader->getPublisher();
book->title = reader->getTitle();
book->name = reader->getName();
book->tags = reader->getTags();
book->origId = reader->getOrigId();
std::ostringstream articleCountStream;
articleCountStream << reader->getArticleCount();