mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
+ continue the implementation of ctpp2
This commit is contained in:
@ -74,6 +74,30 @@ namespace kiwix {
|
||||
|
||||
const string Searcher::searchInIndexAndReturnHtml(string &search, const unsigned int resultsCount,
|
||||
const string templatePath, const bool verbose) {
|
||||
|
||||
VMOpcodeCollector oVMOpcodeCollector;
|
||||
StaticText oSyscalls;
|
||||
StaticData oStaticData;
|
||||
StaticText oStaticText;
|
||||
HashTable oHashTable;
|
||||
CTPP2Compiler oCompiler(oVMOpcodeCollector, oSyscalls, oStaticData, oStaticText, oHashTable);
|
||||
|
||||
try
|
||||
{
|
||||
// Load template
|
||||
CTPP2FileSourceLoader oSourceLoader;
|
||||
oSourceLoader.LoadTemplate(search.c_str());
|
||||
|
||||
// Create template parser
|
||||
CTPP2Parser oCTPP2Parser(&oSourceLoader, &oCompiler, search.c_str());
|
||||
|
||||
// Compile template
|
||||
oCTPP2Parser.Compile();
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,15 @@
|
||||
#include <vector>
|
||||
#include <unaccent.h>
|
||||
|
||||
#include <CTPP2Parser.hpp>
|
||||
#include <CTPP2FileSourceLoader.hpp>
|
||||
#include <CTPP2ParserException.hpp>
|
||||
#include <CTPP2HashTable.hpp>
|
||||
#include <CTPP2VMDumper.hpp>
|
||||
#include <CTPP2VMOpcodes.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace CTPP;
|
||||
|
||||
struct Result
|
||||
{
|
||||
|
Reference in New Issue
Block a user