|
VMime
|
#include <wordEncoder.hpp>
Public Types | |
| enum | Encoding { ENCODING_AUTO , ENCODING_QP , ENCODING_B64 } |
Public Member Functions | |
| wordEncoder (const string &buffer, const charset &charset, const Encoding encoding=ENCODING_AUTO) | |
| const string | getNextChunk (const size_t maxLength) |
| Encoding | getEncoding () const |
Static Public Member Functions | |
| static bool | isEncodingNeeded (const generationContext &ctx, const string &buffer, const charset &charset, const string &lang) |
| static Encoding | guessBestEncoding (const string &buffer, const charset &charset) |
Encodes words following RFC-2047.
| wordEncoder | ( | const string & | buffer, |
| const charset & | charset, | ||
| const Encoding | encoding = ENCODING_AUTO |
||
| ) |
| wordEncoder::Encoding getEncoding | ( | ) | const |
Return the encoding used.
Return the next chunk in the word.
| maxLength | maximal length of the chunk |
References charsetConverter::create(), vmime::dynamicCast(), wordEncoder::ENCODING_B64, qpEncoder::RFC2047_getEncodedLength(), and vmime::charsets::UTF_8.
|
static |
Guess the best RFC-2047 encoding to use for the specified buffer.
| buffer | buffer to analyze |
| charset | charset of the buffer |
References stringUtils::countASCIIchars(), vmime::dynamicCast(), wordEncoder::ENCODING_B64, wordEncoder::ENCODING_QP, charset::getRecommendedEncoding(), and vmime::encodingTypes::QUOTED_PRINTABLE.
Referenced by wordEncoder::wordEncoder().
|
static |
Test whether RFC-2047 encoding is needed.
| ctx | generation context |
| buffer | buffer to analyze |
| charset | charset of the buffer |
| lang | language code, in the format specified by RFC-1766 |
References vmime::dynamicCast(), stringUtils::findFirstNonASCIIchar(), and charset::getRecommendedEncoding().