summaryrefslogtreecommitdiff
path: root/project2/xmlScriptParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'project2/xmlScriptParser.cpp')
-rw-r--r--project2/xmlScriptParser.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/project2/xmlScriptParser.cpp b/project2/xmlScriptParser.cpp
index 6d30d67..9b76316 100644
--- a/project2/xmlScriptParser.cpp
+++ b/project2/xmlScriptParser.cpp
@@ -2,15 +2,7 @@
#include <libxml/xinclude.h>
#include <boost/filesystem/convenience.hpp>
-XmlScriptParser::XmlScriptParser(const std::string & group, const std::string & name, bool ii) :
- IsInclusion(ii),
- loader(true),
- documentParsed(false)
-{
- loadDocument(group + "/" + name + ".xml");
-}
-
-XmlScriptParser::XmlScriptParser(const std::string & file, bool ii) :
+XmlScriptParser::XmlScriptParser(const boost::filesystem::path & file, bool ii) :
IsInclusion(ii),
loader(true),
documentParsed(false)
@@ -19,28 +11,28 @@ XmlScriptParser::XmlScriptParser(const std::string & file, bool ii) :
}
void
-XmlScriptParser::loadDocument(const std::string & file)
+XmlScriptParser::loadDocument(const boost::filesystem::path & file)
{
- loader.supportedStorers.insert(Storer::into(&rowSets));
if (!boost::filesystem::exists(file)) {
if (IsInclusion) {
- throw DependencyNotFound(file);
+ throw DependencyNotFound(file.string());
}
else {
- throw NotFound(file);
+ throw NotFound(file.string());
}
}
try {
- parse_file(file);
+ parse_file(file.string());
}
catch (const xmlpp::internal_error &) {
- throw NotReadable(file);
+ throw NotReadable(file.string());
}
for (int x; (x = xmlXIncludeProcessFlags(get_document()->cobj(), XML_PARSE_NOXINCNODE)); ) {
if (x < 0) {
- throw IncludesError(file);
+ throw IncludesError(file.string());
}
}
+ loader.supportedStorers.insert(Storer::into(&rowSets));
}
void