New namespace for encoders.
This commit is contained in:
parent
3f4226eaac
commit
13f69779c2
21
SConstruct
21
SConstruct
@ -93,15 +93,6 @@ libvmime_sources = [
|
|||||||
'defaultAttachment.cpp', 'defaultAttachment.hpp',
|
'defaultAttachment.cpp', 'defaultAttachment.hpp',
|
||||||
'disposition.cpp', 'disposition.hpp',
|
'disposition.cpp', 'disposition.hpp',
|
||||||
'emptyContentHandler.cpp', 'emptyContentHandler.hpp',
|
'emptyContentHandler.cpp', 'emptyContentHandler.hpp',
|
||||||
'encoder.cpp', 'encoder.hpp',
|
|
||||||
'encoder7bit.cpp', 'encoder7bit.hpp',
|
|
||||||
'encoder8bit.cpp', 'encoder8bit.hpp',
|
|
||||||
'encoderB64.cpp', 'encoderB64.hpp',
|
|
||||||
'encoderBinary.cpp', 'encoderBinary.hpp',
|
|
||||||
'encoderDefault.cpp', 'encoderDefault.hpp',
|
|
||||||
'encoderFactory.cpp', 'encoderFactory.hpp',
|
|
||||||
'encoderQP.cpp', 'encoderQP.hpp',
|
|
||||||
'encoderUUE.cpp', 'encoderUUE.hpp',
|
|
||||||
'encoding.cpp', 'encoding.hpp',
|
'encoding.cpp', 'encoding.hpp',
|
||||||
'exception.cpp', 'exception.hpp',
|
'exception.cpp', 'exception.hpp',
|
||||||
'fileAttachment.cpp', 'fileAttachment.hpp',
|
'fileAttachment.cpp', 'fileAttachment.hpp',
|
||||||
@ -157,6 +148,16 @@ libvmime_sources = [
|
|||||||
'utility/stringUtils.cpp', 'utility/stringUtils.hpp',
|
'utility/stringUtils.cpp', 'utility/stringUtils.hpp',
|
||||||
'utility/url.cpp', 'utility/url.hpp',
|
'utility/url.cpp', 'utility/url.hpp',
|
||||||
'utility/urlUtils.cpp', 'utility/urlUtils.hpp',
|
'utility/urlUtils.cpp', 'utility/urlUtils.hpp',
|
||||||
|
# -- encoder
|
||||||
|
'utility/encoder/encoder.cpp', 'utility/encoder/encoder.hpp',
|
||||||
|
'utility/encoder/sevenBitEncoder.cpp', 'utility/encoder/sevenBitEncoder.hpp',
|
||||||
|
'utility/encoder/eightBitEncoder.cpp', 'utility/encoder/eightBitEncoder.hpp',
|
||||||
|
'utility/encoder/b64Encoder.cpp', 'utility/encoder/b64Encoder.hpp',
|
||||||
|
'utility/encoder/binaryEncoder.cpp', 'utility/encoder/binaryEncoder.hpp',
|
||||||
|
'utility/encoder/defaultEncoder.cpp', 'utility/encoder/defaultEncoder.hpp',
|
||||||
|
'utility/encoder/encoderFactory.cpp', 'utility/encoder/encoderFactory.hpp',
|
||||||
|
'utility/encoder/qpEncoder.cpp', 'utility/encoder/qpEncoder.hpp',
|
||||||
|
'utility/encoder/uuEncoder.cpp', 'utility/encoder/uuEncoder.hpp',
|
||||||
# =============================== MDN ================================
|
# =============================== MDN ================================
|
||||||
'mdn/MDNHelper.cpp', 'mdn/MDNHelper.hpp',
|
'mdn/MDNHelper.cpp', 'mdn/MDNHelper.hpp',
|
||||||
'mdn/MDNInfos.cpp', 'mdn/MDNInfos.hpp',
|
'mdn/MDNInfos.cpp', 'mdn/MDNInfos.hpp',
|
||||||
@ -345,7 +346,6 @@ libvmimetest_sources = [
|
|||||||
'tests/parser/charsetTest.cpp',
|
'tests/parser/charsetTest.cpp',
|
||||||
'tests/parser/datetimeTest.cpp',
|
'tests/parser/datetimeTest.cpp',
|
||||||
'tests/parser/dispositionTest.cpp',
|
'tests/parser/dispositionTest.cpp',
|
||||||
'tests/parser/encoderTest.cpp',
|
|
||||||
'tests/parser/headerTest.cpp',
|
'tests/parser/headerTest.cpp',
|
||||||
'tests/parser/htmlTextPartTest.cpp',
|
'tests/parser/htmlTextPartTest.cpp',
|
||||||
'tests/parser/mailboxTest.cpp',
|
'tests/parser/mailboxTest.cpp',
|
||||||
@ -363,6 +363,7 @@ libvmimetest_sources = [
|
|||||||
'tests/utility/pathTest.cpp',
|
'tests/utility/pathTest.cpp',
|
||||||
'tests/utility/urlTest.cpp',
|
'tests/utility/urlTest.cpp',
|
||||||
'tests/utility/smartPtrTest.cpp',
|
'tests/utility/smartPtrTest.cpp',
|
||||||
|
'tests/utility/encoderTest.cpp',
|
||||||
# =============================== Misc ===============================
|
# =============================== Misc ===============================
|
||||||
'tests/misc/importanceHelperTest.cpp',
|
'tests/misc/importanceHelperTest.cpp',
|
||||||
# ============================= Security =============================
|
# ============================= Security =============================
|
||||||
|
10
src/base.cpp
10
src/base.cpp
@ -26,9 +26,9 @@
|
|||||||
#include "vmime/charset.hpp"
|
#include "vmime/charset.hpp"
|
||||||
#include "vmime/base.hpp"
|
#include "vmime/base.hpp"
|
||||||
|
|
||||||
#include "vmime/encoder.hpp"
|
#include "vmime/utility/encoder/encoder.hpp"
|
||||||
#include "vmime/encoderB64.hpp"
|
#include "vmime/utility/encoder/b64Encoder.hpp"
|
||||||
#include "vmime/encoderQP.hpp"
|
#include "vmime/utility/encoder/qpEncoder.hpp"
|
||||||
|
|
||||||
#include "vmime/text.hpp"
|
#include "vmime/text.hpp"
|
||||||
|
|
||||||
@ -37,7 +37,7 @@
|
|||||||
#include "vmime/utility/stringUtils.hpp"
|
#include "vmime/utility/stringUtils.hpp"
|
||||||
|
|
||||||
// For initializing
|
// For initializing
|
||||||
#include "vmime/encoderFactory.hpp"
|
#include "vmime/utility/encoder/encoderFactory.hpp"
|
||||||
#include "vmime/headerFieldFactory.hpp"
|
#include "vmime/headerFieldFactory.hpp"
|
||||||
#include "vmime/textPartFactory.hpp"
|
#include "vmime/textPartFactory.hpp"
|
||||||
#include "vmime/options.hpp"
|
#include "vmime/options.hpp"
|
||||||
@ -140,7 +140,7 @@ public:
|
|||||||
{
|
{
|
||||||
options::getInstance();
|
options::getInstance();
|
||||||
|
|
||||||
encoderFactory::getInstance();
|
utility::encoder::encoderFactory::getInstance();
|
||||||
headerFieldFactory::getInstance();
|
headerFieldFactory::getInstance();
|
||||||
textPartFactory::getInstance();
|
textPartFactory::getInstance();
|
||||||
|
|
||||||
|
@ -22,9 +22,10 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include "vmime/encoding.hpp"
|
#include "vmime/encoding.hpp"
|
||||||
#include "vmime/encoderFactory.hpp"
|
|
||||||
#include "vmime/contentHandler.hpp"
|
#include "vmime/contentHandler.hpp"
|
||||||
|
|
||||||
|
#include "vmime/utility/encoder/encoderFactory.hpp"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
|
||||||
@ -77,9 +78,9 @@ void encoding::generate(utility::outputStream& os, const string::size_type /* ma
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ref <encoder> encoding::getEncoder() const
|
ref <utility::encoder::encoder> encoding::getEncoder() const
|
||||||
{
|
{
|
||||||
return (encoderFactory::getInstance()->create(generate()));
|
return (utility::encoder::encoderFactory::getInstance()->create(generate()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
#include "vmime/exception.hpp"
|
#include "vmime/exception.hpp"
|
||||||
#include "vmime/platform.hpp"
|
#include "vmime/platform.hpp"
|
||||||
#include "vmime/encoderB64.hpp"
|
|
||||||
#include "vmime/mailboxList.hpp"
|
#include "vmime/mailboxList.hpp"
|
||||||
|
|
||||||
#include "vmime/utility/filteredStream.hpp"
|
#include "vmime/utility/filteredStream.hpp"
|
||||||
|
@ -29,7 +29,8 @@
|
|||||||
#include "vmime/security/sasl/SASLMechanism.hpp"
|
#include "vmime/security/sasl/SASLMechanism.hpp"
|
||||||
|
|
||||||
#include "vmime/base.hpp"
|
#include "vmime/base.hpp"
|
||||||
#include "vmime/encoderFactory.hpp"
|
|
||||||
|
#include "vmime/utility/encoder/encoderFactory.hpp"
|
||||||
|
|
||||||
#include "vmime/utility/stream.hpp"
|
#include "vmime/utility/stream.hpp"
|
||||||
|
|
||||||
@ -103,7 +104,8 @@ void SASLContext::decodeB64(const string& input, byte_t** output, int* outputLen
|
|||||||
utility::inputStreamStringAdapter is(input);
|
utility::inputStreamStringAdapter is(input);
|
||||||
utility::outputStreamStringAdapter os(res);
|
utility::outputStreamStringAdapter os(res);
|
||||||
|
|
||||||
ref <encoder> dec = encoderFactory::getInstance()->create("base64");
|
ref <utility::encoder::encoder> dec =
|
||||||
|
utility::encoder::encoderFactory::getInstance()->create("base64");
|
||||||
|
|
||||||
dec->decode(is, os);
|
dec->decode(is, os);
|
||||||
|
|
||||||
@ -123,7 +125,8 @@ const string SASLContext::encodeB64(const byte_t* input, const int inputLen)
|
|||||||
utility::inputStreamByteBufferAdapter is(input, inputLen);
|
utility::inputStreamByteBufferAdapter is(input, inputLen);
|
||||||
utility::outputStreamStringAdapter os(res);
|
utility::outputStreamStringAdapter os(res);
|
||||||
|
|
||||||
ref <encoder> enc = encoderFactory::getInstance()->create("base64");
|
ref <utility::encoder::encoder> enc =
|
||||||
|
utility::encoder::encoderFactory::getInstance()->create("base64");
|
||||||
|
|
||||||
enc->encode(is, os);
|
enc->encode(is, os);
|
||||||
|
|
||||||
|
@ -94,8 +94,8 @@ void streamContentHandler::generate(utility::outputStream& os, const vmime::enco
|
|||||||
// buffer, and then re-encode to output stream...
|
// buffer, and then re-encode to output stream...
|
||||||
if (m_encoding != enc)
|
if (m_encoding != enc)
|
||||||
{
|
{
|
||||||
ref <encoder> theDecoder = m_encoding.getEncoder();
|
ref <utility::encoder::encoder> theDecoder = m_encoding.getEncoder();
|
||||||
ref <encoder> theEncoder = enc.getEncoder();
|
ref <utility::encoder::encoder> theEncoder = enc.getEncoder();
|
||||||
|
|
||||||
theEncoder->getProperties()["maxlinelength"] = maxLineLength;
|
theEncoder->getProperties()["maxlinelength"] = maxLineLength;
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ void streamContentHandler::generate(utility::outputStream& os, const vmime::enco
|
|||||||
// Need to encode data before
|
// Need to encode data before
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ref <encoder> theEncoder = enc.getEncoder();
|
ref <utility::encoder::encoder> theEncoder = enc.getEncoder();
|
||||||
theEncoder->getProperties()["maxlinelength"] = maxLineLength;
|
theEncoder->getProperties()["maxlinelength"] = maxLineLength;
|
||||||
|
|
||||||
m_stream->reset(); // may not work...
|
m_stream->reset(); // may not work...
|
||||||
@ -151,7 +151,7 @@ void streamContentHandler::extract(utility::outputStream& os,
|
|||||||
// Need to decode data
|
// Need to decode data
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ref <encoder> theDecoder = m_encoding.getEncoder();
|
ref <utility::encoder::encoder> theDecoder = m_encoding.getEncoder();
|
||||||
|
|
||||||
m_stream->reset(); // may not work...
|
m_stream->reset(); // may not work...
|
||||||
|
|
||||||
|
@ -114,8 +114,8 @@ void stringContentHandler::generate(utility::outputStream& os,
|
|||||||
// buffer, and then re-encode to output stream...
|
// buffer, and then re-encode to output stream...
|
||||||
if (m_encoding != enc)
|
if (m_encoding != enc)
|
||||||
{
|
{
|
||||||
ref <encoder> theDecoder = m_encoding.getEncoder();
|
ref <utility::encoder::encoder> theDecoder = m_encoding.getEncoder();
|
||||||
ref <encoder> theEncoder = enc.getEncoder();
|
ref <utility::encoder::encoder> theEncoder = enc.getEncoder();
|
||||||
|
|
||||||
theEncoder->getProperties()["maxlinelength"] = maxLineLength;
|
theEncoder->getProperties()["maxlinelength"] = maxLineLength;
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ void stringContentHandler::generate(utility::outputStream& os,
|
|||||||
// Need to encode data before
|
// Need to encode data before
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ref <encoder> theEncoder = enc.getEncoder();
|
ref <utility::encoder::encoder> theEncoder = enc.getEncoder();
|
||||||
theEncoder->getProperties()["maxlinelength"] = maxLineLength;
|
theEncoder->getProperties()["maxlinelength"] = maxLineLength;
|
||||||
|
|
||||||
utility::inputStreamStringProxyAdapter in(m_string);
|
utility::inputStreamStringProxyAdapter in(m_string);
|
||||||
@ -161,7 +161,7 @@ void stringContentHandler::extract(utility::outputStream& os,
|
|||||||
// Need to decode data
|
// Need to decode data
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ref <encoder> theDecoder = m_encoding.getEncoder();
|
ref <utility::encoder::encoder> theDecoder = m_encoding.getEncoder();
|
||||||
|
|
||||||
utility::inputStreamStringProxyAdapter in(m_string);
|
utility::inputStreamStringProxyAdapter in(m_string);
|
||||||
utility::progressListenerSizeAdapter plsa(progress, getLength());
|
utility::progressListenerSizeAdapter plsa(progress, getLength());
|
||||||
|
@ -21,20 +21,21 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "vmime/encoderB64.hpp"
|
#include "vmime/utility/encoder/b64Encoder.hpp"
|
||||||
#include "vmime/parserHelpers.hpp"
|
#include "vmime/parserHelpers.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
encoderB64::encoderB64()
|
b64Encoder::b64Encoder()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const std::vector <string> encoderB64::getAvailableProperties() const
|
const std::vector <string> b64Encoder::getAvailableProperties() const
|
||||||
{
|
{
|
||||||
std::vector <string> list(encoder::getAvailableProperties());
|
std::vector <string> list(encoder::getAvailableProperties());
|
||||||
|
|
||||||
@ -45,10 +46,10 @@ const std::vector <string> encoderB64::getAvailableProperties() const
|
|||||||
|
|
||||||
|
|
||||||
// 7-bits alphabet used to encode binary data
|
// 7-bits alphabet used to encode binary data
|
||||||
const unsigned char encoderB64::sm_alphabet[] =
|
const unsigned char b64Encoder::sm_alphabet[] =
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||||
|
|
||||||
const unsigned char encoderB64::sm_decodeMap[256] =
|
const unsigned char b64Encoder::sm_decodeMap[256] =
|
||||||
{
|
{
|
||||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, // 0x00 - 0x0f
|
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, // 0x00 - 0x0f
|
||||||
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, // 0x10 - 0x1f
|
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, // 0x10 - 0x1f
|
||||||
@ -74,7 +75,7 @@ const unsigned char encoderB64::sm_decodeMap[256] =
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
utility::stream::size_type encoderB64::encode(utility::inputStream& in,
|
utility::stream::size_type b64Encoder::encode(utility::inputStream& in,
|
||||||
utility::outputStream& out, utility::progressListener* progress)
|
utility::outputStream& out, utility::progressListener* progress)
|
||||||
{
|
{
|
||||||
in.reset(); // may not work...
|
in.reset(); // may not work...
|
||||||
@ -189,7 +190,7 @@ utility::stream::size_type encoderB64::encode(utility::inputStream& in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
utility::stream::size_type encoderB64::decode(utility::inputStream& in,
|
utility::stream::size_type b64Encoder::decode(utility::inputStream& in,
|
||||||
utility::outputStream& out, utility::progressListener* progress)
|
utility::outputStream& out, utility::progressListener* progress)
|
||||||
{
|
{
|
||||||
in.reset(); // may not work...
|
in.reset(); // may not work...
|
||||||
@ -302,4 +303,6 @@ utility::stream::size_type encoderB64::decode(utility::inputStream& in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
@ -21,16 +21,19 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "vmime/encoder7bit.hpp"
|
#include "vmime/utility/encoder/binaryEncoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
encoder7bit::encoder7bit()
|
binaryEncoder::binaryEncoder()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
@ -21,19 +21,20 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "vmime/encoderDefault.hpp"
|
#include "vmime/utility/encoder/defaultEncoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
encoderDefault::encoderDefault()
|
defaultEncoder::defaultEncoder()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
utility::stream::size_type encoderDefault::encode(utility::inputStream& in,
|
utility::stream::size_type defaultEncoder::encode(utility::inputStream& in,
|
||||||
utility::outputStream& out, utility::progressListener* progress)
|
utility::outputStream& out, utility::progressListener* progress)
|
||||||
{
|
{
|
||||||
in.reset(); // may not work...
|
in.reset(); // may not work...
|
||||||
@ -50,7 +51,7 @@ utility::stream::size_type encoderDefault::encode(utility::inputStream& in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
utility::stream::size_type encoderDefault::decode(utility::inputStream& in,
|
utility::stream::size_type defaultEncoder::decode(utility::inputStream& in,
|
||||||
utility::outputStream& out, utility::progressListener* progress)
|
utility::outputStream& out, utility::progressListener* progress)
|
||||||
{
|
{
|
||||||
in.reset(); // may not work...
|
in.reset(); // may not work...
|
||||||
@ -67,4 +68,6 @@ utility::stream::size_type encoderDefault::decode(utility::inputStream& in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
@ -21,16 +21,19 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "vmime/encoder8bit.hpp"
|
#include "vmime/utility/encoder/eightBitEncoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
encoder8bit::encoder8bit()
|
eightBitEncoder::eightBitEncoder()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
@ -21,12 +21,13 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "vmime/encoder.hpp"
|
#include "vmime/utility/encoder/encoder.hpp"
|
||||||
#include "vmime/exception.hpp"
|
#include "vmime/exception.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
encoder::encoder()
|
encoder::encoder()
|
||||||
@ -70,4 +71,6 @@ const std::vector <string> encoder::getAvailableProperties() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
@ -21,30 +21,31 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "vmime/encoderFactory.hpp"
|
#include "vmime/utility/encoder/encoderFactory.hpp"
|
||||||
#include "vmime/exception.hpp"
|
#include "vmime/exception.hpp"
|
||||||
|
|
||||||
#include "vmime/encoderB64.hpp"
|
#include "vmime/utility/encoder/b64Encoder.hpp"
|
||||||
#include "vmime/encoderQP.hpp"
|
#include "vmime/utility/encoder/qpEncoder.hpp"
|
||||||
#include "vmime/encoderUUE.hpp"
|
#include "vmime/utility/encoder/uuEncoder.hpp"
|
||||||
#include "vmime/encoderBinary.hpp"
|
#include "vmime/utility/encoder/binaryEncoder.hpp"
|
||||||
#include "vmime/encoder7bit.hpp"
|
#include "vmime/utility/encoder/sevenBitEncoder.hpp"
|
||||||
#include "vmime/encoder8bit.hpp"
|
#include "vmime/utility/encoder/eightBitEncoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
encoderFactory::encoderFactory()
|
encoderFactory::encoderFactory()
|
||||||
{
|
{
|
||||||
// Register some default encoders
|
// Register some default encoders
|
||||||
registerName <encoderB64>("base64");
|
registerName <b64Encoder>("base64");
|
||||||
registerName <encoderQP>("quoted-printable");
|
registerName <qpEncoder>("quoted-printable");
|
||||||
registerName <encoderUUE>("uuencode");
|
registerName <uuEncoder>("uuencode");
|
||||||
registerName <encoder7bit>("7bit");
|
registerName <sevenBitEncoder>("7bit");
|
||||||
registerName <encoder8bit>("8bit");
|
registerName <eightBitEncoder>("8bit");
|
||||||
registerName <encoderBinary>("binary");
|
registerName <binaryEncoder>("binary");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -107,4 +108,6 @@ const std::vector <ref <const encoderFactory::registeredEncoder> > encoderFactor
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
@ -21,20 +21,21 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "vmime/encoderQP.hpp"
|
#include "vmime/utility/encoder/qpEncoder.hpp"
|
||||||
#include "vmime/parserHelpers.hpp"
|
#include "vmime/parserHelpers.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
encoderQP::encoderQP()
|
qpEncoder::qpEncoder()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const std::vector <string> encoderQP::getAvailableProperties() const
|
const std::vector <string> qpEncoder::getAvailableProperties() const
|
||||||
{
|
{
|
||||||
std::vector <string> list(encoder::getAvailableProperties());
|
std::vector <string> list(encoder::getAvailableProperties());
|
||||||
|
|
||||||
@ -51,10 +52,10 @@ const std::vector <string> encoderQP::getAvailableProperties() const
|
|||||||
|
|
||||||
|
|
||||||
// Encoding table
|
// Encoding table
|
||||||
const unsigned char encoderQP::sm_hexDigits[] = "0123456789ABCDEF";
|
const unsigned char qpEncoder::sm_hexDigits[] = "0123456789ABCDEF";
|
||||||
|
|
||||||
// Decoding table
|
// Decoding table
|
||||||
const unsigned char encoderQP::sm_hexDecodeTable[256] =
|
const unsigned char qpEncoder::sm_hexDecodeTable[256] =
|
||||||
{
|
{
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
@ -89,7 +90,7 @@ const unsigned char encoderQP::sm_hexDecodeTable[256] =
|
|||||||
#endif // VMIME_BUILDING_DOC
|
#endif // VMIME_BUILDING_DOC
|
||||||
|
|
||||||
|
|
||||||
utility::stream::size_type encoderQP::encode(utility::inputStream& in,
|
utility::stream::size_type qpEncoder::encode(utility::inputStream& in,
|
||||||
utility::outputStream& out, utility::progressListener* progress)
|
utility::outputStream& out, utility::progressListener* progress)
|
||||||
{
|
{
|
||||||
in.reset(); // may not work...
|
in.reset(); // may not work...
|
||||||
@ -305,7 +306,7 @@ utility::stream::size_type encoderQP::encode(utility::inputStream& in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
utility::stream::size_type encoderQP::decode(utility::inputStream& in,
|
utility::stream::size_type qpEncoder::decode(utility::inputStream& in,
|
||||||
utility::outputStream& out, utility::progressListener* progress)
|
utility::outputStream& out, utility::progressListener* progress)
|
||||||
{
|
{
|
||||||
in.reset(); // may not work...
|
in.reset(); // may not work...
|
||||||
@ -466,4 +467,6 @@ utility::stream::size_type encoderQP::decode(utility::inputStream& in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
@ -21,16 +21,19 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "vmime/encoderBinary.hpp"
|
#include "vmime/utility/encoder/sevenBitEncoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
encoderBinary::encoderBinary()
|
sevenBitEncoder::sevenBitEncoder()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
@ -21,15 +21,16 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "vmime/encoderUUE.hpp"
|
#include "vmime/utility/encoder/uuEncoder.hpp"
|
||||||
#include "vmime/parserHelpers.hpp"
|
#include "vmime/parserHelpers.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
encoderUUE::encoderUUE()
|
uuEncoder::uuEncoder()
|
||||||
{
|
{
|
||||||
getProperties()["mode"] = 644;
|
getProperties()["mode"] = 644;
|
||||||
getProperties()["filename"] = "no_name";
|
getProperties()["filename"] = "no_name";
|
||||||
@ -37,7 +38,7 @@ encoderUUE::encoderUUE()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const std::vector <string> encoderUUE::getAvailableProperties() const
|
const std::vector <string> uuEncoder::getAvailableProperties() const
|
||||||
{
|
{
|
||||||
std::vector <string> list(encoder::getAvailableProperties());
|
std::vector <string> list(encoder::getAvailableProperties());
|
||||||
|
|
||||||
@ -63,7 +64,7 @@ static inline unsigned char UUDECODE(const unsigned char c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
utility::stream::size_type encoderUUE::encode(utility::inputStream& in,
|
utility::stream::size_type uuEncoder::encode(utility::inputStream& in,
|
||||||
utility::outputStream& out, utility::progressListener* progress)
|
utility::outputStream& out, utility::progressListener* progress)
|
||||||
{
|
{
|
||||||
in.reset(); // may not work...
|
in.reset(); // may not work...
|
||||||
@ -142,7 +143,7 @@ utility::stream::size_type encoderUUE::encode(utility::inputStream& in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
utility::stream::size_type encoderUUE::decode(utility::inputStream& in,
|
utility::stream::size_type uuEncoder::decode(utility::inputStream& in,
|
||||||
utility::outputStream& out, utility::progressListener* progress)
|
utility::outputStream& out, utility::progressListener* progress)
|
||||||
{
|
{
|
||||||
in.reset(); // may not work...
|
in.reset(); // may not work...
|
||||||
@ -325,4 +326,6 @@ utility::stream::size_type encoderUUE::decode(utility::inputStream& in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
12
src/word.cpp
12
src/word.cpp
@ -28,9 +28,9 @@
|
|||||||
#include "vmime/utility/smartPtr.hpp"
|
#include "vmime/utility/smartPtr.hpp"
|
||||||
#include "vmime/parserHelpers.hpp"
|
#include "vmime/parserHelpers.hpp"
|
||||||
|
|
||||||
#include "vmime/encoder.hpp"
|
#include "vmime/utility/encoder/encoder.hpp"
|
||||||
#include "vmime/encoderB64.hpp"
|
#include "vmime/utility/encoder/b64Encoder.hpp"
|
||||||
#include "vmime/encoderQP.hpp"
|
#include "vmime/utility/encoder/qpEncoder.hpp"
|
||||||
|
|
||||||
#include "vmime/wordEncoder.hpp"
|
#include "vmime/wordEncoder.hpp"
|
||||||
|
|
||||||
@ -267,17 +267,17 @@ void word::parse(const string& buffer, const string::size_type position,
|
|||||||
const string::const_iterator dataEnd = p;
|
const string::const_iterator dataEnd = p;
|
||||||
p += 2; // skip '?='
|
p += 2; // skip '?='
|
||||||
|
|
||||||
encoder* theEncoder = NULL;
|
utility::encoder::encoder* theEncoder = NULL;
|
||||||
|
|
||||||
// Base-64 encoding
|
// Base-64 encoding
|
||||||
if (*encPos == 'B' || *encPos == 'b')
|
if (*encPos == 'B' || *encPos == 'b')
|
||||||
{
|
{
|
||||||
theEncoder = new encoderB64;
|
theEncoder = new utility::encoder::b64Encoder();
|
||||||
}
|
}
|
||||||
// Quoted-Printable encoding
|
// Quoted-Printable encoding
|
||||||
else if (*encPos == 'Q' || *encPos == 'q')
|
else if (*encPos == 'Q' || *encPos == 'q')
|
||||||
{
|
{
|
||||||
theEncoder = new encoderQP;
|
theEncoder = new utility::encoder::qpEncoder();
|
||||||
theEncoder->getProperties()["rfc2047"] = true;
|
theEncoder->getProperties()["rfc2047"] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,8 +25,9 @@
|
|||||||
|
|
||||||
#include "vmime/exception.hpp"
|
#include "vmime/exception.hpp"
|
||||||
#include "vmime/charsetConverter.hpp"
|
#include "vmime/charsetConverter.hpp"
|
||||||
#include "vmime/encoderB64.hpp"
|
|
||||||
#include "vmime/encoderQP.hpp"
|
#include "vmime/utility/encoder/b64Encoder.hpp"
|
||||||
|
#include "vmime/utility/encoder/qpEncoder.hpp"
|
||||||
|
|
||||||
#include "vmime/utility/stringUtils.hpp"
|
#include "vmime/utility/stringUtils.hpp"
|
||||||
|
|
||||||
@ -62,11 +63,11 @@ wordEncoder::wordEncoder(const string& buffer, const charset& charset, const Enc
|
|||||||
|
|
||||||
if (m_encoding == ENCODING_B64)
|
if (m_encoding == ENCODING_B64)
|
||||||
{
|
{
|
||||||
m_encoder = vmime::create <encoderB64>();
|
m_encoder = vmime::create <utility::encoder::b64Encoder>();
|
||||||
}
|
}
|
||||||
else // ENCODING_QP
|
else // ENCODING_QP
|
||||||
{
|
{
|
||||||
m_encoder = vmime::create <encoderQP>();
|
m_encoder = vmime::create <utility::encoder::qpEncoder>();
|
||||||
m_encoder->getProperties()["rfc2047"] = true;
|
m_encoder->getProperties()["rfc2047"] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,8 @@ VMIME_TEST_SUITE_BEGIN
|
|||||||
// Encoding helper function
|
// Encoding helper function
|
||||||
static const vmime::string encode(const vmime::string& name, const vmime::string& in, int maxLineLength = 0)
|
static const vmime::string encode(const vmime::string& name, const vmime::string& in, int maxLineLength = 0)
|
||||||
{
|
{
|
||||||
vmime::ref <vmime::encoder> enc = vmime::encoderFactory::getInstance()->create(name);
|
vmime::ref <vmime::utility::encoder::encoder> enc =
|
||||||
|
vmime::utility::encoder::encoderFactory::getInstance()->create(name);
|
||||||
|
|
||||||
if (maxLineLength != 0)
|
if (maxLineLength != 0)
|
||||||
enc->getProperties()["maxlinelength"] = maxLineLength;
|
enc->getProperties()["maxlinelength"] = maxLineLength;
|
||||||
@ -57,7 +58,8 @@ VMIME_TEST_SUITE_BEGIN
|
|||||||
// Decoding helper function
|
// Decoding helper function
|
||||||
static const vmime::string decode(const vmime::string& name, const vmime::string& in, int maxLineLength = 0)
|
static const vmime::string decode(const vmime::string& name, const vmime::string& in, int maxLineLength = 0)
|
||||||
{
|
{
|
||||||
vmime::ref <vmime::encoder> enc = vmime::encoderFactory::getInstance()->create(name);
|
vmime::ref <vmime::utility::encoder::encoder> enc =
|
||||||
|
vmime::utility::encoder::encoderFactory::getInstance()->create(name);
|
||||||
|
|
||||||
if (maxLineLength != 0)
|
if (maxLineLength != 0)
|
||||||
enc->getProperties()["maxlinelength"] = maxLineLength;
|
enc->getProperties()["maxlinelength"] = maxLineLength;
|
@ -27,7 +27,8 @@
|
|||||||
|
|
||||||
#include "vmime/base.hpp"
|
#include "vmime/base.hpp"
|
||||||
#include "vmime/headerFieldValue.hpp"
|
#include "vmime/headerFieldValue.hpp"
|
||||||
#include "vmime/encoder.hpp"
|
|
||||||
|
#include "vmime/utility/encoder/encoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime
|
||||||
@ -99,7 +100,7 @@ public:
|
|||||||
* is registered for the encoding
|
* is registered for the encoding
|
||||||
* @return a new encoder object for the encoding type
|
* @return a new encoder object for the encoding type
|
||||||
*/
|
*/
|
||||||
ref <encoder> getEncoder() const;
|
ref <utility::encoder::encoder> getEncoder() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@
|
|||||||
#include "vmime/utility/stringUtils.hpp"
|
#include "vmime/utility/stringUtils.hpp"
|
||||||
#include "vmime/utility/progressListener.hpp"
|
#include "vmime/utility/progressListener.hpp"
|
||||||
|
|
||||||
#include "vmime/encoderB64.hpp"
|
#include "vmime/utility/encoder/b64Encoder.hpp"
|
||||||
#include "vmime/encoderQP.hpp"
|
#include "vmime/utility/encoder/qpEncoder.hpp"
|
||||||
|
|
||||||
#include "vmime/platform.hpp"
|
#include "vmime/platform.hpp"
|
||||||
|
|
||||||
@ -1233,18 +1233,18 @@ public:
|
|||||||
delete (theCharset);
|
delete (theCharset);
|
||||||
|
|
||||||
// Decode text
|
// Decode text
|
||||||
encoder* theEncoder = NULL;
|
utility::encoder::encoder* theEncoder = NULL;
|
||||||
|
|
||||||
if (theEncoding->value()[0] == 'q' || theEncoding->value()[0] == 'Q')
|
if (theEncoding->value()[0] == 'q' || theEncoding->value()[0] == 'Q')
|
||||||
{
|
{
|
||||||
// Quoted-printable
|
// Quoted-printable
|
||||||
theEncoder = new encoderQP;
|
theEncoder = new utility::encoder::qpEncoder();
|
||||||
theEncoder->getProperties()["rfc2047"] = true;
|
theEncoder->getProperties()["rfc2047"] = true;
|
||||||
}
|
}
|
||||||
else if (theEncoding->value()[0] == 'b' || theEncoding->value()[0] == 'B')
|
else if (theEncoding->value()[0] == 'b' || theEncoding->value()[0] == 'B')
|
||||||
{
|
{
|
||||||
// Base64
|
// Base64
|
||||||
theEncoder = new encoderB64;
|
theEncoder = new utility::encoder::b64Encoder();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (theEncoder)
|
if (theEncoder)
|
||||||
|
@ -21,25 +21,26 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef VMIME_ENCODERB64_HPP_INCLUDED
|
#ifndef VMIME_UTILITY_ENCODER_B64ENCODER_HPP_INCLUDED
|
||||||
#define VMIME_ENCODERB64_HPP_INCLUDED
|
#define VMIME_UTILITY_ENCODER_B64ENCODER_HPP_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "vmime/encoder.hpp"
|
#include "vmime/utility/encoder/encoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
/** Base64 encoder.
|
/** Base64 encoder.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class encoderB64 : public encoder
|
class b64Encoder : public encoder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
encoderB64();
|
b64Encoder();
|
||||||
|
|
||||||
utility::stream::size_type encode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
utility::stream::size_type encode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
||||||
utility::stream::size_type decode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
utility::stream::size_type decode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
||||||
@ -53,7 +54,9 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
||||||
|
|
||||||
|
|
||||||
#endif // VMIME_ENCODERB64_HPP_INCLUDED
|
#endif // VMIME_UTILITY_ENCODER_B64ENCODER_HPP_INCLUDED
|
@ -21,29 +21,32 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef VMIME_ENCODERBINARY_HPP_INCLUDED
|
#ifndef VMIME_UTILITY_ENCODER_BINARYENCODER_HPP_INCLUDED
|
||||||
#define VMIME_ENCODERBINARY_HPP_INCLUDED
|
#define VMIME_UTILITY_ENCODER_BINARYENCODER_HPP_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "vmime/encoderDefault.hpp"
|
#include "vmime/utility/encoder/defaultEncoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
/** Binary encoder.
|
/** Binary encoder.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class encoderBinary : public encoderDefault
|
class binaryEncoder : public defaultEncoder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
encoderBinary();
|
binaryEncoder();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
||||||
|
|
||||||
|
|
||||||
#endif // VMIME_ENCODERBINARY_HPP_INCLUDED
|
#endif // VMIME_UTILITY_ENCODER_BINARYENCODER_HPP_INCLUDED
|
@ -21,32 +21,35 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef VMIME_ENCODERDEFAULT_HPP_INCLUDED
|
#ifndef VMIME_UTILITY_ENCODER_DEFAULTENCODER_HPP_INCLUDED
|
||||||
#define VMIME_ENCODERDEFAULT_HPP_INCLUDED
|
#define VMIME_UTILITY_ENCODER_DEFAULTENCODER_HPP_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "vmime/encoder.hpp"
|
#include "vmime/utility/encoder/encoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
/** Default encoder (simple copy, no encoding/decoding is performed).
|
/** Default encoder (simple copy, no encoding/decoding is performed).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class encoderDefault : public encoder
|
class defaultEncoder : public encoder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
encoderDefault();
|
defaultEncoder();
|
||||||
|
|
||||||
utility::stream::size_type encode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
utility::stream::size_type encode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
||||||
utility::stream::size_type decode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
utility::stream::size_type decode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
||||||
|
|
||||||
|
|
||||||
#endif // VMIME_ENCODERDEFAUL_HPP_INCLUDED
|
#endif // VMIME_UTILITY_ENCODER_DEFAULTENCODER_HPP_INCLUDED
|
@ -21,29 +21,32 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef VMIME_ENCODER8BIT_HPP_INCLUDED
|
#ifndef VMIME_UTILITY_ENCODER_EIGHTBITENCODER_HPP_INCLUDED
|
||||||
#define VMIME_ENCODER8BIT_HPP_INCLUDED
|
#define VMIME_UTILITY_ENCODER_EIGHTBITENCODER_HPP_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "vmime/encoderDefault.hpp"
|
#include "vmime/utility/encoder/defaultEncoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
/** 8-bit encoder.
|
/** 8-bit encoder.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class encoder8bit : public encoderDefault
|
class eightBitEncoder : public defaultEncoder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
encoder8bit();
|
eightBitEncoder();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
||||||
|
|
||||||
|
|
||||||
#endif // VMIME_ENCODER8BIT_HPP_INCLUDED
|
#endif // VMIME_UTILITY_ENCODER_EIGHTBITENCODER_HPP_INCLUDED
|
@ -21,8 +21,8 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef VMIME_ENCODER_HPP_INCLUDED
|
#ifndef VMIME_UTILITY_ENCODER_ENCODER_HPP_INCLUDED
|
||||||
#define VMIME_ENCODER_HPP_INCLUDED
|
#define VMIME_UTILITY_ENCODER_ENCODER_HPP_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "vmime/base.hpp"
|
#include "vmime/base.hpp"
|
||||||
@ -31,8 +31,9 @@
|
|||||||
#include "vmime/utility/progressListener.hpp"
|
#include "vmime/utility/progressListener.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
/** Encode/decode data in different encodings.
|
/** Encode/decode data in different encodings.
|
||||||
@ -101,7 +102,9 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
||||||
|
|
||||||
|
|
||||||
#endif // VMIME_ENCODER_HPP_INCLUDED
|
#endif // VMIME_UTILITY_ENCODER_ENCODER_HPP_INCLUDED
|
@ -21,16 +21,17 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef VMIME_ENCODERFACTORY_HPP_INCLUDED
|
#ifndef VMIME_UTILITY_ENCODER_ENCODERFACTORY_HPP_INCLUDED
|
||||||
#define VMIME_ENCODERFACTORY_HPP_INCLUDED
|
#define VMIME_UTILITY_ENCODER_ENCODERFACTORY_HPP_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "vmime/encoder.hpp"
|
#include "vmime/utility/encoder/encoder.hpp"
|
||||||
#include "vmime/utility/stringUtils.hpp"
|
#include "vmime/utility/stringUtils.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
/** A factory to create 'encoder' objects for the specified encoding.
|
/** A factory to create 'encoder' objects for the specified encoding.
|
||||||
@ -143,7 +144,9 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
||||||
|
|
||||||
|
|
||||||
#endif // VMIME_ENCODERFACTORY_HPP_INCLUDED
|
#endif // VMIME_UTILITY_ENCODER_ENCODERFACTORY_HPP_INCLUDED
|
@ -21,25 +21,26 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef VMIME_ENCODERQP_HPP_INCLUDED
|
#ifndef VMIME_UTILITY_ENCODER_QPENCODER_HPP_INCLUDED
|
||||||
#define VMIME_ENCODERQP_HPP_INCLUDED
|
#define VMIME_UTILITY_ENCODER_QPENCODER_HPP_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "vmime/encoder.hpp"
|
#include "vmime/utility/encoder/encoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
/** Quoted-printable encoder.
|
/** Quoted-printable encoder.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class encoderQP : public encoder
|
class qpEncoder : public encoder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
encoderQP();
|
qpEncoder();
|
||||||
|
|
||||||
utility::stream::size_type encode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
utility::stream::size_type encode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
||||||
utility::stream::size_type decode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
utility::stream::size_type decode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
||||||
@ -53,7 +54,9 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
||||||
|
|
||||||
|
|
||||||
#endif // VMIME_ENCODERQP_HPP_INCLUDED
|
#endif // VMIME_UTILITY_ENCODER_QPENCODER_HPP_INCLUDED
|
@ -21,29 +21,32 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef VMIME_ENCODER7BIT_HPP_INCLUDED
|
#ifndef VMIME_UTILITY_ENCODER_SEVENBITENCODER_HPP_INCLUDED
|
||||||
#define VMIME_ENCODER7BIT_HPP_INCLUDED
|
#define VMIME_UTILITY_ENCODER_SEVENBITENCODER_HPP_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "vmime/encoderDefault.hpp"
|
#include "vmime/utility/encoder/defaultEncoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
/** 7-bit encoder.
|
/** 7-bit encoder.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class encoder7bit : public encoderDefault
|
class sevenBitEncoder : public defaultEncoder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
encoder7bit();
|
sevenBitEncoder();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
||||||
|
|
||||||
|
|
||||||
#endif // VMIME_ENCODER7BIT_HPP_INCLUDED
|
#endif // VMIME_UTILITY_ENCODER_SEVENBITENCODER_HPP_INCLUDED
|
@ -21,25 +21,26 @@
|
|||||||
// the GNU General Public License cover the whole combination.
|
// the GNU General Public License cover the whole combination.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef VMIME_ENCODERUUE_HPP_INCLUDED
|
#ifndef VMIME_UTILITY_ENCODER_UUENCODER_HPP_INCLUDED
|
||||||
#define VMIME_ENCODERUUE_HPP_INCLUDED
|
#define VMIME_UTILITY_ENCODER_UUENCODER_HPP_INCLUDED
|
||||||
|
|
||||||
|
|
||||||
#include "vmime/encoder.hpp"
|
#include "vmime/utility/encoder/encoder.hpp"
|
||||||
|
|
||||||
|
|
||||||
namespace vmime
|
namespace vmime {
|
||||||
{
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
|
|
||||||
/** UUEncode encoder.
|
/** UUEncode encoder.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class encoderUUE : public encoder
|
class uuEncoder : public encoder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
encoderUUE();
|
uuEncoder();
|
||||||
|
|
||||||
utility::stream::size_type encode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
utility::stream::size_type encode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
||||||
utility::stream::size_type decode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
utility::stream::size_type decode(utility::inputStream& in, utility::outputStream& out, utility::progressListener* progress = NULL);
|
||||||
@ -48,7 +49,9 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
} // vmime
|
} // vmime
|
||||||
|
|
||||||
|
|
||||||
#endif // VMIME_ENCODERUUE_HPP_INCLUDED
|
#endif // VMIME_UTILITY_ENCODER_UUENCODER_HPP_INCLUDED
|
@ -66,7 +66,7 @@
|
|||||||
#include "vmime/parameterizedHeaderField.hpp"
|
#include "vmime/parameterizedHeaderField.hpp"
|
||||||
|
|
||||||
// Encoders
|
// Encoders
|
||||||
#include "vmime/encoderFactory.hpp"
|
#include "vmime/utility/encoder/encoderFactory.hpp"
|
||||||
|
|
||||||
// Message builder/parser
|
// Message builder/parser
|
||||||
#include "vmime/messageBuilder.hpp"
|
#include "vmime/messageBuilder.hpp"
|
||||||
|
@ -32,8 +32,14 @@ namespace vmime
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
namespace utility {
|
||||||
|
namespace encoder {
|
||||||
|
|
||||||
class encoder;
|
class encoder;
|
||||||
|
|
||||||
|
} // encoder
|
||||||
|
} // utility
|
||||||
|
|
||||||
|
|
||||||
/** Encodes words following RFC-2047.
|
/** Encodes words following RFC-2047.
|
||||||
*/
|
*/
|
||||||
@ -83,7 +89,7 @@ private:
|
|||||||
charset m_charset;
|
charset m_charset;
|
||||||
Encoding m_encoding;
|
Encoding m_encoding;
|
||||||
|
|
||||||
ref <encoder> m_encoder;
|
ref <utility::encoder::encoder> m_encoder;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user