mirror of https://github.com/kiwix/libkiwix.git
Add Reader::urlExists
This commit is contained in:
parent
c1b5eb42bf
commit
39ad3313df
|
@ -511,6 +511,15 @@ namespace kiwix {
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if an article exists */
|
||||||
|
bool Reader::urlExists(const string &url) {
|
||||||
|
char ns = 0;
|
||||||
|
string titleStr;
|
||||||
|
this->parseUrl(url, &ns, titleStr);
|
||||||
|
zim::File::const_iterator findItr = zimFileHandler->find(ns, titleStr);
|
||||||
|
return findItr->getUrl() == titleStr;
|
||||||
|
}
|
||||||
|
|
||||||
/* Search titles by prefix */
|
/* Search titles by prefix */
|
||||||
bool Reader::searchSuggestions(const string &prefix, unsigned int suggestionsCount, const bool reset) {
|
bool Reader::searchSuggestions(const string &prefix, unsigned int suggestionsCount, const bool reset) {
|
||||||
bool retVal = false;
|
bool retVal = false;
|
||||||
|
|
|
@ -71,6 +71,7 @@ namespace kiwix {
|
||||||
bool getContentByDecodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType);
|
bool getContentByDecodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType);
|
||||||
bool searchSuggestions(const string &prefix, unsigned int suggestionsCount, const bool reset = true);
|
bool searchSuggestions(const string &prefix, unsigned int suggestionsCount, const bool reset = true);
|
||||||
bool searchSuggestionsSmart(const string &prefix, unsigned int suggestionsCount);
|
bool searchSuggestionsSmart(const string &prefix, unsigned int suggestionsCount);
|
||||||
|
bool urlExists(const string &url);
|
||||||
std::vector<std::string> getTitleVariants(const std::string &title);
|
std::vector<std::string> getTitleVariants(const std::string &title);
|
||||||
bool getNextSuggestion(string &title);
|
bool getNextSuggestion(string &title);
|
||||||
bool getNextSuggestion(string &title, string &url);
|
bool getNextSuggestion(string &title, string &url);
|
||||||
|
|
Loading…
Reference in New Issue