aboutsummaryrefslogtreecommitdiff
path: root/XMLParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'XMLParser.cpp')
-rw-r--r--XMLParser.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/XMLParser.cpp b/XMLParser.cpp
index 4bfde46..6252be8 100644
--- a/XMLParser.cpp
+++ b/XMLParser.cpp
@@ -4,18 +4,11 @@
#include "XMLParser.h"
#include "Exception.h"
-#include "ParserFactory.h"
-#include "TileData.h"
using namespace std;
-XMLParser XMLParser::instance {};
-XMLParser::XMLParser() {
- ParserFactory::register_strategy(this);
-}
-
-unsigned int XMLParser::heuristic(FileReader & f) {
- const string content = f.read();
+unsigned int XMLParser::heuristic() {
+ const string content = this->get_file().read();
int open_backets = 0;
int close_brackets = 0;
for (char c : content) {
@@ -27,10 +20,10 @@ unsigned int XMLParser::heuristic(FileReader & f) {
return (open_backets + close_brackets) / penalty;
}
-void XMLParser::parse(FileReader & f, MuseumDeserializer & d) {
+void XMLParser::parse(MuseumDeserializer & d) {
using namespace pugi;
- const string content = f.read();
+ const string content = this->get_file().read();
xml_document doc;
xml_parse_result result = doc.load_string(content.c_str());
if (!result)