summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/FileTransfer/WriteBytestream.h')
-rw-r--r--Swiften/FileTransfer/WriteBytestream.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/Swiften/FileTransfer/WriteBytestream.h b/Swiften/FileTransfer/WriteBytestream.h
index 6085e78..5452317 100644
--- a/Swiften/FileTransfer/WriteBytestream.h
+++ b/Swiften/FileTransfer/WriteBytestream.h
@@ -1,26 +1,33 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <vector>
+#include <boost/signals2.hpp>
+
#include <Swiften/Base/API.h>
-#include <Swiften/Base/boost_bsignals.h>
namespace Swift {
- class SWIFTEN_API WriteBytestream {
- public:
- typedef boost::shared_ptr<WriteBytestream> ref;
+ class SWIFTEN_API WriteBytestream {
+ public:
+ typedef std::shared_ptr<WriteBytestream> ref;
- virtual ~WriteBytestream();
+ virtual ~WriteBytestream();
- virtual void write(const std::vector<unsigned char>&) = 0;
+ /**
+ * Write data from vector argument to bytestream.
+ *
+ * On success true is returned and \ref onWrite is called. On failure false is returned.
+ */
+ virtual bool write(const std::vector<unsigned char>&) = 0;
+ virtual void close() {}
- boost::signal<void (const std::vector<unsigned char>&)> onWrite;
- };
+ boost::signals2::signal<void (const std::vector<unsigned char>&)> onWrite;
+ };
}