summaryrefslogtreecommitdiff
path: root/src/resources/mapreader.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-30 13:59:45 +0300
committerAndrei Karas <akaras@inbox.ru>2016-01-20 21:58:39 +0300
commitbc3a7cf853510ffe1e42dc683f854d360f6528c7 (patch)
tree9898f13eafc3e1a20388d8d592bfcc05c8f50ba7 /src/resources/mapreader.cpp
parenta058af57bddd4a4394401cc75d33461e17aab8c1 (diff)
downloadplus-bc3a7cf853510ffe1e42dc683f854d360f6528c7.tar.gz
plus-bc3a7cf853510ffe1e42dc683f854d360f6528c7.tar.bz2
plus-bc3a7cf853510ffe1e42dc683f854d360f6528c7.tar.xz
plus-bc3a7cf853510ffe1e42dc683f854d360f6528c7.zip
Add pugixml backend incomplete.
Add some defines for xml nodes manipulation. With pugixml backend no xml writing.
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r--src/resources/mapreader.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 1c9e5af9f..9da094d54 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -614,14 +614,12 @@ bool MapReader::readBase64Layer(const XmlNodePtrConst childNode,
}
// Read base64 encoded map file
- XmlNodePtrConst dataChild = childNode->xmlChildrenNode;
- if (!dataChild)
+ if (!XmlHaveChildContent(childNode))
return true;
- const size_t len = strlen(
- reinterpret_cast<const char*>(dataChild->content)) + 1;
+ const size_t len = strlen(XmlChildContent(childNode)) + 1;
unsigned char *charData = new unsigned char[len + 1];
- xmlChar *const xmlChars = xmlNodeGetContent(dataChild);
+ const char *const xmlChars = XmlChildContent(childNode);
const char *charStart = reinterpret_cast<const char*>(xmlChars);
if (!charStart)
{
@@ -649,7 +647,7 @@ bool MapReader::readBase64Layer(const XmlNodePtrConst childNode,
charData))), &binLen);
delete [] charData;
- xmlFree(xmlChars);
+// XmlFree(const_cast<char*>(xmlChars));
if (binData)
{
@@ -710,11 +708,10 @@ bool MapReader::readCsvLayer(const XmlNodePtrConst childNode,
if (!map || !childNode)
return false;
- XmlNodePtrConst dataChild = childNode->xmlChildrenNode;
- if (!dataChild)
+ if (!XmlHaveChildContent(childNode))
return true;
- xmlChar *const xmlChars = xmlNodeGetContent(dataChild);
+ const char *const xmlChars = XmlChildContent(childNode);
const char *const data = reinterpret_cast<const char*>(xmlChars);
if (!data)
return false;
@@ -747,7 +744,7 @@ bool MapReader::readCsvLayer(const XmlNodePtrConst childNode,
oldPos = pos + 1;
}
- xmlFree(xmlChars);
+ //XmlFree(const_cast<char*>(xmlChars));
return true;
}