mirror of https://github.com/kiwix/libkiwix.git
Add `get_zimId` method to Result
get_zimId method allows the user to get the uuid of the archive from which a result is retrieved directly from the search result itself.
This commit is contained in:
parent
7f0d3004c9
commit
c35f6f9142
|
@ -49,6 +49,7 @@ class Result
|
|||
virtual int get_wordCount() = 0;
|
||||
virtual int get_size() = 0;
|
||||
virtual int get_readerIndex() = 0;
|
||||
virtual std::string get_zimId() = 0;
|
||||
};
|
||||
|
||||
struct SearcherInternal;
|
||||
|
|
|
@ -46,6 +46,7 @@ class _Result : public Result
|
|||
virtual int get_wordCount();
|
||||
virtual int get_size();
|
||||
virtual int get_readerIndex();
|
||||
virtual std::string get_zimId();
|
||||
|
||||
private:
|
||||
zim::SearchResultSet::iterator iterator;
|
||||
|
@ -265,6 +266,12 @@ int _Result::get_readerIndex()
|
|||
{
|
||||
return iterator.getFileIndex();
|
||||
}
|
||||
std::string _Result::get_zimId()
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << iterator.getZimId();
|
||||
return s.str();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue