|
VMime
|
#include <charset.hpp>


Static Public Member Functions | |
| static const charset | getLocalCharset () |
| static void | convert (const string &in, string &out, const charset &source, const charset &dest, const charsetConverterOptions &opts=charsetConverterOptions()) |
| static void | convert (utility::inputStream &in, utility::outputStream &out, const charset &source, const charset &dest, const charsetConverterOptions &opts=charsetConverterOptions()) |
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 () |
Charset description (basic type).
| charset | ( | ) |
References stringUtils::isStringEqualNoCase().
|
virtual |
Clone this component.
Implements component.
References vmime::dynamicCast().
|
static |
Convert a string buffer from one charset to another charset (in-memory conversion)
| in | input buffer |
| out | output buffer |
| source | input charset |
| dest | output charset |
| opts | conversion options |
| exceptions::illegal_byte_sequence_for_charset | if an illegal byte sequence was found in the input bytes, and the 'silentlyReplaceInvalidSequences' flag is set to false in the charsetConverterOptions |
| exceptions::charset_conv_error | if an unexpected error occurred during the conversion |
References charsetConverter::create(), and vmime::dynamicCast().
Referenced by charsetConverter_idna::convert(), courierMaildirFormat::fromModifiedUTF7(), word::getConvertedText(), and wordEncoder::wordEncoder().
|
static |
Convert the contents of an input stream in a specified charset to another charset and write the result to an output stream.
| in | input stream to read data from |
| out | output stream to write the converted data |
| source | input charset |
| dest | output charset |
| opts | conversion options |
| exceptions::illegal_byte_sequence_for_charset | if an illegal byte sequence was found in the input bytes, and the 'silentlyReplaceInvalidSequences' flag is set to false in the charsetConverterOptions |
| exceptions::charset_conv_error | if an unexpected error occurred during the conversion |
References charsetConverter::create(), and 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.
Referenced by charset::operator=().
|
protectedvirtual |
Implements component.
References vmime::dynamicCast().
|
virtual |
Return the list of children of this component.
Implements component.
Returns the default charset used on the system.
This function simply calls platformHandler::getLocalCharset() and is provided for convenience.
References platform::getHandler(), and charset::getLocalCharset().
Referenced by charset::getLocalCharset(), word::operator=(), and text::text().
Return the ISO name of the charset.
Referenced by charset::getRecommendedEncoding(), and IMAPCommand::SEARCH().
Gets the recommended encoding for this charset.
Note: there may be no recommended encoding.
| enc | output parameter that will hold recommended encoding |
References vmime::dynamicCast(), vmime::g_charsetEncodingMap, charset::getName(), and stringUtils::toLower().
Referenced by wordEncoder::guessBestEncoding(), and wordEncoder::isEncodingNeeded().
Checks whether the specified text is valid in this charset.
| text | input text |
| firstInvalidByte | if the function returns false, will contain the index of the first invalid byte in the string. Can be NULL if not used. |
References charsetConverter::create(), vmime::dynamicCast(), and charsetConverterOptions::silentlyReplaceInvalidSequences.
References vmime::dynamicCast().
References charset::copyFrom().
References vmime::dynamicCast(), and stringUtils::isStringEqualNoCase().
|
protectedvirtual |
Reimplemented from component.
References vmime::dynamicCast(), vmime::end(), stringUtils::isStringEqualNoCase(), component::setParsedBounds(), and stringUtils::trim().