JNIKiwixReader ctor taking a file descriptor

... and a corresponding unit test
This commit is contained in:
Veloman Yunkan
2020-11-29 23:38:34 +04:00
committed by Emmanuel Engelhart
parent 98d69ef59b
commit 4d23e44de7
5 changed files with 69 additions and 1 deletions

View File

@@ -86,6 +86,15 @@ Reader::Reader(const string zimFilePath)
srand(time(nullptr));
}
Reader::Reader(int fd)
: zimArchive(new zim::Archive(fd)),
zimFilePath("")
{
/* initialize random seed: */
srand(time(nullptr));
}
zim::Archive* Reader::getZimArchive() const
{
return zimArchive.get();