+ continue the implementation of ctpp2

This commit is contained in:
kelson42 2011-03-14 21:39:45 +00:00
parent 045717117e
commit 519eebccd2
2 changed files with 32 additions and 0 deletions

View File

@ -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 "";
}

View File

@ -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
{