Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions
nsCategoryImp Class Reference

#include <nsCategoryImp.h>

Inheritance diagram for nsCategoryImp:
Inheritance graph
[legend]
Collaboration diagram for nsCategoryImp:
Collaboration graph
[legend]

List of all members.

Public Types

enum  nsUGenCategory {
  kUGenCategory_Mark = 1, kUGenCategory_Number = 2, kUGenCategory_Separator = 3, kUGenCategory_Other = 4,
  kUGenCategory_Letter = 5, kUGenCategory_Punctuation = 6, kUGenCategory_Symbol = 7
}
 Read ftp://ftp.unicode.org/Public/UNIDATA/ReadMe-Latest.txt section GENERAL CATEGORY for the detail defintation of the following categories. More...

Public Member Functions

 nsCategoryImp ()
virtual ~nsCategoryImp ()
NS_IMETHOD Get (PRUnichar aChar, nsUGenCategory *oResult)
 Give a Unichar, return a nsUGenCategory.
NS_IMETHOD Is (PRUnichar aChar, nsUGenCategory aCategory, PRBool *oResult)
 Give a Unichar, and a nsUGenCategory, return PR_TRUE if the Unichar is in that category, return PR_FALSE, otherwise.

Detailed Description

Definition at line 44 of file nsCategoryImp.h.


Member Enumeration Documentation

Read ftp://ftp.unicode.org/Public/UNIDATA/ReadMe-Latest.txt section GENERAL CATEGORY for the detail defintation of the following categories.

Enumerator:
kUGenCategory_Mark 
kUGenCategory_Number 
kUGenCategory_Separator 
kUGenCategory_Other 
kUGenCategory_Letter 
kUGenCategory_Punctuation 
kUGenCategory_Symbol 

Definition at line 61 of file nsIUGenCategory.h.

                {
     kUGenCategory_Mark         = 1, // Mn, Mc, and Me
     kUGenCategory_Number       = 2, // Nd, Nl, and No 
     kUGenCategory_Separator    = 3, // Zs, Zl, and Zp
     kUGenCategory_Other        = 4, // Cc, Cf, Cs, Co, and Cn
     kUGenCategory_Letter       = 5, // Lu, Ll, Lt, Lm, and Lo
     kUGenCategory_Punctuation  = 6, // Pc, Pd, Ps, Pe, Pi, Pf, and Po
     kUGenCategory_Symbol       = 7  // Sm, Sc, Sk, and So
   } nsUGenCategory;

Constructor & Destructor Documentation

Definition at line 48 of file nsCategoryImp.cpp.

{
}

Definition at line 52 of file nsCategoryImp.cpp.

{
}

Member Function Documentation

nsresult nsCategoryImp::Get ( PRUnichar  aChar,
nsUGenCategory oResult 
) [virtual]

Give a Unichar, return a nsUGenCategory.

Implements nsIUGenCategory.

Definition at line 56 of file nsCategoryImp.cpp.

{
   PRUint8 ret = GetCat(aChar);
   if( 0 == ret)
      *oResult = kUGenCategory_Other; // treat it as Cn - Other, Not Assigned
   else 
      *oResult = (nsUGenCategory)ret;
   return NS_OK;
}

Here is the call graph for this function:

nsresult nsCategoryImp::Is ( PRUnichar  aChar,
nsUGenCategory  aCategory,
PRBool oResult 
) [virtual]

Give a Unichar, and a nsUGenCategory, return PR_TRUE if the Unichar is in that category, return PR_FALSE, otherwise.

Implements nsIUGenCategory.

Definition at line 66 of file nsCategoryImp.cpp.

{
   nsUGenCategory cat ;
   PRUint8 ret = GetCat(aChar);
   if( 0 == ret)
      cat = kUGenCategory_Other; // treat it as Cn - Other, Not Assigned
   else 
      cat = (nsUGenCategory)ret;
   *oResult = (aCategory == cat );
   return NS_OK;
}

Here is the call graph for this function:


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