summaryrefslogtreecommitdiffstats
path: root/libmail/autodecoder.H
diff options
context:
space:
mode:
authorSam Varshavchik2013-08-19 16:39:41 -0400
committerSam Varshavchik2013-08-25 14:43:51 -0400
commit9c45d9ad13fdf439d44d7443ae75da15ea0223ed (patch)
tree7a81a04cb51efb078ee350859a64be2ebc6b8813 /libmail/autodecoder.H
parenta9520698b770168d1f33d6301463bb70a19655ec (diff)
downloadcourier-libs-9c45d9ad13fdf439d44d7443ae75da15ea0223ed.tar.bz2
Initial checkin
Imported from subversion report, converted to git. Updated all paths in scripts and makefiles, reflecting the new directory hierarchy.
Diffstat (limited to 'libmail/autodecoder.H')
-rw-r--r--libmail/autodecoder.H62
1 files changed, 62 insertions, 0 deletions
diff --git a/libmail/autodecoder.H b/libmail/autodecoder.H
new file mode 100644
index 0000000..d8d59ec
--- /dev/null
+++ b/libmail/autodecoder.H
@@ -0,0 +1,62 @@
+/*
+** Copyright 2002, Double Precision Inc.
+**
+** See COPYING for distribution information.
+*/
+#ifndef libmail_autodecoder_H
+#define libmail_autodecoder_H
+
+#include "decoder.H"
+#include "base64.H"
+#include "qp.H"
+#include "namespace.H"
+
+//
+// Generic MIME decoder. A mail::decoder subclass that uses either base64
+// or qp, where appropriate.
+
+LIBMAIL_START
+
+class autodecoder : public decoder {
+
+ // Declare both base64 and qp decoding members.
+
+ class base64 : public decodebase64 {
+
+ autodecoder &me;
+
+ public:
+ base64(autodecoder &meArg);
+ ~base64();
+ private:
+ void decoded(std::string);
+ };
+
+ class qp : public decodeqp {
+ autodecoder &me;
+
+ public:
+ qp(autodecoder &meArg);
+ ~qp();
+ private:
+ void decoded(std::string);
+ };
+
+ base64 base64Decoder;
+ qp qpDecoder;
+
+ decoder *decoder; // Points to one of these two, or NULL
+
+public:
+ autodecoder(std::string contentTransferEncoding);
+ ~autodecoder();
+
+ void decode(std::string s);
+
+ virtual void decoded(std::string)=0;
+
+};
+
+LIBMAIL_END
+
+#endif