diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-09 15:43:27 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-09 18:44:03 +0300 |
commit | e5726a11424ebd48f12d76149ec7e5e2b6278bdd (patch) | |
tree | bdcb9987f4109513a99f3a46e01687babc94a243 /src/utils/xml.cpp | |
parent | b4bdf86b6dd57045bd2d80cfcd5e0a428a5054b3 (diff) | |
download | manaplus-e5726a11424ebd48f12d76149ec7e5e2b6278bdd.tar.gz manaplus-e5726a11424ebd48f12d76149ec7e5e2b6278bdd.tar.bz2 manaplus-e5726a11424ebd48f12d76149ec7e5e2b6278bdd.tar.xz manaplus-e5726a11424ebd48f12d76149ec7e5e2b6278bdd.zip |
Fix code style.
Diffstat (limited to 'src/utils/xml.cpp')
-rw-r--r-- | src/utils/xml.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index eae3567ef..099457af3 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -79,7 +79,8 @@ static void xmlErrorLogger(void *ctx A_UNUSED, const char *msg, ...) namespace XML { Document::Document(const std::string &filename, const bool useResman) : - mDoc(nullptr) + mDoc(nullptr), + mIsValid(false) { #ifdef USE_FUZZER if (Fuzzer::conditionTerminate(filename.c_str())) @@ -134,7 +135,8 @@ namespace XML } Document::Document(const char *const data, const int size) : - mDoc(data ? xmlParseMemory(data, size) : nullptr) + mDoc(data ? xmlParseMemory(data, size) : nullptr), + mIsValid(true) { } @@ -241,7 +243,7 @@ namespace XML return def; } - XmlNodePtr findFirstChildByName(const XmlNodePtr parent, + XmlNodePtr findFirstChildByName(const XmlNodePtrConst parent, const char *const name) { for_each_xml_child_node(child, parent) @@ -272,11 +274,11 @@ namespace XML bool Document::validateXml(const std::string &fileName) { - xmlDocPtr doc = xmlReadFile(fileName.c_str(), + const xmlDocPtr doc = xmlReadFile(fileName.c_str(), nullptr, XML_PARSE_PEDANTIC); - const bool valid(doc); + const bool valid1(doc); xmlFreeDoc(doc); - if (!valid) + if (!valid1) return false; std::ifstream file; |