Name

iswctype, wctype
- wide character classification

Library

libc.lib

Synopsis

  #include <wctype.h>
  int iswctype (wint_t wc, wctype_t charclass);
  wctype_t wctype (const char *property);

Return values

The iswctype function returns non-zero if and only if wc has the property described by charclass, or charclass is zero.

The wctype function returns 0 if property is invalid, otherwise it returns a value of type wctype_t that can be used in subsequent calls to iswctype.


Detailed description

The wctype function returns a value of type wctype_t which represents the requested wide character class and may be used as the second argument for calls to iswctype.

The following character class names are recognised:

alnum  cntrl   ideogram        print   space   xdigit
alpha digit   lower   punct   special
blank graph   phonogram       rune    upper
 

The iswctype function checks whether the wide character wc is in the character class charclass.

The behavior of the iswctype ans wctype is affected by LC_CTYPE category of the current locale.


Examples

Reimplement iswalpha in terms of iswctype and wctype:
int
myiswalpha(wint_t wc)
{
        return (iswctype(wc, wctype("alpha")));
}

         

#include <wchar.h>
/* Illustrates how to use wctype API */
wctype_t example_wctype()
{  
 wctype_t type;
 
  /* get the type by passing the operation string to the wctype API */
 type = wctype("alnum");
  
 /* if the operation is successful then it should return non-zero value */
 /* else returns 0 */
  return type;
}

         


Limitations

The current implementation of iswctype and wctype is dependent on the locale support of SYMBIAN. It doesn’t work for the locales which the SYMBIAN

See also

The iswctype and wctype functions conform to -p1003.1-2001. The "ideogram", "phonogram" "special", and "rune" character classes are extensions.
The iswctype and wctype functions first appeared in 5.0 .

Feedback

For additional information or queries on this page send feedback

© 2005-2007 Nokia

Top