You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/man/man3/tqchar.3qt

491 lines
22 KiB

'\" t
.TH TQChar 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQChar \- Lightweight Unicode character
.SH SYNOPSIS
Almost all the functions in this class are reentrant when TQt is built with thread support. The exception is \fBdecomposition\fR(). </p>
.PP
\fC#include <ntqstring.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQChar\fR ()"
.br
.ti -1c
.BI "\fBQChar\fR ( char c )"
.br
.ti -1c
.BI "\fBQChar\fR ( uchar c )"
.br
.ti -1c
.BI "\fBQChar\fR ( uchar c, uchar r )"
.br
.ti -1c
.BI "\fBQChar\fR ( const TQChar & c )"
.br
.ti -1c
.BI "\fBQChar\fR ( ushort rc )"
.br
.ti -1c
.BI "\fBQChar\fR ( short rc )"
.br
.ti -1c
.BI "\fBQChar\fR ( uint rc )"
.br
.ti -1c
.BI "\fBQChar\fR ( int rc )"
.br
.ti -1c
.BI "enum \fBCategory\fR { NoCategory, Mark_NonSpacing, Mark_SpacingCombining, Mark_Enclosing, Number_DecimalDigit, Number_Letter, Number_Other, Separator_Space, Separator_Line, Separator_Paragraph, Other_Control, Other_Format, Other_Surrogate, Other_PrivateUse, Other_NotAssigned, Letter_Uppercase, Letter_Lowercase, Letter_Titlecase, Letter_Modifier, Letter_Other, Punctuation_Connector, Punctuation_Dash, Punctuation_Dask = Punctuation_Dash, Punctuation_Open, Punctuation_Close, Punctuation_InitialQuote, Punctuation_FinalQuote, Punctuation_Other, Symbol_Math, Symbol_Currency, Symbol_Modifier, Symbol_Other }"
.br
.ti -1c
.BI "enum \fBDirection\fR { DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON, DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN }"
.br
.ti -1c
.BI "enum \fBDecomposition\fR { Single, Canonical, Font, NoBreak, Initial, Medial, Final, Isolated, Circle, Super, Sub, Vertical, Wide, Narrow, Small, Square, Compat, Fraction }"
.br
.ti -1c
.BI "enum \fBJoining\fR { OtherJoining, Dual, Right, Center }"
.br
.ti -1c
.BI "enum \fBCombiningClass\fR { Combining_BelowLeftAttached = 200, Combining_BelowAttached = 202, Combining_BelowRightAttached = 204, Combining_LeftAttached = 208, Combining_RightAttached = 210, Combining_AboveLeftAttached = 212, Combining_AboveAttached = 214, Combining_AboveRightAttached = 216, Combining_BelowLeft = 218, Combining_Below = 220, Combining_BelowRight = 222, Combining_Left = 224, Combining_Right = 226, Combining_AboveLeft = 228, Combining_Above = 230, Combining_AboveRight = 232, Combining_DoubleBelow = 233, Combining_DoubleAbove = 234, Combining_IotaSubscript = 240 }"
.br
.ti -1c
.BI "int \fBdigitValue\fR () const"
.br
.ti -1c
.BI "TQChar \fBlower\fR () const"
.br
.ti -1c
.BI "TQChar \fBupper\fR () const"
.br
.ti -1c
.BI "Category \fBcategory\fR () const"
.br
.ti -1c
.BI "Direction \fBdirection\fR () const"
.br
.ti -1c
.BI "Joining \fBjoining\fR () const"
.br
.ti -1c
.BI "bool \fBmirrored\fR () const"
.br
.ti -1c
.BI "TQChar \fBmirroredChar\fR () const"
.br
.ti -1c
.BI "const TQString & \fBdecomposition\fR () const"
.br
.ti -1c
.BI "Decomposition \fBdecompositionTag\fR () const"
.br
.ti -1c
.BI "unsigned char \fBcombiningClass\fR () const"
.br
.ti -1c
.BI "char \fBlatin1\fR () const"
.br
.ti -1c
.BI "ushort \fBunicode\fR () const"
.br
.ti -1c
.BI "ushort & \fBunicode\fR ()"
.br
.ti -1c
.BI "\fBoperator char\fR () const"
.br
.ti -1c
.BI "bool \fBisNull\fR () const"
.br
.ti -1c
.BI "bool \fBisPrint\fR () const"
.br
.ti -1c
.BI "bool \fBisPunct\fR () const"
.br
.ti -1c
.BI "bool \fBisSpace\fR () const"
.br
.ti -1c
.BI "bool \fBisMark\fR () const"
.br
.ti -1c
.BI "bool \fBisLetter\fR () const"
.br
.ti -1c
.BI "bool \fBisNumber\fR () const"
.br
.ti -1c
.BI "bool \fBisLetterOrNumber\fR () const"
.br
.ti -1c
.BI "bool \fBisDigit\fR () const"
.br
.ti -1c
.BI "bool \fBisSymbol\fR () const"
.br
.ti -1c
.BI "uchar \fBcell\fR () const"
.br
.ti -1c
.BI "uchar \fBrow\fR () const"
.br
.in -1c
.SS "Static Public Members"
.in +1c
.ti -1c
.BI "bool networkOrdered () \fI(obsolete)\fR"
.br
.in -1c
.SH RELATED FUNCTION DOCUMENTATION
.in +1c
.ti -1c
.BI "bool \fBoperator==\fR ( TQChar c1, TQChar c2 )"
.br
.ti -1c
.BI "bool \fBoperator==\fR ( char ch, TQChar c )"
.br
.ti -1c
.BI "bool \fBoperator==\fR ( TQChar c, char ch )"
.br
.ti -1c
.BI "int \fBoperator!=\fR ( TQChar c1, TQChar c2 )"
.br
.ti -1c
.BI "int \fBoperator!=\fR ( char ch, TQChar c )"
.br
.ti -1c
.BI "int \fBoperator!=\fR ( TQChar c, char ch )"
.br
.ti -1c
.BI "int \fBoperator<=\fR ( TQChar c1, TQChar c2 )"
.br
.ti -1c
.BI "int \fBoperator<=\fR ( TQChar c, char ch )"
.br
.ti -1c
.BI "int \fBoperator<=\fR ( char ch, TQChar c )"
.br
.ti -1c
.BI "int \fBoperator>=\fR ( TQChar c1, TQChar c2 )"
.br
.ti -1c
.BI "int \fBoperator>=\fR ( TQChar c, char ch )"
.br
.ti -1c
.BI "int \fBoperator>=\fR ( char ch, TQChar c )"
.br
.ti -1c
.BI "int \fBoperator<\fR ( TQChar c1, TQChar c2 )"
.br
.ti -1c
.BI "int \fBoperator<\fR ( TQChar c, char ch )"
.br
.ti -1c
.BI "int \fBoperator<\fR ( char ch, TQChar c )"
.br
.ti -1c
.BI "int \fBoperator>\fR ( TQChar c1, TQChar c2 )"
.br
.ti -1c
.BI "int \fBoperator>\fR ( TQChar c, char ch )"
.br
.ti -1c
.BI "int \fBoperator>\fR ( char ch, TQChar c )"
.br
.in -1c
.SH DESCRIPTION
The TQChar class provides a lightweight Unicode character.
.PP
Unicode characters are (so far) 16-bit entities without any markup or structure. This class represents such an entity. It is lightweight, so it can be used everywhere. Most compilers treat it like a "short int". (In a few years it may be necessary to make TQChar 32-bit when more than 65536 Unicode code points have been defined and come into use.)
.PP
TQChar provides a full complement of testing/classification functions, converting to and from other formats, converting from composed to decomposed Unicode, and trying to compare and case-convert if you ask it to.
.PP
The classification functions include functions like those in ctype.h, but operating on the full range of Unicode characters. They all return TRUE if the character is a certain type of character; otherwise they return FALSE. These classification functions are isNull() (returns TRUE if the character is U+0000), isPrint() (TRUE if the character is any sort of printable character, including whitespace), isPunct() (any sort of punctation), isMark() (Unicode Mark), isLetter (a letter), isNumber() (any sort of numeric character), isLetterOrNumber(), and isDigit() (decimal digits). All of these are wrappers around category() which return the Unicode-defined category of each character.
.PP
TQChar further provides direction(), which indicates the "natural" writing direction of this character. The joining() function indicates how the character joins with its neighbors (needed mostly for Arabic) and finally mirrored(), which indicates whether the character needs to be mirrored when it is printed in its" unnatural" writing direction.
.PP
Composed Unicode characters (like &aring;) can be converted to decomposed Unicode ("a" followed by "ring above") by using decomposition().
.PP
In Unicode, comparison is not necessarily possible and case conversion is very difficult at best. Unicode, covering the" entire" world, also includes most of the world's case and sorting problems. TQt tries, but not very hard: operator==() and friends will do comparison based purely on the numeric Unicode value (code point) of the characters, and upper() and lower() will do case changes when the character has a well-defined upper/lower-case equivalent. There is no provision for locale-dependent case folding rules or comparison; these functions are meant to be fast so they can be used unambiguously in data structures. (See TQString::localeAwareCompare() though.)
.PP
The conversion functions include unicode() (to a scalar), latin1() (to scalar, but converts all non-Latin-1 characters to 0), row() (gives the Unicode row), cell() (gives the Unicode cell), digitValue() (gives the integer value of any of the numerous digit characters), and a host of constructors.
.PP
More information can be found in the document About Unicode.
.PP
See also TQString, QCharRef, and Text Related Classes.
.SS "Member Type Documentation"
.SH "TQChar::Category"
This enum maps the Unicode character categories.
.PP
The following characters are normative in Unicode:
.TP
\fCQChar::Mark_NonSpacing\fR - Unicode class name Mn
.TP
\fCQChar::Mark_SpacingCombining\fR - Unicode class name Mc
.TP
\fCQChar::Mark_Enclosing\fR - Unicode class name Me
.TP
\fCQChar::Number_DecimalDigit\fR - Unicode class name Nd
.TP
\fCQChar::Number_Letter\fR - Unicode class name Nl
.TP
\fCQChar::Number_Other\fR - Unicode class name No
.TP
\fCQChar::Separator_Space\fR - Unicode class name Zs
.TP
\fCQChar::Separator_Line\fR - Unicode class name Zl
.TP
\fCQChar::Separator_Paragraph\fR - Unicode class name Zp
.TP
\fCQChar::Other_Control\fR - Unicode class name Cc
.TP
\fCQChar::Other_Format\fR - Unicode class name Cf
.TP
\fCQChar::Other_Surrogate\fR - Unicode class name Cs
.TP
\fCQChar::Other_PrivateUse\fR - Unicode class name Co
.TP
\fCQChar::Other_NotAssigned\fR - Unicode class name Cn
.PP
The following categories are informative in Unicode:
.TP
\fCQChar::Letter_Uppercase\fR - Unicode class name Lu
.TP
\fCQChar::Letter_Lowercase\fR - Unicode class name Ll
.TP
\fCQChar::Letter_Titlecase\fR - Unicode class name Lt
.TP
\fCQChar::Letter_Modifier\fR - Unicode class name Lm
.TP
\fCQChar::Letter_Other\fR - Unicode class name Lo
.TP
\fCQChar::Punctuation_Connector\fR - Unicode class name Pc
.TP
\fCQChar::Punctuation_Dash\fR - Unicode class name Pd
.TP
\fCQChar::Punctuation_Open\fR - Unicode class name Ps
.TP
\fCQChar::Punctuation_Close\fR - Unicode class name Pe
.TP
\fCQChar::Punctuation_InitialQuote\fR - Unicode class name Pi
.TP
\fCQChar::Punctuation_FinalQuote\fR - Unicode class name Pf
.TP
\fCQChar::Punctuation_Other\fR - Unicode class name Po
.TP
\fCQChar::Symbol_Math\fR - Unicode class name Sm
.TP
\fCQChar::Symbol_Currency\fR - Unicode class name Sc
.TP
\fCQChar::Symbol_Modifier\fR - Unicode class name Sk
.TP
\fCQChar::Symbol_Other\fR - Unicode class name So
.PP
There are two categories that are specific to Qt:
.TP
\fCQChar::NoCategory\fR - used when TQt is dazed and confused and cannot make sense of anything.
.TP
\fCQChar::Punctuation_Dask\fR - old typo alias for Punctuation_Dash
.SH "TQChar::CombiningClass"
This enum type defines names for some of the Unicode combining classes. See the Unicode Standard for a description of the values.
.SH "TQChar::Decomposition"
This enum type defines the Unicode decomposition attributes. See the Unicode Standard for a description of the values.
.SH "TQChar::Direction"
This enum type defines the Unicode direction attributes. See the Unicode Standard for a description of the values.
.PP
In order to conform to C/C++ naming conventions "Dir" is prepended to the codes used in the Unicode Standard.
.SH "TQChar::Joining"
This enum type defines the Unicode joining attributes. See the Unicode Standard for a description of the values.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQChar::TQChar ()"
Constructs a null TQChar (one that isNull()).
.SH "TQChar::TQChar ( char c )"
Constructs a TQChar corresponding to ASCII/Latin-1 character \fIc\fR.
.SH "TQChar::TQChar ( uchar c )"
Constructs a TQChar corresponding to ASCII/Latin-1 character \fIc\fR.
.SH "TQChar::TQChar ( uchar c, uchar r )"
Constructs a TQChar for Unicode cell \fIc\fR in row \fIr\fR.
.SH "TQChar::TQChar ( const TQChar & c )"
Constructs a copy of \fIc\fR. This is a deep copy, if such a lightweight object can be said to have deep copies.
.SH "TQChar::TQChar ( ushort rc )"
Constructs a TQChar for the character with Unicode code point \fIrc\fR.
.SH "TQChar::TQChar ( short rc )"
Constructs a TQChar for the character with Unicode code point \fIrc\fR.
.SH "TQChar::TQChar ( uint rc )"
Constructs a TQChar for the character with Unicode code point \fIrc\fR.
.SH "TQChar::TQChar ( int rc )"
Constructs a TQChar for the character with Unicode code point \fIrc\fR.
.SH "Category TQChar::category () const"
Returns the character category.
.PP
See also Category.
.SH "uchar TQChar::cell () const"
Returns the cell (least significant byte) of the Unicode character.
.SH "unsigned char TQChar::combiningClass () const"
Returns the combining class for the character as defined in the Unicode standard. This is mainly useful as a positioning hint for marks attached to a base character.
.PP
The TQt text rendering engine uses this information to correctly position non spacing marks around a base character.
.SH "const TQString & TQChar::decomposition () const"
\fBWarning:\fR This function is \fInot\fR reentrant.</p>
.PP
Decomposes a character into its parts. Returns TQString::null if no decomposition exists.
.SH "Decomposition TQChar::decompositionTag () const"
Returns the tag defining the composition of the character. Returns TQChar::Single if no decomposition exists.
.SH "int TQChar::digitValue () const"
Returns the numeric value of the digit, or -1 if the character is not a digit.
.SH "Direction TQChar::direction () const"
Returns the character's direction.
.PP
See also Direction.
.SH "bool TQChar::isDigit () const"
Returns TRUE if the character is a decimal digit (Number_DecimalDigit); otherwise returns FALSE.
.SH "bool TQChar::isLetter () const"
Returns TRUE if the character is a letter (Letter_* categories); otherwise returns FALSE.
.SH "bool TQChar::isLetterOrNumber () const"
Returns TRUE if the character is a letter or number (Letter_* or Number_* categories); otherwise returns FALSE.
.SH "bool TQChar::isMark () const"
Returns TRUE if the character is a mark (Mark_* categories); otherwise returns FALSE.
.SH "bool TQChar::isNull () const"
Returns TRUE if the character is the Unicode character 0x0000 (ASCII NUL); otherwise returns FALSE.
.SH "bool TQChar::isNumber () const"
Returns TRUE if the character is a number (of any sort - Number_* categories); otherwise returns FALSE.
.PP
See also isDigit().
.SH "bool TQChar::isPrint () const"
Returns TRUE if the character is a printable character; otherwise returns FALSE. This is any character not of category Cc or Cn.
.PP
Note that this gives no indication of whether the character is available in a particular font.
.SH "bool TQChar::isPunct () const"
Returns TRUE if the character is a punctuation mark (Punctuation_* categories); otherwise returns FALSE.
.SH "bool TQChar::isSpace () const"
Returns TRUE if the character is a separator character (Separator_* categories); otherwise returns FALSE.
.SH "bool TQChar::isSymbol () const"
Returns TRUE if the character is a symbol (Symbol_* categories); otherwise returns FALSE.
.SH "Joining TQChar::joining () const"
\fBWarning:\fR This function is not supported (it may change to use Unicode character classes).
.PP
Returns information about the joining properties of the character (needed for example, for Arabic).
.SH "char TQChar::latin1 () const"
Returns the Latin-1 value of this character, or 0 if it cannot be represented in Latin-1.
.SH "TQChar TQChar::lower () const"
Returns the lowercase equivalent if the character is uppercase; otherwise returns the character itself.
.SH "bool TQChar::mirrored () const"
Returns TRUE if the character is a mirrored character (one that should be reversed if the text direction is reversed); otherwise returns FALSE.
.SH "TQChar TQChar::mirroredChar () const"
Returns the mirrored character if this character is a mirrored character, otherwise returns the character itself.
.SH "bool TQChar::networkOrdered ()\fC [static]\fR"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
.PP
Returns TRUE if this character is in network byte order (MSB first); otherwise returns FALSE. This is platform dependent.
.SH "TQChar::operator char () const"
Returns the Latin-1 character equivalent to the TQChar, or 0. This is mainly useful for non-internationalized software.
.PP
See also unicode().
.SH "uchar TQChar::row () const"
Returns the row (most significant byte) of the Unicode character.
.SH "ushort TQChar::unicode () const"
Returns the numeric Unicode value equal to the TQChar. Normally, you should use TQChar objects as they are equivalent, but for some low-level tasks (e.g. indexing into an array of Unicode information), this function is useful.
.SH "ushort & TQChar::unicode ()"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns a reference to the numeric Unicode value equal to the TQChar.
.SH "TQChar TQChar::upper () const"
Returns the uppercase equivalent if the character is lowercase; otherwise returns the character itself.
.SH RELATED FUNCTION DOCUMENTATION
.SH "int operator!= ( TQChar c1, TQChar c2 )"
Returns TRUE if \fIc1\fR and \fIc2\fR are not the same Unicode character; otherwise returns FALSE.
.SH "int operator!= ( char ch, TQChar c )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if \fIc\fR is not the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator!= ( TQChar c, char ch )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if \fIc\fR is not the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator< ( TQChar c1, TQChar c2 )"
Returns TRUE if the numeric Unicode value of \fIc1\fR is less than that of \fIc2\fR; otherwise returns FALSE.
.SH "int operator< ( TQChar c, char ch )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of \fIc\fR is less than that of the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator< ( char ch, TQChar c )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of the ASCII/Latin-1 character \fIch\fR is less than that of \fIc\fR; otherwise returns FALSE.
.SH "int operator<= ( TQChar c1, TQChar c2 )"
Returns TRUE if the numeric Unicode value of \fIc1\fR is less than that of \fIc2\fR, or they are the same Unicode character; otherwise returns FALSE.
.SH "int operator<= ( TQChar c, char ch )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of \fIc\fR is less than or equal to that of the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator<= ( char ch, TQChar c )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of the ASCII/Latin-1 character \fIch\fR is less than or equal to that of \fIc\fR; otherwise returns FALSE.
.SH "bool operator== ( TQChar c1, TQChar c2 )"
Returns TRUE if \fIc1\fR and \fIc2\fR are the same Unicode character; otherwise returns FALSE.
.SH "bool operator== ( char ch, TQChar c )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if \fIc\fR is the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "bool operator== ( TQChar c, char ch )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if \fIc\fR is the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator> ( TQChar c1, TQChar c2 )"
Returns TRUE if the numeric Unicode value of \fIc1\fR is greater than that of \fIc2\fR; otherwise returns FALSE.
.SH "int operator> ( TQChar c, char ch )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of \fIc\fR is greater than that of the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator> ( char ch, TQChar c )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of the ASCII/Latin-1 character \fIch\fR is greater than that of \fIc\fR; otherwise returns FALSE.
.SH "int operator>= ( TQChar c1, TQChar c2 )"
Returns TRUE if the numeric Unicode value of \fIc1\fR is greater than that of \fIc2\fR, or they are the same Unicode character; otherwise returns FALSE.
.SH "int operator>= ( TQChar c, char ch )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of \fIc\fR is greater than or equal to that of the ASCII/Latin-1 character \fIch\fR; otherwise returns FALSE.
.SH "int operator>= ( char ch, TQChar c )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns TRUE if the numeric Unicode value of the ASCII/Latin-1
character \fIch\fR is greater than or equal to that of \fIc\fR;
otherwise returns FALSE.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qchar.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqchar.3qt) and the Qt
version (3.3.8).