Class SearchRenderer

Class Documentation

class kiwix::SearchRenderer

The SearcherRenderer class is used to render a search result to a html page.

Public Functions

SearchRenderer(Searcher *searcher, NameMapper *mapper)

The default constructor.

Parameters

humanReadableName – The global zim’s humanReadableName. Used to generate pagination links.

SearchRenderer(zim::SearchResultSet srs, NameMapper *mapper, unsigned int start, unsigned int estimatedResultCount)
~SearchRenderer()
void setSearchPattern(const std::string &pattern)
void setSearchContent(const std::string &name)

Set the search content id.

void setProtocolPrefix(const std::string &prefix)

Set protocol prefix.

void setSearchProtocolPrefix(const std::string &prefix)

Set search protocol prefix.

inline void setPageLength(unsigned int pageLength)

set result count per page

std::string getHtml()

Generate the html page with the resutls of the search.

Protected Functions

std::string beautifyInteger(const unsigned int number)

Protected Attributes

zim::SearchResultSet m_srs
NameMapper *mp_nameMapper
std::string searchContent
std::string searchPattern
std::string protocolPrefix
std::string searchProtocolPrefix
unsigned int pageLength
unsigned int estimatedResultCount
unsigned int resultStart