diff --git a/src/common/kiwix/searcher.cpp b/src/common/kiwix/searcher.cpp index 1cc2613e5..05e88bcad 100644 --- a/src/common/kiwix/searcher.cpp +++ b/src/common/kiwix/searcher.cpp @@ -34,9 +34,11 @@ namespace kiwix { { template_ct2 = getResourceAsString("results.ct2"); loadICUExternalTables(); - } - + + /* Destructor */ + Searcher::~Searcher() {} + /* Search strings in the database */ void Searcher::search(std::string &search, unsigned int resultStart, unsigned int resultEnd, const bool verbose) { @@ -127,6 +129,8 @@ namespace kiwix { this->contentHumanReadableId = contentHumanReadableId; } +#ifndef __ANDROID__ + string Searcher::getHtml() { SimpleVM oSimpleVM; @@ -203,9 +207,6 @@ namespace kiwix { } - /* Destructor */ - Searcher::~Searcher() { - - } +#endif } diff --git a/src/common/kiwix/searcher.h b/src/common/kiwix/searcher.h index f85fcd13b..f8a2551e2 100644 --- a/src/common/kiwix/searcher.h +++ b/src/common/kiwix/searcher.h @@ -33,14 +33,16 @@ #include #include "unicode/putil.h" +#ifndef __ANDROID__ #include #include #include - #include "kiwix/ctpp2/CTPP2VMStringLoader.hpp" -using namespace std; using namespace CTPP; +#endif + +using namespace std; struct Result { @@ -58,6 +60,7 @@ namespace kiwix { public: Searcher(); + ~Searcher(); void search(std::string &search, unsigned int resultStart, unsigned int resultEnd, const bool verbose=false); @@ -65,11 +68,13 @@ namespace kiwix { unsigned int getEstimatedResultCount(); bool setProtocolPrefix(const std::string prefix); bool setSearchProtocolPrefix(const std::string prefix); - string getHtml(); void reset(); void setContentHumanReadableId(const string &contentHumanReadableId); - ~Searcher(); +#ifndef __ANDROID__ + string getHtml(); +#endif + protected: std::string beautifyInteger(const unsigned int number); virtual void closeIndex() = 0; diff --git a/src/common/kiwix/xapianSearcher.h b/src/common/kiwix/xapianSearcher.h index 3fb24b29e..2f21ed052 100644 --- a/src/common/kiwix/xapianSearcher.h +++ b/src/common/kiwix/xapianSearcher.h @@ -27,10 +27,8 @@ using namespace std; namespace kiwix { - class NoXapianIndexInZim: public exception - { - virtual const char* what() const throw() - { + class NoXapianIndexInZim: public exception { + virtual const char* what() const throw() { return "There is no fulltext index in the zim file"; } }; @@ -39,7 +37,6 @@ namespace kiwix { public: XapianSearcher(const string &xapianDirectoryPath); - void searchInIndex(string &search, const unsigned int resultStart, const unsigned int resultEnd, const bool verbose=false);