summaryrefslogtreecommitdiff
path: root/src/utils/xml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/xml.cpp')
-rw-r--r--src/utils/xml.cpp25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp
index 8d444fab..9835f88c 100644
--- a/src/utils/xml.cpp
+++ b/src/utils/xml.cpp
@@ -25,12 +25,11 @@
#include "resources/resourcemanager.h"
+#include "utils/zlib.h"
+
#include <libxml/parser.h>
#include <libxml/xmlerror.h>
-#include <fstream>
-#include <iostream>
-
namespace XML
{
static void xmlLogger(void *ctx, xmlErrorPtr error);
@@ -58,25 +57,7 @@ namespace XML
}
else
{
- std::ifstream file;
- file.open(filename.c_str(), std::ios::in);
-
- if (file.is_open())
- {
- // Get length of file
- file.seekg (0, std::ios::end);
- size = file.tellg();
- file.seekg(0, std::ios::beg);
-
- data = (char*) malloc(size);
-
- file.read(data, size);
- file.close();
- }
- else
- {
- logger->log("Error loading XML file %s", filename.c_str());
- }
+ data = (char *) loadCompressedFile(filename, size);
}
if (data)