summaryrefslogtreecommitdiff
path: root/includes/SmartWriter.h
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2014-08-10 22:07:42 -0700
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2014-08-10 22:07:42 -0700
commit24c84e9423db42563de21da76efd4637ca2abcce (patch)
tree48045eadcfb48dd200fbc731e3dccb487bf661ca /includes/SmartWriter.h
parentd6fe842fdb0972ffe228022c5705b1b167e68467 (diff)
First pass at the SmartWriter.
Diffstat (limited to 'includes/SmartWriter.h')
-rw-r--r--includes/SmartWriter.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/includes/SmartWriter.h b/includes/SmartWriter.h
new file mode 100644
index 0000000..d8baf27
--- /dev/null
+++ b/includes/SmartWriter.h
@@ -0,0 +1,20 @@
+#pragma once
+
+#include <Handle.h>
+
+class SmartWriterTask;
+
+namespace Balau {
+
+class SmartWriter : public Filter {
+ public:
+ SmartWriter(IO<Handle> h) : Filter(h) { AAssert(h->canWrite(), "SmartWriter can't write"); m_name.set("SmartWriter(%s)", h->getName()); }
+ virtual ssize_t write(const void * buf, size_t count) throw (GeneralException) override;
+ virtual const char * getName() override { return m_name.to_charp(); }
+ virtual void close() override;
+ private:
+ SmartWriterTask * m_writerTask = NULL;
+ String m_name;
+};
+
+}