diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-01-08 14:10:31 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-01-08 15:20:37 (GMT) |
commit | d93b2ff9c976a2aea4fb1a7be68565ea0df81ba4 (patch) | |
tree | 228da1deca7a4001d8b3142557216080ee037a73 /src/corelib/codecs/qtextcodec.h | |
parent | 158d63b56da7433ca627ad82635541c3c17c74e1 (diff) | |
download | Qt-d93b2ff9c976a2aea4fb1a7be68565ea0df81ba4.zip Qt-d93b2ff9c976a2aea4fb1a7be68565ea0df81ba4.tar.gz Qt-d93b2ff9c976a2aea4fb1a7be68565ea0df81ba4.tar.bz2 |
Added new functions to QTextCodec that accept ConversionFlags.
In some cases the user might want to pass initial conversion flags that should
be used by the QTextEncoder and QTextDecoder, so added convenience
QTextCodec::makeDecoder and makeEncoder functions that accept those flags as an
argument.
Task-number: QTBUG-7180
Reviewed-by: Thiago
Diffstat (limited to 'src/corelib/codecs/qtextcodec.h')
-rw-r--r-- | src/corelib/codecs/qtextcodec.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/corelib/codecs/qtextcodec.h b/src/corelib/codecs/qtextcodec.h index 6170272..91bccda 100644 --- a/src/corelib/codecs/qtextcodec.h +++ b/src/corelib/codecs/qtextcodec.h @@ -85,9 +85,6 @@ public: static QTextCodec *codecForUtfText(const QByteArray &ba); static QTextCodec *codecForUtfText(const QByteArray &ba, QTextCodec *defaultCodec); - QTextDecoder* makeDecoder() const; - QTextEncoder* makeEncoder() const; - bool canEncode(QChar) const; bool canEncode(const QString&) const; @@ -120,6 +117,12 @@ public: QByteArray fromUnicode(const QChar *in, int length, ConverterState *state = 0) const { return convertFromUnicode(in, length, state); } + // ### Qt 5: merge these functions. + QTextDecoder* makeDecoder() const; + QTextDecoder* makeDecoder(ConversionFlags flags) const; + QTextEncoder* makeEncoder() const; + QTextEncoder* makeEncoder(ConversionFlags flags) const; + virtual QByteArray name() const = 0; virtual QList<QByteArray> aliases() const; virtual int mibEnum() const = 0; @@ -157,6 +160,7 @@ class Q_CORE_EXPORT QTextEncoder { Q_DISABLE_COPY(QTextEncoder) public: explicit QTextEncoder(const QTextCodec *codec) : c(codec), state() {} + QTextEncoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags); ~QTextEncoder(); QByteArray fromUnicode(const QString& str); QByteArray fromUnicode(const QChar *uc, int len); @@ -173,6 +177,7 @@ class Q_CORE_EXPORT QTextDecoder { Q_DISABLE_COPY(QTextDecoder) public: explicit QTextDecoder(const QTextCodec *codec) : c(codec), state() {} + QTextDecoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags); ~QTextDecoder(); QString toUnicode(const char* chars, int len); QString toUnicode(const QByteArray &ba); |