3
0
Fork 0

+ kiwix-serve is now able to read *many* library xml files

small_fixes
kelson42 14 years ago
parent db62ff440a
commit 1a2deeac46

@ -58,6 +58,7 @@ typedef int off_t;
#include <kiwix/xapianSearcher.h> #include <kiwix/xapianSearcher.h>
#include <pathTools.h> #include <pathTools.h>
#include <regexTools.h> #include <regexTools.h>
#include <splitString.h>
using namespace std; using namespace std;
@ -452,11 +453,20 @@ int main(int argc, char **argv) {
/* Setup the library manager and get the list of books */ /* Setup the library manager and get the list of books */
if (libraryFlag) { if (libraryFlag) {
try { vector<string> libraryPaths = split(libraryPath, ":");
libraryManager.readFile(libraryPath, true); vector<string>::iterator itr;
} catch (...) { for ( itr = libraryPaths.begin(); itr != libraryPaths.end(); ++itr ) {
cerr << "Unable to open the XML library file '" << libraryPath << "'." << endl; bool retVal = false;
exit(1); try {
retVal = libraryManager.readFile(*itr, true);
} catch (...) {
retVal = false;
}
if (!retVal) {
cerr << "Unable to open the XML library file '" << *itr << "'." << endl;
exit(1);
}
} }
/* Check if the library is not empty (or only remote books)*/ /* Check if the library is not empty (or only remote books)*/

Loading…
Cancel
Save