Adapt kiwix-lib to the new libzim api.

This commit is contained in:
Matthieu Gautier
2020-07-23 12:03:45 +02:00
parent d87079ec13
commit 1a5a2e7a8e
17 changed files with 186 additions and 447 deletions

View File

@ -21,10 +21,8 @@
#define KIWIX_READER_H
#include <stdio.h>
#include <zim/article.h>
#include <zim/file.h>
#include <zim/fileiterator.h>
#include <zim/zim.h>
#include <zim/archive.h>
#include <exception>
#include <map>
#include <sstream>
@ -58,7 +56,7 @@ class Reader
* (.zim extesion).
*/
Reader(const string zimFilePath);
~Reader();
~Reader() = default;
/**
* Get the number of "displayable" entries in the zim file.
@ -110,13 +108,6 @@ class Reader
*/
Entry getRandomPage() const;
/**
* Get the entry of the first page.
*
* @return The first entry in the 'A' namespace.
*/
Entry getFirstPage() const;
/**
* Get the entry of the main page.
*
@ -455,14 +446,10 @@ class Reader
*
* @return The libzim file handler.
*/
zim::File* getZimFileHandler() const;
zim::Archive* getZimArchive() const;
protected:
zim::File* zimFileHandler;
zim::size_type firstArticleOffset;
zim::size_type lastArticleOffset;
zim::size_type nsACount;
zim::size_type nsICount;
std::unique_ptr<zim::Archive> zimArchive;
std::string zimFilePath;
SuggestionsList_t suggestions;