Manager::readFile() returns now false if the file can not be found/open/read

This commit is contained in:
kelson42 2012-04-19 08:18:50 +00:00
parent 8f69987929
commit 9c3c3a1f68
1 changed files with 4 additions and 1 deletions

View File

@ -95,11 +95,14 @@ namespace kiwix {
}
bool Manager::readFile(const string path, const bool readOnly) {
bool retVal = true;
pugi::xml_document doc;
pugi::xml_parse_result result = doc.load_file(path.c_str());
if (result) {
this->parseXmlDom(doc, readOnly, path);
} else {
retVal = false;
}
/* This has to be set (although if the file does not exists) to be
@ -109,7 +112,7 @@ namespace kiwix {
this->writableLibraryPath = path;
}
return true;
return retVal;
}
bool Manager::writeFile(const string path) {