summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/VCards/VCardFileStorageFactory.h')
-rw-r--r--Swiften/VCards/VCardFileStorageFactory.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/Swiften/VCards/VCardFileStorageFactory.h b/Swiften/VCards/VCardFileStorageFactory.h
new file mode 100644
index 0000000..136c6a7
--- /dev/null
+++ b/Swiften/VCards/VCardFileStorageFactory.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2010 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include <boost/filesystem.hpp>
+
+#include "Swiften/VCards/VCardStorageFactory.h"
+#include "Swiften/VCards/VCardFileStorage.h"
+
+namespace Swift {
+ class VCardFileStorageFactory : public VCardStorageFactory {
+ public:
+ VCardFileStorageFactory(boost::filesystem::path base) : base(base) {
+ }
+
+ virtual VCardStorage* createVCardStorage(const String& profile) {
+ return new VCardFileStorage(base / profile.getUTF8String());
+ }
+
+ private:
+ boost::filesystem::path base;
+ };
+}