summaryrefslogtreecommitdiff
path: root/src/utils/xml.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-09 15:43:27 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-09 18:44:03 +0300
commite5726a11424ebd48f12d76149ec7e5e2b6278bdd (patch)
treebdcb9987f4109513a99f3a46e01687babc94a243 /src/utils/xml.cpp
parentb4bdf86b6dd57045bd2d80cfcd5e0a428a5054b3 (diff)
downloadmanaverse-e5726a11424ebd48f12d76149ec7e5e2b6278bdd.tar.gz
manaverse-e5726a11424ebd48f12d76149ec7e5e2b6278bdd.tar.bz2
manaverse-e5726a11424ebd48f12d76149ec7e5e2b6278bdd.tar.xz
manaverse-e5726a11424ebd48f12d76149ec7e5e2b6278bdd.zip
Fix code style.
Diffstat (limited to 'src/utils/xml.cpp')
-rw-r--r--src/utils/xml.cpp14
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;