summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/PlatformXMLParserFactory.cpp')
-rw-r--r--Swiften/Parser/PlatformXMLParserFactory.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/Swiften/Parser/PlatformXMLParserFactory.cpp b/Swiften/Parser/PlatformXMLParserFactory.cpp
new file mode 100644
index 0000000..14557d1
--- /dev/null
+++ b/Swiften/Parser/PlatformXMLParserFactory.cpp
@@ -0,0 +1,28 @@
+#include "Swiften/Parser/PlatformXMLParserFactory.h"
+
+#include <cassert>
+
+#ifdef HAVE_SWIFTEN_CONFIG_H
+#include "Swiften/config.h"
+#endif
+#ifdef HAVE_LIBXML
+#include "Swiften/Parser/LibXMLParser.h"
+#else
+#include "Swiften/Parser/ExpatParser.h"
+#endif
+
+
+namespace Swift {
+
+PlatformXMLParserFactory::PlatformXMLParserFactory() {
+}
+
+XMLParser* PlatformXMLParserFactory::createXMLParser(XMLParserClient* client) {
+#ifdef HAVE_LIBXML
+ return new LibXMLParser(client);
+#else
+ return new ExpatParser(client);
+#endif
+}
+
+}