mirror of https://github.com/kiwix/libkiwix.git
Manager::readFile() returns now false if the file can not be found/open/read
This commit is contained in:
parent
8f69987929
commit
9c3c3a1f68
|
@ -95,11 +95,14 @@ namespace kiwix {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Manager::readFile(const string path, const bool readOnly) {
|
bool Manager::readFile(const string path, const bool readOnly) {
|
||||||
|
bool retVal = true;
|
||||||
pugi::xml_document doc;
|
pugi::xml_document doc;
|
||||||
pugi::xml_parse_result result = doc.load_file(path.c_str());
|
pugi::xml_parse_result result = doc.load_file(path.c_str());
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
this->parseXmlDom(doc, readOnly, path);
|
this->parseXmlDom(doc, readOnly, path);
|
||||||
|
} else {
|
||||||
|
retVal = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This has to be set (although if the file does not exists) to be
|
/* This has to be set (although if the file does not exists) to be
|
||||||
|
@ -109,7 +112,7 @@ namespace kiwix {
|
||||||
this->writableLibraryPath = path;
|
this->writableLibraryPath = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Manager::writeFile(const string path) {
|
bool Manager::writeFile(const string path) {
|
||||||
|
|
Loading…
Reference in New Issue