+ stub of kiwix-indexer

This commit is contained in:
kelson42 2009-12-20 11:16:25 +00:00
parent 2adde00b01
commit 8e6f0047d6

View File

@ -0,0 +1,26 @@
#include <kiwix/indexer.h>
int main(int argc, char **argv) {
/* Check if we have enough arguments */
if (argc < 3) {
cout << "Usage: kiwix-index ZIM_PATH INDEX_PATH" << endl;
exit(1);
}
/* Init the variables */
char *zimFilePath = argv[1];
char *xapianDirectoryPath = argv[2];
kiwix::Indexer *indexer = new kiwix::Indexer(zimFilePath, xapianDirectoryPath);
/* Start the indexing */
if (indexer != NULL) {
indexer->startIndexing();
while (indexer->indexNextPercent()) {};
} else {
cout << "Unable to start the indexation process" << endl;
exit(1);
}
exit(0);
}