|
VMime
|
#include <encoding.hpp>


Public Types | |
| enum | EncodingUsage { USAGE_UNKNOWN , USAGE_TEXT , USAGE_BINARY_DATA } |
Static Public Member Functions | |
| static const encoding | decide (shared_ptr< const contentHandler > data, const EncodingUsage usage=USAGE_BINARY_DATA) |
| static const encoding | decide (shared_ptr< const contentHandler > data, const charset &chset, const EncodingUsage usage=USAGE_BINARY_DATA) |
Protected Member Functions | |
| void | parseImpl (const parsingContext &ctx, const string &buffer, const size_t position, const size_t end, size_t *newPosition=NULL) |
| void | generateImpl (const generationContext &ctx, utility::outputStream &os, const size_t curLinePos=0, size_t *newLinePos=NULL) const |
Protected Member Functions inherited from component | |
| void | setParsedBounds (const size_t start, const size_t end) |
| virtual void | parseImpl (const parsingContext &ctx, shared_ptr< utility::parserInputStreamAdapter > parser, const size_t position, const size_t end, size_t *newPosition=NULL) |
Protected Member Functions inherited from object | |
| object () | |
| object (const object &) | |
| object & | operator= (const object &) |
| virtual | ~object () |
Content encoding (basic type).
| encoding | ( | ) |
Referenced by encoding::decide().
| encoding | ( | const string & | name, |
| const EncodingUsage | usage | ||
| ) |
|
virtual |
Clone this component.
Implements component.
References vmime::dynamicCast().
Replace data in this component by data in other component.
Both components must be of the same type.
| std::bad_cast_exception | if the components are not of the same (dynamic) type |
| other | other component to copy data from |
Implements component.
References vmime::dynamicCast().
Referenced by encoding::operator=().
|
static |
Decide which encoding to use based on the specified data and charset.
| data | data used to determine encoding |
| chset | charset of data |
| usage | context of use of data |
References encoding::decide(), vmime::dynamicCast(), encoding::setUsage(), and encoding::USAGE_TEXT.
|
static |
Decide which encoding to use based on the specified data.
| data | data used to determine encoding |
| usage | context of use of data |
References vmime::encodingTypes::BASE64, vmime::dynamicCast(), encoding::encoding(), and encoding::USAGE_TEXT.
Referenced by htmlTextPart::addObject(), htmlTextPart::addObject(), encoding::decide(), fileAttachment::fileAttachment(), fileAttachment::fileAttachment(), fileAttachment::fileAttachment(), fileAttachment::fileAttachment(), htmlTextPart::generateIn(), and plainTextPart::generateIn().
|
protectedvirtual |
Implements component.
References vmime::dynamicCast().
|
virtual |
Return the list of children of this component.
Implements component.
| shared_ptr< utility::encoder::encoder > getEncoder | ( | ) | const |
Use encoderFactory to obtain an encoder/decoder object for the current encoding type.
| exceptions::no_encoder_available | if no encoder is registered for the encoding |
References vmime::dynamicCast(), component::generate(), encoderFactory::getInstance(), vmime::encodingTypes::QUOTED_PRINTABLE, and encoding::USAGE_TEXT.
Referenced by IMAPMessagePartContentHandler::extract(), streamContentHandler::extract(), stringContentHandler::extract(), IMAPMessagePartContentHandler::generate(), streamContentHandler::generate(), stringContentHandler::generate(), and body::getGeneratedSize().
Return the name of the encoding.
See the constants in vmime::encodingTypes.
| encoding::EncodingUsage getUsage | ( | ) | const |
Return the type of contents this encoding is used for.
See the EncodingUsage enum.
References vmime::dynamicCast().
References encoding::copyFrom().
References stringUtils::toLower(), and encoding::USAGE_UNKNOWN.
References vmime::dynamicCast(), and stringUtils::toLower().
|
protectedvirtual |
Reimplemented from component.
References vmime::dynamicCast(), vmime::end(), component::setParsedBounds(), vmime::encodingTypes::SEVEN_BIT, stringUtils::toLower(), stringUtils::trim(), stringUtils::unquote(), and encoding::USAGE_UNKNOWN.
Set the name of the encoding.
See the constants in vmime::encodingTypes.
| name | name of the encoding |
| void setUsage | ( | const EncodingUsage | usage | ) |
Set the type of contents this encoding is used for.
See the EncodingUsage enum.
| usage | type of contents |
References vmime::dynamicCast().
Referenced by encoding::decide().