Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QMailCodec class provides mechanisms for encoding and decoding between 7-bit ASCII strings and arbitrary octet sequences. More...
#include <QMailCodec>
This class is under development and is subject to change.
Inherited by QMailBase64Codec, QMailLineEndingCodec, QMailPassThroughCodec, and QMailQuotedPrintableCodec.
The QMailCodec class provides mechanisms for encoding and decoding between 7-bit ASCII strings and arbitrary octet sequences.
Messages transferred via the SMTP protocol must be encoded in 7-bit ASCII characters, even though their contents are typically composed in sequences of 8-bit octets. The QMailCodec class provides an interface through which data can be easily converted between an 8-bit octet sequence and a 7-bit ASCII character sequence.
QMailCodec is an abstract class; in order to perform a coding operation, a derived class must be used that provides a policy for mapping 8-bit data to and from 7-bit ASCII characters. This policy is implemented by overriding the encodeChunk() and decodeChunk() virtual functions.
Using the QMailCodec interface, data can be encoded or decoded from an input QDataStream to an output QDataStream, or for convenience, from an input QByteArray to an output QByteArray.
If the data to be encoded is in unicode form, then the QMailCodec interface can be used to convert the data to ASCII via an intermediate QTextCodec, which converts the incoming text to a sequence of octets. The QTextCodec used is specified by the name of the encoding produced, or that decoded when decoding an ASCII input sequence. QMailCodec provides functions to encode from a QTextStream to a QDataStream, and to decode from a QDataStream to a QTextStream. For convenience, it is also possible to encode a QString to a QByteArray, and to decode a QByteArray to a QString.
See also QDataStream, QTextStream, and QTextCodec.
Destroys a QMailCodec instance.
Writes the data read from the stream in to the stream out, without conversion.
This is an overloaded member function, provided for convenience.
Writes the data read from the stream in to the stream out, without conversion.
Writes the data read from the stream in to the stream out, converting from a sequence of 7-bit ASCII characters. The characters read from in are decoded from the text encoding charset to unicode.
See also QTextCodec::codecForName().
This is an overloaded member function, provided for convenience.
Writes the data read from the stream in to the stream out, converting from a sequence of 7-bit ASCII characters.
This is an overloaded member function, provided for convenience.
Returns a QString containing characters decoded from the text encoding charset, which are decoded from the sequence of 7-bit ASCII characters read from input.
See also QTextCodec::codecForName().
This is an overloaded member function, provided for convenience.
Returns a QByteArray containing the octets decoded from the sequence of 7-bit ASCII characters in input.
Overridden by derived classes to perform a decoding operation. The implementation function must decode length ASCII characters at the location input, writing the resulting octets to the stream out. If finalChunk is false, further calls will be made to decodeChunk() with continued input data. Otherwise, the decoding operation is complete.
Writes the data read from the stream in to the stream out, as a sequence of 7-bit ASCII characters. The unicode characters read from in are first encoded to the text encoding charset.
See also QTextCodec::codecForName().
This is an overloaded member function, provided for convenience.
Writes the data read from the stream in to the stream out, as a sequence of 7-bit ASCII characters.
This is an overloaded member function, provided for convenience.
Returns a QByteArray containing the string input, encoded to the text encoding charset and then to a sequence of 7-bit ASCII characters.
See also QTextCodec::codecForName().
This is an overloaded member function, provided for convenience.
Returns a QByteArray containing the octets from input, encoded to a sequence of 7-bit ASCII characters.
Overridden by derived classes to perform an encoding operation. The implementation function must encode length 8-bit octets at the location input, writing the resulting ASCII characters to the stream out. If finalChunk is false, further calls will be made to encodeChunk() with continued input data. Otherwise, the encoding operation is complete.
Copyright © 2009 Nokia | Trademarks | Qt Extended 4.4.3 |