summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/IDN/PlatformIDNConverter.cpp')
-rw-r--r--Swiften/IDN/PlatformIDNConverter.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/Swiften/IDN/PlatformIDNConverter.cpp b/Swiften/IDN/PlatformIDNConverter.cpp
new file mode 100644
index 0000000..6d9cff7
--- /dev/null
+++ b/Swiften/IDN/PlatformIDNConverter.cpp
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2012 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#include <Swiften/IDN/PlatformIDNConverter.h>
+#if defined(HAVE_LIBIDN)
+#include <Swiften/IDN/LibIDNConverter.h>
+#elif defined(HAVE_ICU)
+#include <Swiften/IDN/ICUConverter.h>
+#endif
+
+namespace Swift {
+
+IDNConverter* PlatformIDNConverter::create() {
+#if defined(HAVE_LIBIDN)
+ return new LibIDNConverter();
+#elif defined(HAVE_ICU)
+ return new ICUConverter();
+#else
+#error "No IDN implementation"
+ return 0;
+#endif
+}
+
+}