QtCore/qtextcodec.h Source File
Go to the documentation of this file.
54 #ifndef QT_NO_TEXTCODEC
88 bool canEncode(
QChar)
const;
89 bool canEncode(
const QString&)
const;
92 QString toUnicode(
const char* chars)
const;
96 ConvertInvalidToNull = 0x80000000,
100 Q_DECLARE_FLAGS(ConversionFlags, ConversionFlag)
104 : flags(
f), remainingChars(0), invalidChars(0), d(0) { state_data[0] = state_data[1] = state_data[2] = 0; }
112 Q_DISABLE_COPY(ConverterState)
116 {
return convertToUnicode(in, length, state); }
118 {
return convertFromUnicode(in, length, state); }
128 virtual int mibEnum()
const = 0;
131 virtual QString convertToUnicode(
const char *
in,
int length, ConverterState *state)
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)); }
149 friend class QTextCodecCleanup;
151 static bool validCodecs();
153 Q_DECLARE_OPERATORS_FOR_FLAGS(QTextCodec::ConversionFlags)
171 bool hasFailure()
const;
183 QString toUnicode(
const char* chars,
int len);
185 void toUnicode(
QString *target,
const char *chars,
int len);
186 bool hasFailure()
const;
192 #endif // QT_NO_TEXTCODEC
198 #endif // QTEXTCODEC_H
static void setCodecForCStrings(QTextCodec *c)
QTextDecoder(const QTextCodec *codec)
QByteArray fromUnicode(const QChar *in, int length, ConverterState *state=0) const
QTextEncoder(const QTextCodec *codec)
#define QT_BEGIN_NAMESPACE
static QTextCodec * codecForCStrings()
QString toUnicode(const char *in, int length, ConverterState *state=0) const
GLuint GLsizei GLsizei * length
Q_GUI_EXPORT QTextCodec * codecForHtml(const QByteArray &ba)
GLsizei const GLfloat * value
ConverterState(ConversionFlags f=DefaultConversion)
GLuint const GLchar * name
static void setCodecForTr(QTextCodec *c)
static QTextCodec * codecForName(const char *name)