Qt 4.8
|
The QTextDecoder class provides a state-based decoder. More...
#include <qtextcodec.h>
Public Functions | |
bool | hasFailure () const |
Determines whether the decoder encountered a failure while decoding the input. More... | |
QTextDecoder (const QTextCodec *codec) | |
Constructs a text decoder for the given codec. More... | |
QTextDecoder (const QTextCodec *codec, QTextCodec::ConversionFlags flags) | |
Constructs a text decoder for the given codec and conversion flags. More... | |
QString | toUnicode (const char *chars, int len) |
Converts the first len bytes in chars to Unicode, returning the result. More... | |
QString | toUnicode (const QByteArray &ba) |
Converts the bytes in the byte array specified by ba to Unicode and returns the result. More... | |
void | toUnicode (QString *target, const char *chars, int len) |
The converted string is returned in target. More... | |
~QTextDecoder () | |
Destroys the decoder. More... | |
Properties | |
const QTextCodec * | c |
QTextCodec::ConverterState | state |
The QTextDecoder class provides a state-based decoder.
A text decoder converts text from an encoded text format into Unicode using a specific codec.
The decoder converts text in this format into Unicode, remembering any state that is required between calls.
Definition at line 177 of file qtextcodec.h.
|
inlineexplicit |
QTextDecoder::QTextDecoder | ( | const QTextCodec * | codec, |
QTextCodec::ConversionFlags | flags | ||
) |
Constructs a text decoder for the given codec and conversion flags.
Definition at line 1621 of file qtextcodec.cpp.
QTextDecoder::~QTextDecoder | ( | ) |
bool QTextDecoder::hasFailure | ( | ) | const |
Determines whether the decoder encountered a failure while decoding the input.
Definition at line 1888 of file qtextcodec.cpp.
Referenced by QXmlStreamReaderPrivate::getChar_helper(), and QXmlStreamReaderPrivate::parse().
QString QTextDecoder::toUnicode | ( | const char * | chars, |
int | len | ||
) |
Converts the first len bytes in chars to Unicode, returning the result.
If not all characters are used (e.g. if only part of a multi-byte encoding is at the end of the characters), the decoder remembers enough state to continue with the next call to this function.
Definition at line 1644 of file qtextcodec.cpp.
Referenced by QXmlStreamReaderPrivate::getChar_helper(), and QXmlStreamReaderPrivate::startDocument().
QString QTextDecoder::toUnicode | ( | const QByteArray & | ba | ) |
Converts the bytes in the byte array specified by ba to Unicode and returns the result.
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 1685 of file qtextcodec.cpp.
void QTextDecoder::toUnicode | ( | QString * | target, |
const char * | chars, | ||
int | len | ||
) |
The converted string is returned in target.
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 1657 of file qtextcodec.cpp.
|
private |
Definition at line 188 of file qtextcodec.h.
Referenced by QTextCodec::codecForHtml(), and toUnicode().
|
private |
Definition at line 189 of file qtextcodec.h.
Referenced by hasFailure(), QTextDecoder(), and toUnicode().