mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-23 03:52:35 -04:00
+ kiwix-serve is now able to read *many* library xml files
This commit is contained in:
parent
db62ff440a
commit
1a2deeac46
@ -58,6 +58,7 @@ typedef int off_t;
|
||||
#include <kiwix/xapianSearcher.h>
|
||||
#include <pathTools.h>
|
||||
#include <regexTools.h>
|
||||
#include <splitString.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -452,11 +453,20 @@ int main(int argc, char **argv) {
|
||||
|
||||
/* Setup the library manager and get the list of books */
|
||||
if (libraryFlag) {
|
||||
try {
|
||||
libraryManager.readFile(libraryPath, true);
|
||||
} catch (...) {
|
||||
cerr << "Unable to open the XML library file '" << libraryPath << "'." << endl;
|
||||
exit(1);
|
||||
vector<string> libraryPaths = split(libraryPath, ":");
|
||||
vector<string>::iterator itr;
|
||||
for ( itr = libraryPaths.begin(); itr != libraryPaths.end(); ++itr ) {
|
||||
bool retVal = false;
|
||||
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)*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user