summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-04-09 07:54:44 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-04-18 19:11:41 (GMT)
commite3d2137622cea23298f203801bc698eff08e0ea1 (patch)
treee8d02f3334a6422e25ca5f30606850d960b27cc7 /Swiften/Entity/PayloadPersister.h
parent01385d84f07466550fff702079555c65963463a8 (diff)
downloadswift-e3d2137622cea23298f203801bc698eff08e0ea1.zip
swift-e3d2137622cea23298f203801bc698eff08e0ea1.tar.bz2
Factor out payload persisting into utility classes.
Diffstat (limited to 'Swiften/Entity/PayloadPersister.h')
-rw-r--r--Swiften/Entity/PayloadPersister.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/Swiften/Entity/PayloadPersister.h b/Swiften/Entity/PayloadPersister.h
new file mode 100644
index 0000000..ea7c74c
--- /dev/null
+++ b/Swiften/Entity/PayloadPersister.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2011 Remko Tronçon
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include <boost/shared_ptr.hpp>
+#include <boost/filesystem/path.hpp>
+
+namespace Swift {
+ class Payload;
+ class PayloadSerializer;
+ class PayloadParser;
+
+ class PayloadPersister {
+ public:
+ PayloadPersister();
+ virtual ~PayloadPersister();
+
+ void savePayload(boost::shared_ptr<Payload>, const boost::filesystem::path&);
+ boost::shared_ptr<Payload> loadPayload(const boost::filesystem::path&);
+
+ protected:
+
+ virtual const PayloadSerializer* getSerializer() const = 0;
+ virtual PayloadParser* createParser() const = 0;
+ };
+}