diff options
| author | Sam Varshavchik | 2013-08-19 16:39:41 -0400 |
|---|---|---|
| committer | Sam Varshavchik | 2013-08-25 14:43:51 -0400 |
| commit | 9c45d9ad13fdf439d44d7443ae75da15ea0223ed (patch) | |
| tree | 7a81a04cb51efb078ee350859a64be2ebc6b8813 /libmail/autodecoder.C | |
| parent | a9520698b770168d1f33d6301463bb70a19655ec (diff) | |
| download | courier-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.C')
| -rw-r--r-- | libmail/autodecoder.C | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/libmail/autodecoder.C b/libmail/autodecoder.C new file mode 100644 index 0000000..8065fd9 --- /dev/null +++ b/libmail/autodecoder.C @@ -0,0 +1,67 @@ +/* +** Copyright 2002-2004, Double Precision Inc. +** +** See COPYING for distribution information. +*/ +#include "libmail_config.h" +#include "misc.H" +#include "autodecoder.H" + +using namespace std; + +mail::autodecoder::base64::base64(mail::autodecoder &meArg) + : me(meArg) +{ +} + +mail::autodecoder::base64::~base64() +{ +} + +void mail::autodecoder::base64::decoded(string s) +{ + me.decoded(s); +} + +mail::autodecoder::qp::qp(mail::autodecoder &meArg) + : me(meArg) +{ +} + +mail::autodecoder::qp::~qp() +{ +} + +void mail::autodecoder::qp::decoded(string s) +{ + me.decoded(s); +} + +////////////////////////////////////////////////////////////////////// + +mail::autodecoder::autodecoder(string cte) + : base64Decoder(*this), + qpDecoder(*this), + decoder(NULL) +{ + mail::upper(cte); + + if (cte == "QUOTED-PRINTABLE") + decoder= &qpDecoder; + + if (cte == "BASE64") + decoder= &base64Decoder; +} + +mail::autodecoder::~autodecoder() +{ +} + +void mail::autodecoder::decode(string s) +{ + if (decoder) + decoder->decode(s); // 7bit or 8bit, or something... + else + decoded(s); +} + |
