Qt 4.8
Public Functions | Protected Variables | List of all members
QUtf32Codec Class Reference

#include <qutfcodec_p.h>

Inheritance diagram for QUtf32Codec:
QTextCodec QUtf32BECodec QUtf32LECodec

Public Functions

QList< QByteArrayaliases () const
 Subclasses can return a number of aliases for the codec in question. More...
 
QByteArray convertFromUnicode (const QChar *, int, ConverterState *) const
 QTextCodec subclasses must reimplement this function. More...
 
QString convertToUnicode (const char *, int, ConverterState *) const
 QTextCodec subclasses must reimplement this function. More...
 
int mibEnum () const
 Subclasses of QTextCodec must reimplement this function. More...
 
QByteArray name () const
 QTextCodec subclasses must reimplement this function. More...
 
 QUtf32Codec ()
 
 ~QUtf32Codec ()
 
- Public Functions inherited from QTextCodec
bool canEncode (QChar) const
 Returns true if the Unicode character ch can be fully encoded with this codec; otherwise returns false. More...
 
bool canEncode (const QString &) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.s contains the string being tested for encode-ability. More...
 
QByteArray fromUnicode (const QString &uc) const
 Converts str from Unicode to the encoding of this codec, and returns the result in a QByteArray. More...
 
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 codec, and returns the result in a QByteArray. More...
 
QTextDecodermakeDecoder () const
 Creates a QTextDecoder which stores enough state to decode chunks of char * data to create chunks of Unicode data. More...
 
QTextDecodermakeDecoder (ConversionFlags flags) const
 
QTextEncodermakeEncoder () const
 Creates a QTextEncoder which stores enough state to encode chunks of Unicode data as char * data. More...
 
QTextEncodermakeEncoder (ConversionFlags flags) const
 
QString toUnicode (const QByteArray &) const
 Converts a from the encoding of this codec to Unicode, and returns the result in a QString. More...
 
QString toUnicode (const char *chars) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.chars contains the source characters. More...
 
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, and returns the result in a QString. More...
 

Protected Variables

DataEndianness e
 

Additional Inherited Members

- Public Types inherited from QTextCodec
enum  ConversionFlag { DefaultConversion, ConvertInvalidToNull = 0x80000000, IgnoreHeader = 0x1, FreeFunction = 0x2 }
 
- Static Public Functions inherited from QTextCodec
static QList< QByteArrayavailableCodecs ()
 Returns the list of all available codecs, by name. More...
 
static QList< int > availableMibs ()
 Returns the list of MIBs for all available codecs. More...
 
static QTextCodeccodecForCStrings ()
 Returns the codec used by QString to convert to and from const char * and QByteArrays. More...
 
static QTextCodeccodecForHtml (const QByteArray &ba)
 Tries to detect the encoding of the provided snippet of HTML in the given byte array, ba, by checking the BOM (Byte Order Mark) and the content-type meta header and returns a QTextCodec instance that is capable of decoding the html to unicode. More...
 
static QTextCodeccodecForHtml (const QByteArray &ba, QTextCodec *defaultCodec)
 Tries to detect the encoding of the provided snippet of HTML in the given byte array, ba, by checking the BOM (Byte Order Mark) and the content-type meta header and returns a QTextCodec instance that is capable of decoding the html to unicode. More...
 
static QTextCodeccodecForLocale ()
 Returns a pointer to the codec most suitable for this locale. More...
 
static QTextCodeccodecForMib (int mib)
 Returns the QTextCodec which matches the MIBenum mib. More...
 
static QTextCodeccodecForName (const QByteArray &name)
 Searches all installed QTextCodec objects and returns the one which best matches name; the match is case-insensitive. More...
 
static QTextCodeccodecForName (const char *name)
 Searches all installed QTextCodec objects and returns the one which best matches name; the match is case-insensitive. More...
 
static QTextCodeccodecForTr ()
 Returns the codec used by QObject::tr() on its argument. More...
 
static QTextCodeccodecForUtfText (const QByteArray &ba)
 Tries to detect the encoding of the provided snippet ba by using the BOM (Byte Order Mark) and returns a QTextCodec instance that is capable of decoding the text to unicode. More...
 
static QTextCodeccodecForUtfText (const QByteArray &ba, QTextCodec *defaultCodec)
 Tries to detect the encoding of the provided snippet ba by using the BOM (Byte Order Mark) and returns a QTextCodec instance that is capable of decoding the text to unicode. More...
 
static void setCodecForCStrings (QTextCodec *c)
 
static void setCodecForLocale (QTextCodec *c)
 Set the codec to c; this will be returned by codecForLocale(). More...
 
static void setCodecForTr (QTextCodec *c)
 
- Protected Functions inherited from QTextCodec
 QTextCodec ()
 Constructs a QTextCodec, and gives it the highest precedence. More...
 
virtual ~QTextCodec ()
 Destroys the QTextCodec. More...
 

Detailed Description

Definition at line 133 of file qutfcodec_p.h.

Constructors and Destructors

◆ QUtf32Codec()

QUtf32Codec::QUtf32Codec ( )
inline

Definition at line 135 of file qutfcodec_p.h.

135 { e = DetectEndianness; }
DataEndianness e
Definition: qutfcodec_p.h:146

◆ ~QUtf32Codec()

QUtf32Codec::~QUtf32Codec ( )

Definition at line 606 of file qutfcodec.cpp.

607 {
608 }

Functions

◆ aliases()

QList< QByteArray > QUtf32Codec::aliases ( ) const
virtual

Subclasses can return a number of aliases for the codec in question.

Standard aliases for codecs can be found in the IANA character-sets encoding file.

Reimplemented from QTextCodec.

Reimplemented in QUtf32LECodec, and QUtf32BECodec.

Definition at line 630 of file qutfcodec.cpp.

631 {
632  QList<QByteArray> list;
633  return list;
634 }

◆ convertFromUnicode()

QByteArray QUtf32Codec::convertFromUnicode ( const QChar input,
int  number,
ConverterState state 
) const
virtual

QTextCodec subclasses must reimplement this function.

Converts the first number of characters from the input array from Unicode to the encoding of the subclass, and returns the result in a QByteArray.

state can be 0 in which case the conversion is stateless and default conversion rules should be used. If state is not 0, the codec should save the state after the conversion in state, and adjust the remainingChars and invalidChars members of the struct.

Implements QTextCodec.

Definition at line 610 of file qutfcodec.cpp.

611 {
612  return QUtf32::convertFromUnicode(uc, len, state, e);
613 }
static QByteArray convertFromUnicode(const QChar *, int, QTextCodec::ConverterState *, DataEndianness=DetectEndianness)
Definition: qutfcodec.cpp:388
DataEndianness e
Definition: qutfcodec_p.h:146

◆ convertToUnicode()

QString QUtf32Codec::convertToUnicode ( const char *  chars,
int  len,
ConverterState state 
) const
virtual

QTextCodec subclasses must reimplement this function.

Converts the first len characters of chars from the encoding of the subclass to Unicode, and returns the result in a QString.

state can be 0, in which case the conversion is stateless and default conversion rules should be used. If state is not 0, the codec should save the state after the conversion in state, and adjust the remainingChars and invalidChars members of the struct.

Implements QTextCodec.

Definition at line 615 of file qutfcodec.cpp.

616 {
617  return QUtf32::convertToUnicode(chars, len, state, e);
618 }
static QString convertToUnicode(const char *, int, QTextCodec::ConverterState *, DataEndianness=DetectEndianness)
Definition: qutfcodec.cpp:444
DataEndianness e
Definition: qutfcodec_p.h:146

◆ mibEnum()

int QUtf32Codec::mibEnum ( ) const
virtual

Subclasses of QTextCodec must reimplement this function.

It returns the MIBenum (see IANA character-sets encoding file for more information). It is important that each QTextCodec subclass returns the correct unique value for this function.

Implements QTextCodec.

Reimplemented in QUtf32LECodec, and QUtf32BECodec.

Definition at line 620 of file qutfcodec.cpp.

621 {
622  return 1017;
623 }

◆ name()

QByteArray QUtf32Codec::name ( ) const
virtual

QTextCodec subclasses must reimplement this function.

It returns the name of the encoding supported by the subclass.

If the codec is registered as a character set in the IANA character-sets encoding file this method should return the preferred mime name for the codec if defined, otherwise its name.

Implements QTextCodec.

Reimplemented in QUtf32LECodec, and QUtf32BECodec.

Definition at line 625 of file qutfcodec.cpp.

626 {
627  return "UTF-32";
628 }

Properties

◆ e

DataEndianness QUtf32Codec::e
protected

Definition at line 146 of file qutfcodec_p.h.


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