From 9c45d9ad13fdf439d44d7443ae75da15ea0223ed Mon Sep 17 00:00:00 2001 From: Sam Varshavchik Date: Mon, 19 Aug 2013 16:39:41 -0400 Subject: Initial checkin Imported from subversion report, converted to git. Updated all paths in scripts and makefiles, reflecting the new directory hierarchy. --- libmail/autodecoder.H | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 libmail/autodecoder.H (limited to 'libmail/autodecoder.H') 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 -- cgit v1.2.3