mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
+ load the result template automaticaly from the skin directory
This commit is contained in:
@ -23,7 +23,8 @@ namespace kiwix {
|
||||
|
||||
/* Constructor */
|
||||
Searcher::Searcher() :
|
||||
estimatedResultCount(0) {
|
||||
estimatedResultCount(0),
|
||||
resultTemplatePath("") {
|
||||
}
|
||||
|
||||
/* Search strings in the database */
|
||||
@ -78,9 +79,14 @@ namespace kiwix {
|
||||
return retVal;
|
||||
}
|
||||
|
||||
const bool Searcher::setResultTemplatePath(const std::string path) {
|
||||
this->resultTemplatePath = path;
|
||||
return true;
|
||||
}
|
||||
|
||||
const string Searcher::getHtml() {
|
||||
|
||||
const STLW::string & sSourceFile = "/var/www/kiwix/moulinkiwix/templates/results.tmpl";
|
||||
const STLW::string & sSourceFile = this->resultTemplatePath;
|
||||
VMOpcodeCollector oVMOpcodeCollector;
|
||||
StaticText oSyscalls;
|
||||
StaticData oStaticData;
|
||||
|
@ -62,8 +62,9 @@ namespace kiwix {
|
||||
void search(std::string &search, const unsigned int resultsCount, const bool verbose=false);
|
||||
bool getNextResult(string &url, string &title, unsigned int &score);
|
||||
const unsigned int getEstimatedResultCount();
|
||||
void reset();
|
||||
const bool setResultTemplatePath(const std::string path);
|
||||
const string getHtml();
|
||||
void reset();
|
||||
|
||||
protected:
|
||||
virtual void closeIndex() = 0;
|
||||
@ -71,6 +72,7 @@ namespace kiwix {
|
||||
|
||||
std::vector<Result> results;
|
||||
std::vector<Result>::iterator resultOffset;
|
||||
std::string resultTemplatePath;
|
||||
unsigned int estimatedResultCount;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user