From 8e6f0047d64992b99523d3a6d7350a1c2ee50da0 Mon Sep 17 00:00:00 2001 From: kelson42 Date: Sun, 20 Dec 2009 11:16:25 +0000 Subject: [PATCH] + stub of kiwix-indexer --- src/indexer/kiwix-index.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/indexer/kiwix-index.cpp diff --git a/src/indexer/kiwix-index.cpp b/src/indexer/kiwix-index.cpp new file mode 100644 index 0000000..b0b8d77 --- /dev/null +++ b/src/indexer/kiwix-index.cpp @@ -0,0 +1,26 @@ +#include + +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); +}