summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/FileTransfer/ReadBytestream.h')
-rw-r--r--Swiften/FileTransfer/ReadBytestream.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/Swiften/FileTransfer/ReadBytestream.h b/Swiften/FileTransfer/ReadBytestream.h
index 4da2bc2..c94e4d3 100644
--- a/Swiften/FileTransfer/ReadBytestream.h
+++ b/Swiften/FileTransfer/ReadBytestream.h
@@ -6,13 +6,26 @@
#pragma once
-#include "Swiften/Base/ByteArray.h"
+#include <boost/shared_ptr.hpp>
+#include <vector>
+
+#include <Swiften/Base/boost_bsignals.h>
namespace Swift {
class ReadBytestream {
public:
virtual ~ReadBytestream();
- virtual ByteArray read(size_t size) = 0;
+
+ /**
+ * Return an empty vector if no more data is available.
+ * Use onDataAvailable signal for signaling there is data available again.
+ */
+ virtual boost::shared_ptr< std::vector<unsigned char> > read(size_t size) = 0;
+
virtual bool isFinished() const = 0;
+
+ public:
+ boost::signal<void ()> onDataAvailable;
+ boost::signal<void (const std::vector<unsigned char>&)> onRead;
};
}