Public Member Functions | Private Attributes | List of all members
QTextCodecFromIODDecoder Class Reference
Inheritance diagram for QTextCodecFromIODDecoder:
QTextDecoder

Public Member Functions

 QTextCodecFromIODDecoder (const QTextCodecFromIOD *c)
 
QString toUnicode (const char *chars, int len)
 
- Public Member Functions inherited from QTextDecoder
virtual ~QTextDecoder ()
 

Private Attributes

const QTextCodecFromIODcodec
 
QMultiByteUnicodeTablemb
 

Detailed Description

Definition at line 945 of file qtextcodec.cpp.

Constructor & Destructor Documentation

QTextCodecFromIODDecoder::QTextCodecFromIODDecoder ( const QTextCodecFromIOD c)

Definition at line 1228 of file qtextcodec.cpp.

1228  :
1229  codec(c)
1230 {
1232 }
QMultiByteUnicodeTable * mb
Definition: qtextcodec.cpp:947
QMultiByteUnicodeTable * to_unicode_multibyte
Definition: qtextcodec.cpp:966
const QTextCodecFromIOD * codec
Definition: qtextcodec.cpp:946

Member Function Documentation

QString QTextCodecFromIODDecoder::toUnicode ( const char *  chars,
int  len 
)
virtual

Converts the first len bytes at chars to Unicode, returning the result.

If not all characters are used (eg. 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.

Implements QTextDecoder.

Definition at line 1234 of file qtextcodec.cpp.

1235 {
1236  const uchar* uchars = (const uchar*)chars;
1237  QString result;
1238  while (len--) {
1239  QMultiByteUnicodeTable& t = mb[*uchars];
1240  if ( t.multibyte ) {
1241  // Chained multi-byte
1242  mb = t.multibyte;
1243  } else {
1244  if ( t.unicode )
1245  result += QChar(t.unicode);
1247  }
1248  uchars++;
1249  }
1250  return result;
1251 }
QMultiByteUnicodeTable * multibyte
Definition: qtextcodec.cpp:925
QMultiByteUnicodeTable * mb
Definition: qtextcodec.cpp:947
static QCString result
QMultiByteUnicodeTable * to_unicode_multibyte
Definition: qtextcodec.cpp:966
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
The QChar class provides a light-weight Unicode character.
Definition: qstring.h:56
unsigned char uchar
Definition: nybbler.cc:11
const QTextCodecFromIOD * codec
Definition: qtextcodec.cpp:946

Member Data Documentation

const QTextCodecFromIOD* QTextCodecFromIODDecoder::codec
private

Definition at line 946 of file qtextcodec.cpp.

QMultiByteUnicodeTable* QTextCodecFromIODDecoder::mb
private

Definition at line 947 of file qtextcodec.cpp.


The documentation for this class was generated from the following file: