Qt 4.8
|
The QTextEncoder class provides a state-based encoder. More...
#include <qtextcodec.h>
Public Functions | |
QByteArray | fromUnicode (const QString &str) |
Converts the Unicode string str into an encoded QByteArray. More... | |
QByteArray | fromUnicode (const QChar *uc, int len) |
Converts len characters (not bytes) from uc, and returns the result in a QByteArray. More... | |
bool | hasFailure () const |
Determines whether the eecoder encountered a failure while decoding the input. More... | |
QTextEncoder (const QTextCodec *codec) | |
Constructs a text encoder for the given codec. More... | |
QTextEncoder (const QTextCodec *codec, QTextCodec::ConversionFlags flags) | |
Constructs a text encoder for the given codec and conversion flags. More... | |
~QTextEncoder () | |
Destroys the encoder. More... | |
Properties | |
const QTextCodec * | c |
QTextCodec::ConverterState | state |
The QTextEncoder class provides a state-based encoder.
A text encoder converts text from Unicode into an encoded text format using a specific codec.
The encoder converts Unicode into another format, remembering any state that is required between calls.
Definition at line 160 of file qtextcodec.h.
|
inlineexplicit |
QTextEncoder::QTextEncoder | ( | const QTextCodec * | codec, |
QTextCodec::ConversionFlags | flags | ||
) |
Constructs a text encoder for the given codec and conversion flags.
Definition at line 1521 of file qtextcodec.cpp.
QTextEncoder::~QTextEncoder | ( | ) |
QByteArray QTextEncoder::fromUnicode | ( | const QString & | str | ) |
Converts the Unicode string str into an encoded QByteArray.
Definition at line 1551 of file qtextcodec.cpp.
Referenced by QXmlStreamWriterPrivate::checkIfASCIICompatibleCodec(), fromUnicode(), and QXmlStreamWriterPrivate::write().
QByteArray QTextEncoder::fromUnicode | ( | const QChar * | uc, |
int | len | ||
) |
Converts len characters (not bytes) from uc, and returns the result in a QByteArray.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 1566 of file qtextcodec.cpp.
bool QTextEncoder::hasFailure | ( | ) | const |
Determines whether the eecoder encountered a failure while decoding the input.
Definition at line 1543 of file qtextcodec.cpp.
|
private |
Definition at line 173 of file qtextcodec.h.
Referenced by fromUnicode().
|
private |
Definition at line 174 of file qtextcodec.h.
Referenced by fromUnicode(), hasFailure(), and QTextEncoder().