44 #ifdef QT_NO_CAST_FROM_ASCII 45 # undef QT_NO_CAST_FROM_ASCII 47 #ifdef QT_NO_CAST_TO_ASCII 48 # undef QT_NO_CAST_TO_ASCII 60 #ifndef QT_NO_CODEC_FOR_C_STRINGS 61 # ifdef QT_NO_TEXTCODEC 62 # define QT_NO_CODEC_FOR_C_STRINGS 66 #define FLAG(x) (1 << (x)) 479 #ifndef QT_NO_CODEC_FOR_C_STRINGS 493 #ifndef QT_NO_CODEC_FOR_C_STRINGS 1068 (
uint ucs4,
int *length,
int *tag,
unsigned short *buffer)
1084 if (index == 0xffff)
1087 *tag = (*decomposition) & 0xff;
1088 *length = (*decomposition) >> 8;
1089 return decomposition+1;
1111 unsigned short buffer[3];
1140 if (index == 0xffff)
1487 #ifdef Q_COMPILER_MANGLES_RETURN_TYPE 1493 #ifndef QT_NO_CODEC_FOR_C_STRINGS 1498 return ucs > 0xff ? 0 : char(
ucs);
1523 #ifndef QT_NO_CODEC_FOR_C_STRINGS 1531 #ifndef QT_NO_DATASTREAM 1565 #endif // QT_NO_DATASTREAM 1700 unsigned short buffer[3];
1704 const unsigned short *utf16 =
reinterpret_cast<unsigned short *
>(s.
data());
1705 const unsigned short *uc = utf16 + s.
length();
1706 while (uc != utf16 + from) {
1707 uint ucs4 = *(--uc);
1708 if (
QChar(ucs4).isLowSurrogate() && uc != utf16) {
1710 if (
QChar(high).isHighSurrogate()) {
1724 int pos = uc - utf16;
1727 utf16 =
reinterpret_cast<unsigned short *
>(s.
data());
1728 uc = utf16 + pos + length;
1739 {
return u1 < ligature.
u1; }
1741 {
return ligature.
u1 < u1; }
1757 if (0 <= TIndex && TIndex <= Hangul_TCount)
1762 if (index == 0xffff)
1765 ushort length = *ligatures++;
1769 if (r != data + length)
1780 if (from < 0 || s.
length() - from < 2)
1785 int lastCombining = 255;
1787 while (pos < s.
length()) {
1799 lastCombining = 255;
1804 if ((starter == pos - 1 || combining > lastCombining) && starter >= from) {
1808 s[starter] = ligature;
1815 lastCombining = combining;
#define UNICODE_DATA_VERSION
Joining
This enum type defines the Unicode joining attributes.
bool isLetter() const
Returns true if the character is a letter (Letter_* categories); otherwise returns false...
signed short upperCaseDiff
Category
This enum maps the Unicode character categories.
QChar()
Constructs a null QChar ('\0').
#define QT_END_NAMESPACE
This macro expands to.
static ushort ligatureHelper(ushort u1, ushort u2)
int digitValue() const
Returns the numeric value of the digit, or -1 if the character is not a digit.
const QChar at(int i) const
Returns the character at the given index position in the string.
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QTextCodec * codecForCStrings()
Returns the codec used by QString to convert to and from const char * and QByteArrays.
QString & replace(int i, int len, QChar after)
int length() const
Returns the number of characters in this string.
Decomposition decompositionTag() const
Returns the tag defining the composition of the character.
bool isLowSurrogate() const
Returns true if the QChar is the low part of a utf16 surrogate (ie.
Joining joining() const
Returns information about the joining properties of the character (needed for certain languages such ...
int operator<(QChar c1, QChar c2)
Returns true if the numeric Unicode value of c1 is less than that of c2; otherwise returns false...
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qBinaryFind(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
The QString class provides a Unicode character string.
bool isSymbol() const
Returns true if the character is a symbol (Symbol_* categories); otherwise returns false...
bool isHighSurrogate() const
Returns true if the QChar is the high part of a utf16 surrogate (ie.
bool isPrint() const
Returns true if the character is a printable character; otherwise returns false.
QChar toCaseFolded() const
Returns the case folded equivalent of the character.
The QChar class provides a 16-bit Unicode character.
QChar * data()
Returns a pointer to the data stored in the QString.
#define GET_DECOMPOSITION_INDEX(ucs4)
#define GET_LIGATURE_INDEX(u2)
bool isSpace() const
Returns true if the character is a separator character (Separator_* categories); otherwise returns fa...
Category category() const
Returns the character's category.
static ushort highSurrogate(uint ucs4)
Returns the high surrogate value of a ucs4 code point.
static ushort lowSurrogate(uint ucs4)
Returns the low surrogate value of a ucs4 code point.
UnicodeVersion unicodeVersion() const
Returns the Unicode version that introduced this character.
static void decomposeHelper(QString *str, bool canonical, QChar::UnicodeVersion version, int from)
bool hasMirrored() const
Returns true if the character should be reversed if the text direction is reversed; otherwise returns...
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool requiresSurrogates(uint ucs4)
Returns true if the UCS-4-encoded character specified by ucs4 can be split into the high and low part...
#define UNICODE_LAST_CODEPOINT
QByteArray fromUnicode(const QString &uc) const
Converts str from Unicode to the encoding of this codec, and returns the result in a QByteArray...
QChar mirroredChar() const
Returns the mirrored character if this character is a mirrored character; otherwise returns the chara...
static const QUnicodeTables::Properties * qGetProp(uint ucs4)
bool isPunct() const
Returns true if the character is a punctuation mark (Punctuation_* categories); otherwise returns fal...
static const char * data(const QByteArray &arr)
QChar toUpper() const
Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the ch...
QDataStream & operator>>(QDataStream &in, QChar &chr)
Reads a char from the stream in into char chr.
UnicodeVersion
Specifies which version of the [Unicode standard](http://www.
QChar toTitleCase() const
Returns the title case equivalent if the character is lowercase or uppercase; otherwise returns the c...
char toAscii() const
Returns the character value of the QChar obtained using the current codec used to read C strings...
static uint foldCase(const ushort *ch, const ushort *start)
QString toUnicode(const QByteArray &) const
Converts a from the encoding of this codec to Unicode, and returns the result in a QString...
signed short lowerCaseDiff
Direction
This enum type defines the Unicode direction attributes.
signed short titleCaseDiff
static uint surrogateToUcs4(ushort high, ushort low)
Converts a UTF16 surrogate pair with the given high and low values to its UCS-4 code point...
bool isMark() const
Returns true if the character is a mark (Mark_* categories); otherwise returns false.
static void composeHelper(QString *str, QChar::UnicodeVersion version, int from)
static const unsigned short uc_ligature_map[]
The QDataStream class provides serialization of binary data to a QIODevice.
static const unsigned short uc_decomposition_map[]
static UnicodeVersion QT_FASTCALL currentUnicodeVersion()
Returns the most recent supported Unicode version.
Direction direction() const
Returns the character's direction.
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
unsigned char combiningClass() const
Returns the combining class for the character as defined in the Unicode standard. ...
char at(int i) const
Returns the character at index position i in the byte array.
static void canonicalOrderHelper(QString *str, QChar::UnicodeVersion version, int from)
static QChar fromAscii(char c)
Converts the ASCII character c to its equivalent QChar.
QString decomposition() const
Decomposes a character into its parts.
QDataStream & operator<<(QDataStream &out, const QChar &chr)
Writes the char chr to the stream out.
QChar toLower() const
Returns the lowercase equivalent if the character is uppercase or titlecase; otherwise returns the ch...
bool isNumber() const
Returns true if the character is a number (Number_* categories, not just 0-9); otherwise returns fals...
bool isDigit() const
Returns true if the character is a decimal digit (Number_DecimalDigit); otherwise returns false...
signed short caseFoldDiff
static QString fromUtf16(const ushort *, int size=-1)
Returns a QString initialized with the first size characters of the Unicode string unicode (ISO-10646...
bool isLetterOrNumber() const
Returns true if the character is a letter or number (Letter_* or Number_* categories); otherwise retu...
Decomposition
This enum type defines the Unicode decomposition attributes.
static const unsigned short *QT_FASTCALL decompositionHelper(uint ucs4, int *length, int *tag, unsigned short *buffer)