diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/xml.cpp | 6 | ||||
-rw-r--r-- | src/utils/xml.h | 3 | ||||
-rw-r--r-- | src/utils/xmlutils.cpp | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index 179216b12..1cdb4678b 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -77,7 +77,9 @@ static void xmlErrorLogger(void *ctx A_UNUSED, const char *msg, ...) namespace XML { - Document::Document(const std::string &filename, const bool useResman) : + Document::Document(const std::string &filename, + const bool useResman, + const bool skipError) : mDoc(nullptr), mIsValid(false) { @@ -125,7 +127,7 @@ namespace XML if (!mDoc) logger->log("Error parsing XML file %s", filename.c_str()); } - else + else if (!skipError) { logger->log("Error loading %s", filename.c_str()); } diff --git a/src/utils/xml.h b/src/utils/xml.h index dd06f8df1..41e11c6b6 100644 --- a/src/utils/xml.h +++ b/src/utils/xml.h @@ -66,7 +66,8 @@ namespace XML * resource manager. Logs errors. */ explicit Document(const std::string &filename, - const bool useResman); + const bool useResman, + const bool skipError); /** * Constructor that attempts to load an XML document from memory. diff --git a/src/utils/xmlutils.cpp b/src/utils/xmlutils.cpp index 2e4a7d736..7c370dda0 100644 --- a/src/utils/xmlutils.cpp +++ b/src/utils/xmlutils.cpp @@ -34,7 +34,7 @@ void readXmlIntVector(const std::string &fileName, std::vector<int> &arr) { arr.clear(); - XML::Document doc(fileName, true); + XML::Document doc(fileName, true, false); const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, rootName.c_str())) |