mirror of https://github.com/kiwix/libkiwix.git
Merge branch 'master' of ssh://git.code.sf.net/p/kiwix/kiwix
Conflicts: kiwix/chrome/content/main/js/tools.js
This commit is contained in:
commit
dd76912d72
|
@ -24,7 +24,6 @@
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
typedef uint16_t char16_t;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
|
@ -19,23 +19,6 @@
|
||||||
|
|
||||||
#include "CTPP2VMStringLoader.hpp"
|
#include "CTPP2VMStringLoader.hpp"
|
||||||
|
|
||||||
#include "CTPP2Util.hpp"
|
|
||||||
#include "CTPP2Exception.hpp"
|
|
||||||
#include "CTPP2VMExecutable.hpp"
|
|
||||||
#include "CTPP2VMInstruction.hpp"
|
|
||||||
#include "CTPP2VMMemoryCore.hpp"
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include <resourceTools.h>
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace CTPP // C++ Template Engine
|
namespace CTPP // C++ Template Engine
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,23 @@
|
||||||
#ifndef _CTPP2_VM_STRING_LOADER_HPP__
|
#ifndef _CTPP2_VM_STRING_LOADER_HPP__
|
||||||
#define _CTPP2_VM_STRING_LOADER_HPP__ 1
|
#define _CTPP2_VM_STRING_LOADER_HPP__ 1
|
||||||
|
|
||||||
#include "CTPP2VMLoader.hpp"
|
#include "ctpp2/CTPP2VMLoader.hpp"
|
||||||
|
#include "ctpp2/CTPP2Util.hpp"
|
||||||
|
#include "ctpp2/CTPP2Exception.hpp"
|
||||||
|
#include "ctpp2/CTPP2VMExecutable.hpp"
|
||||||
|
#include "ctpp2/CTPP2VMInstruction.hpp"
|
||||||
|
#include "ctpp2/CTPP2VMMemoryCore.hpp"
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <resourceTools.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@file VMStringLoader.hpp
|
@file VMStringLoader.hpp
|
||||||
|
|
|
@ -375,11 +375,21 @@ namespace kiwix {
|
||||||
return this->getContentByEncodedUrl(url, content, contentLength, contentType);
|
return this->getContentByEncodedUrl(url, content, contentLength, contentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Reader::getContentByEncodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType, string &baseUrl) {
|
||||||
|
return this->getContentByDecodedUrl(kiwix::urlDecode(url), content, contentLength, contentType, baseUrl);
|
||||||
|
}
|
||||||
|
|
||||||
bool Reader::getContentByEncodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType) {
|
bool Reader::getContentByEncodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType) {
|
||||||
return this->getContentByDecodedUrl(kiwix::urlDecode(url), content, contentLength, contentType);
|
std::string stubRedirectUrl;
|
||||||
|
return this->getContentByEncodedUrl(kiwix::urlDecode(url), content, contentLength, contentType, stubRedirectUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Reader::getContentByDecodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType) {
|
bool Reader::getContentByDecodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType) {
|
||||||
|
std::string stubRedirectUrl;
|
||||||
|
return this->getContentByDecodedUrl(kiwix::urlDecode(url), content, contentLength, contentType, stubRedirectUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Reader::getContentByDecodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType, string &baseUrl) {
|
||||||
bool retVal = false;
|
bool retVal = false;
|
||||||
content="";
|
content="";
|
||||||
contentType="";
|
contentType="";
|
||||||
|
@ -411,6 +421,9 @@ namespace kiwix {
|
||||||
article = article.getRedirectArticle();
|
article = article.getRedirectArticle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Compute base url (might be different from the url if redirects */
|
||||||
|
baseUrl = "/" + std::string(1, article.getNamespace()) + "/" + article.getUrl();
|
||||||
|
|
||||||
/* Get the content mime-type */
|
/* Get the content mime-type */
|
||||||
contentType = string(article.getMimeType().data(), article.getMimeType().size());
|
contentType = string(article.getMimeType().data(), article.getMimeType().size());
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,9 @@ namespace kiwix {
|
||||||
bool getFavicon(string &content, string &mimeType);
|
bool getFavicon(string &content, string &mimeType);
|
||||||
bool getPageUrlFromTitle(const string &title, string &url);
|
bool getPageUrlFromTitle(const string &title, string &url);
|
||||||
bool getContentByUrl(const string &url, string &content, unsigned int &contentLength, string &contentType);
|
bool getContentByUrl(const string &url, string &content, unsigned int &contentLength, string &contentType);
|
||||||
|
bool getContentByEncodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType, string &baseUrl);
|
||||||
bool getContentByEncodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType);
|
bool getContentByEncodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType);
|
||||||
|
bool getContentByDecodedUrl(const string &url, string &content, unsigned int &contentLength, string &contentType, string &baseUrl);
|
||||||
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);
|
||||||
|
|
|
@ -32,9 +32,9 @@
|
||||||
#include <pathTools.h>
|
#include <pathTools.h>
|
||||||
#include <stringTools.h>
|
#include <stringTools.h>
|
||||||
|
|
||||||
#include <CDT.hpp>
|
#include <ctpp2/CDT.hpp>
|
||||||
#include <CTPP2FileLogger.hpp>
|
#include <ctpp2/CTPP2FileLogger.hpp>
|
||||||
#include <CTPP2SimpleVM.hpp>
|
#include <ctpp2/CTPP2SimpleVM.hpp>
|
||||||
|
|
||||||
#include "kiwix/ctpp2/CTPP2VMStringLoader.hpp"
|
#include "kiwix/ctpp2/CTPP2VMStringLoader.hpp"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue