mirror of https://github.com/kiwix/libkiwix.git
Implement ZIM reader getTags() and getName()
This commit is contained in:
parent
fc9f3a3a25
commit
1500cb8329
|
@ -103,6 +103,12 @@ namespace kiwix {
|
||||||
|
|
||||||
if (itr->url.empty())
|
if (itr->url.empty())
|
||||||
itr->url = book.url;
|
itr->url = book.url;
|
||||||
|
|
||||||
|
if (itr->tags.empty())
|
||||||
|
itr->tags = book.tags;
|
||||||
|
|
||||||
|
if (itr->name.empty())
|
||||||
|
itr->name = book.name;
|
||||||
|
|
||||||
if (itr->indexPath.empty()) {
|
if (itr->indexPath.empty()) {
|
||||||
itr->indexPath = book.indexPath;
|
itr->indexPath = book.indexPath;
|
||||||
|
|
|
@ -67,6 +67,8 @@ namespace kiwix {
|
||||||
string publisher;
|
string publisher;
|
||||||
string date;
|
string date;
|
||||||
string url;
|
string url;
|
||||||
|
string name;
|
||||||
|
string tags;
|
||||||
string origId;
|
string origId;
|
||||||
string articleCount;
|
string articleCount;
|
||||||
string mediaCount;
|
string mediaCount;
|
||||||
|
|
|
@ -50,6 +50,8 @@ namespace kiwix {
|
||||||
book.indexPath = bookNode.attribute("indexPath").value();
|
book.indexPath = bookNode.attribute("indexPath").value();
|
||||||
book.indexType = XAPIAN;
|
book.indexType = XAPIAN;
|
||||||
book.title = bookNode.attribute("title").value();
|
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.description = bookNode.attribute("description").value();
|
||||||
book.language = bookNode.attribute("language").value();
|
book.language = bookNode.attribute("language").value();
|
||||||
book.date = bookNode.attribute("date").value();
|
book.date = bookNode.attribute("date").value();
|
||||||
|
@ -158,6 +160,12 @@ namespace kiwix {
|
||||||
if (itr->origId.empty()) {
|
if (itr->origId.empty()) {
|
||||||
if (!itr->title.empty())
|
if (!itr->title.empty())
|
||||||
bookNode.append_attribute("title") = itr->title.c_str();
|
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())
|
if (!itr->description.empty())
|
||||||
bookNode.append_attribute("description") = itr->description.c_str();
|
bookNode.append_attribute("description") = itr->description.c_str();
|
||||||
|
@ -262,6 +270,8 @@ namespace kiwix {
|
||||||
book->creator = reader->getCreator();
|
book->creator = reader->getCreator();
|
||||||
book->publisher = reader->getPublisher();
|
book->publisher = reader->getPublisher();
|
||||||
book->title = reader->getTitle();
|
book->title = reader->getTitle();
|
||||||
|
book->name = reader->getName();
|
||||||
|
book->tags = reader->getTags();
|
||||||
book->origId = reader->getOrigId();
|
book->origId = reader->getOrigId();
|
||||||
std::ostringstream articleCountStream;
|
std::ostringstream articleCountStream;
|
||||||
articleCountStream << reader->getArticleCount();
|
articleCountStream << reader->getArticleCount();
|
||||||
|
|
Loading…
Reference in New Issue