45 #include <QtCore/qstring.h> 46 #include <QtCore/qlist.h> 54 #ifndef QT_NO_TEXTCODEC 80 static void setCodecForCStrings(
QTextCodec *c);
88 bool canEncode(
QChar)
const;
89 bool canEncode(
const QString&)
const;
96 ConvertInvalidToNull = 0x80000000,
104 : flags(f), remainingChars(0), invalidChars(0),
d(0) { state_data[0] = state_data[1] = state_data[2] = 0; }
116 {
return convertToUnicode(in, length, state); }
118 {
return convertFromUnicode(in, length, state); }
128 virtual int mibEnum()
const = 0;
139 static QT3_SUPPORT
QTextCodec* codecForContent(
const char*,
int) {
return 0; }
140 static QT3_SUPPORT
const char* locale();
141 static QT3_SUPPORT
QTextCodec* codecForName(
const char* hint,
int) {
return codecForName(
QByteArray(hint)); }
145 static QT3_SUPPORT
QTextCodec *codecForIndex(
int i) {
return codecForName(availableCodecs().value(i)); }
151 static bool validCodecs();
171 bool hasFailure()
const;
186 bool hasFailure()
const;
192 #endif // QT_NO_TEXTCODEC 198 #endif // QTEXTCODEC_H
#define QT_END_NAMESPACE
This macro expands to.
QTextCodec::ConverterState state
#define Q_DECLARE_FLAGS(Flags, Enum)
The Q_DECLARE_FLAGS() macro expands to.
static QTextCodec * codecForCStrings()
Returns the codec used by QString to convert to and from const char * and QByteArrays.
ConverterState(ConversionFlags f=DefaultConversion)
Constructs a ConverterState object initialized with the given flags.
The QByteArray class provides an array of bytes.
The QTextDecoder class provides a state-based decoder.
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
The QString class provides a Unicode character string.
The QChar class provides a 16-bit Unicode character.
static void setCodecForCStrings(QTextCodec *c)
#define QT_BEGIN_NAMESPACE
This macro expands to.
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global operator|() functions for Flags...
QString toUnicode(const char *in, int length, ConverterState *state=0) const
Converts the first size characters from the input from the encoding of this codec to Unicode...
The QTextEncoder class provides a state-based encoder.
static QTextCodec * codec(MYSQL *mysql)
static QString toUnicode(QTextCodec *tc, const char *str)
QTextDecoder(const QTextCodec *codec)
Constructs a text decoder for the given codec.
QTextCodec::ConverterState state
QByteArray fromUnicode(const QChar *in, int length, ConverterState *state=0) const
Converts the first number of characters from the input array from Unicode to the encoding of this cod...
static QTextCodec * codecForCStrings
QTextEncoder(const QTextCodec *codec)
Constructs a text encoder for the given codec.
static QTextCodec * codecForName(const char *name)
Searches all installed QTextCodec objects and returns the one which best matches name; the match is c...
static QByteArray fromUnicode(QTextCodec *tc, const QString &str)
The QTextCodec class provides conversions between text encodings.
The QIODevice class is the base interface class of all I/O devices in Qt.
static void setCodecForTr(QTextCodec *c)
Q_GUI_EXPORT QTextCodec * codecForHtml(const QByteArray &ba)
This function is defined in the <QTextDocument> header file.