Name

Char

Synopsis

class Char:
  

  enum SpecialCharacter { Null =  0x0000, Nbsp =  0x00a0, ReplacementCharacter =  0xfffd, 
                          ObjectReplacementCharacter =  0xfffc, ByteOrderMark =  0xfeff, 
                          ByteOrderSwapped =  0xfffe, ParagraphSeparator =  0x2029, LineSeparator =  0x2028 };

  # This enum maps the Unicode character categories. 
  enum Category { 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 };

  # This enum type defines the Unicode direction attributes. 
  enum Direction { DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, 
                   DirWS, DirON, DirLRE, DirLRO, DirAL, DirRLE, DirRLO, 
                   DirPDF, DirNSM, DirBN };

  # This enum type defines the Unicode decomposition attributes. 
  enum Decomposition { Single, Canonical, Font, NoBreak, Initial, Medial, 
                       Final, Isolated, Circle, Super, Sub, Vertical, Wide, 
                       Narrow, Small, Square, Compat, Fraction };

  # This enum type defines the Unicode joining attributes. 
  enum Joining { OtherJoining, Dual, Right, Center };

  # This enum type defines names for some of the Unicode combining classes. 
  enum CombiningClass { 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 };
  # construct/copy/destruct
  __init__()
  __init__(char)
  __init__(unsigned char)
  __init__(unsigned char, unsigned char)
  __init__(unsigned short)
  __init__(short)
  __init__(int)
  __init__(unsigned int)
  __init__(const QChar &)
  __init__(SpecialCharacter)

  # public member functions

  Category category() const
  Direction direction() const
  Decomposition decompositionTag() const
  Joining joining() const
  unsigned char combiningClass() const
  int digitValue() const
  Char lower() const
  Char upper() const
  bool mirrored() const
  Char mirroredChar() const
  unsigned char latin1() const
  unsigned short unicode() const
  operator unsigned char() const
  operator char() const
  bool isNull() const
  bool isPrint() const
  bool isPunct() const
  bool isSpace() const
  bool isMark() const
  bool isLetter() const
  bool isNumber() const
  bool isLetterOrNumber() const
  bool isDigit() const
  bool isSymbol() const
  unsigned char cell() const
  unsigned char row() const
  bool operator==(Char) const
  bool operator!=(Char) const
  bool operator<=(Char) const
  bool operator>=(Char) const
  bool operator<(Char) const
  bool operator>(Char) const
  operator QChar() const

  static const Char null;
  static const Char replacement;
  static const Char byteOrderMark;
  static const Char byteOrderSwapped;
  static const Char nbsp;

Description

Char construct/copy/destruct

  1. __init__()

    Constructs a null Char (one that isNull()).


  2. __init__(char c)

    Constructs a Char corresponding to ASCII/Latin-1 character c.


  3. __init__(unsigned char c)

    Constructs a QChar corresponding to ASCII/Latin-1 character c.


  4. __init__(unsigned char col, unsigned char row)

    Constructs a QChar for Unicode cell c in row r.


  5. __init__(unsigned short c)

    Constructs a QChar for the character with Unicode code point rc.


  6. __init__(short c)

    Constructs a QChar for the character with Unicode code point rc.


  7. __init__(int c)

    Constructs a QChar for the character with Unicode code point rc.


  8. __init__(unsigned int c)

    Constructs a QChar for the character with Unicode code point rc.


  9. __init__(const QChar & )

    Constructs a copy of c. This is a deep copy, if such a lightweight object can be said to have deep copies.


  10. __init__(SpecialCharacter sc)


Char public member functions

  1. Category category() const

    Returns the character category.


  2. Direction direction() const

    Returns the character's direction.


  3. Decomposition decompositionTag() const

    Decomposes a character into its parts. Returns QString::null if no decomposition exists.


  4. Joining joining() const

    Returns information about the joining properties of the character (needed for example, for Arabic).


  5. unsigned char 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.


  6. int digitValue() const

    Returns the numeric value of the digit or -1 if the character is not a digit.


  7. Char lower() const

    Returns the lowercase equivalent when the character is uppercase. Otherwise returns the character itself.


  8. Char upper() const

    Returns the uppercase equivalent when the character is lowercase. Otherwise returns the character itself.


  9. bool mirrored() const

    Returns TRUE if the character is a mirrored character (should be reversed if the text direction is reversed).


  10. Char mirroredChar() const

    Returns the mirrored character if this character is a mirrored character. Otherwise returns the character itself.


  11. unsigned char latin1() const

    Returns the Latin-1 value of this character, or 0 if it cannot be represented in Latin-1.


  12. unsigned short unicode() const

    Returns the numeric Unicode value.


  13. operator unsigned char() const

    Same as latin1().


  14. operator char() const

    Same as latin1().


  15. bool isNull() const

    Returns TRUE if the character is the Unicode character 0x0000 (ASCII NUL). Otherwise returns FALSE.


  16. bool isPrint() const

    Returns TRUE if the character is a printable character. Otherwise returns FALSE.


  17. bool isPunct() const

    Returns TRUE if the character is a punctuation mark.


  18. bool isSpace() const

    Returns TRUE if the character is a separator character.


  19. bool isMark() const

    Returns TRUE if the character is a mark.


  20. bool isLetter() const

    Returns TRUE if the character is a letter.


  21. bool isNumber() const

    Returns TRUE if the character is a number.


  22. bool isLetterOrNumber() const

    Returns TRUE if the character is a letter or number.


  23. bool isDigit() const

    Returns TRUE if the character is a decimal digit.


  24. bool isSymbol() const

    Returns TRUE if the character is a symbol (Symbol_* categories).


  25. unsigned char cell() const

    Returns the cell (least significant byte) of the Unicode character.


  26. unsigned char row() const

    Returns the row (most significant byte) of the Unicode character.


  27. bool operator==(Char ch) const

    Returns TRUE if the compared are the same Unicode characte.


  28. bool operator!=(Char ch) const

    Returns TRUE if the compared are not the same Unicode character.


  29. bool operator<=(Char ch) const

    Returns TRUE if the numeric Unicode value of the left is less than that of the right or they are the same Unicode character


  30. bool operator>=(Char ch) const

    Returns TRUE if the numeric Unicode value of the left is greater than that of the right or they are the same Unicode character


  31. bool operator<(Char ch) const

    Returns TRUE if the numeric Unicode value of the left is less than that of the right.


  32. bool operator>(Char ch) const

    Returns TRUE if the numeric Unicode value of the left is greater than that of the right.


  33. operator QChar() const

    A conversion to QChar.