From 07c62ac076c698cb7d6a4f8ceed616d982421f14 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 12 May 2016 01:02:51 +0300 Subject: Add skipError parameter into xmlutils. --- src/utils/xmlutils.cpp | 30 +++++++++++++++++++++--------- src/utils/xmlutils.h | 8 ++++++-- 2 files changed, 27 insertions(+), 11 deletions(-) (limited to 'src/utils') diff --git a/src/utils/xmlutils.cpp b/src/utils/xmlutils.cpp index 001e46919..fdcc272ec 100644 --- a/src/utils/xmlutils.cpp +++ b/src/utils/xmlutils.cpp @@ -31,10 +31,11 @@ void readXmlIntVector(const std::string &fileName, const std::string §ionName, const std::string &itemName, const std::string &attributeName, - std::vector &arr) + std::vector &arr, + const SkipError skipError) { arr.clear(); - XML::Document doc(fileName, UseResman_true, SkipError_false); + XML::Document doc(fileName, UseResman_true, skipError); const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, rootName.c_str())) @@ -63,8 +64,13 @@ void readXmlIntVector(const std::string &fileName, childNode, "name", ""); if (!name.empty()) { - readXmlIntVector(name, rootName, sectionName, itemName, - attributeName, arr); + readXmlIntVector(name, + rootName, + sectionName, + itemName, + attributeName, + arr, + skipError); } } } @@ -77,9 +83,10 @@ void readXmlStringMap(const std::string &fileName, const std::string &itemName, const std::string &attributeKeyName, const std::string &attributeValueName, - std::map &arr) + std::map &arr, + const SkipError skipError) { - XML::Document doc(fileName, UseResman_true, SkipError_false); + XML::Document doc(fileName, UseResman_true, skipError); const XmlNodePtrConst rootNode = doc.rootNode(); if (!rootNode || !xmlNameEqual(rootNode, rootName.c_str())) @@ -110,9 +117,14 @@ void readXmlStringMap(const std::string &fileName, childNode, "name", ""); if (!name.empty()) { - readXmlStringMap(name, rootName, sectionName, itemName, - attributeKeyName, attributeValueName, - arr); + readXmlStringMap(name, + rootName, + sectionName, + itemName, + attributeKeyName, + attributeValueName, + arr, + skipError); } } } diff --git a/src/utils/xmlutils.h b/src/utils/xmlutils.h index 95ae1e562..928519267 100644 --- a/src/utils/xmlutils.h +++ b/src/utils/xmlutils.h @@ -21,6 +21,8 @@ #ifndef UTILS_XMLUTILS_H #define UTILS_XMLUTILS_H +#include "enums/simpletypes/skiperror.h" + #include #include #include @@ -30,7 +32,8 @@ void readXmlIntVector(const std::string &fileName, const std::string §ionName, const std::string &itemName, const std::string &attributeName, - std::vector &arr); + std::vector &arr, + const SkipError skipError); void readXmlStringMap(const std::string &fileName, const std::string &rootName, @@ -38,6 +41,7 @@ void readXmlStringMap(const std::string &fileName, const std::string &itemName, const std::string &attributeKeyName, const std::string &attributeValueName, - std::map &arr); + std::map &arr, + const SkipError skipError); #endif // UTILS_XMLUTILS_H -- cgit v1.2.3-70-g09d2