aboutsummaryrefslogtreecommitdiffstats
path: root/include/data_snk.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-05-18 18:33:19 +0000
committerlloyd <[email protected]>2006-05-18 18:33:19 +0000
commita2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch)
treead3d6c4fcc8dd0f403f8105598943616246fe172 /include/data_snk.h
Initial checkin1.5.6
Diffstat (limited to 'include/data_snk.h')
-rw-r--r--include/data_snk.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/include/data_snk.h b/include/data_snk.h
new file mode 100644
index 000000000..d37a8fa29
--- /dev/null
+++ b/include/data_snk.h
@@ -0,0 +1,46 @@
+/*************************************************
+* DataSink Header File *
+* (C) 1999-2006 The Botan Project *
+*************************************************/
+
+#ifndef BOTAN_DATA_SINK_H__
+#define BOTAN_DATA_SINK_H__
+
+#include <botan/filter.h>
+#include <iosfwd>
+
+namespace Botan {
+
+/*************************************************
+* Generic DataSink Interface *
+*************************************************/
+class DataSink : public Filter
+ {
+ public:
+ bool attachable() { return false; }
+ DataSink() {}
+ virtual ~DataSink() {}
+ private:
+ DataSink& operator=(const DataSink&) { return (*this); }
+ DataSink(const DataSink&);
+ };
+
+/*************************************************
+* Stream-Based DataSink *
+*************************************************/
+class DataSink_Stream : public DataSink
+ {
+ public:
+ void write(const byte[], u32bit);
+ DataSink_Stream(std::ostream&);
+ DataSink_Stream(const std::string&, bool = false);
+ ~DataSink_Stream();
+ private:
+ const std::string fsname;
+ std::ostream* sink;
+ bool owns;
+ };
+
+}
+
+#endif