|
||
Interface status: | externallyDefinedApi |
typedef int wctrans_t;
A scalar type that can hold values which represent locale-specific character mappings.
Interface status: | externallyDefinedApi |
typedef unsigned long wctype_t;
A scalar type of a data object that can hold values which represent locale-specific character classification.
Interface status: | externallyDefinedApi |
IMPORT_C int iswalnum(wint_t);
The iswalnum(wint_t)
iswalnum(wint_t)
function tests whether 'i' is a wide alphabet or wide digit i.e. it belongs to class alnum(see defns for definition).
The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.
The functionality of this API is independent of the program's current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class alnum, irrespective of the locale they belong to.
Examples:
#include<wctype.h> //iswalnum()
#include<stdio.h> //printf()
void test_iswalnum()
{
int arr[]={'8',0xe1,'5','Z',0xfd,0xFF12,0xFF19,0xFF71,0x03A3};
int i = 0;
int size = 9;
for( i=0; i<size; i++)
{
int ret = iswalnum(arr[i]); //call to the API with chars in the arr[]
if( (!ret) != 0 )
{
printf("
%lc is not wide alnum", arr[i]);
}
else
{
printf("
%lc is a wide alnum ", arr[i]);
}
}
printf("
");
}
Output
8 is wide alnum
«¡ is wide alnum
5 is wide alnum
Z is wide alnum
«ò is wide alnum
£² is wide alnum
£¹ is wide alnum
± is wide alnum
¦² is wide alnum
|
|
isalnum(int)
isalnum(int)
Tests whether the character is alphabetic or a decimal digit. iswctype(wint_t,wctype_t)
iswctype(wint_t,wctype_t)
...Interface status: | externallyDefinedApi |
IMPORT_C int iswalpha(wint_t);
The iswalpha(wint_t)
iswalpha(wint_t)
function tests whether 'i' is a wide alphabet i.e. it belongs to class alpha (see defns for definition).
The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.
The functionality of this API is independent of the program's current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class alpha, irrespective of the locale they belong to.
Examples:
#include<wctype.h> //iswalpha()
#include<stdio.h> //printf()
void test_iswalpha()
{
int arr[]={'a',0xe1,'5','Z',0xfd, 0x3041,0xFF9D,0x009F,0x007E};
int i = 0;
int size = 9;
for( i=0; i<size; i++)
{
int ret = iswalpha(arr[i]); //call to API with chars in arr[]
if( (!ret) != 0 )
{
printf("
%lc is not wide alphabet", arr[i]);
}
else
{
printf("
%lc is wide alphabet", arr[i]);
}
}
printf("
");
}
Output
a is wide alphabet
«¡ is wide alphabet
5 is not wide alphabet
Z is wide alphabet
«ò is wide alphabet
¤¡ is wide alphabet
Ý is wide alphabet
is not wide alphabet
~ is not wide alphabet
|
|
isalpha(int)
isalpha(int)
Test for an alphabetic character. For Unicode, the function returns TRUE for all...iswctype(wint_t,wctype_t)
iswctype(wint_t,wctype_t)
...Interface status: | externallyDefinedApi |
IMPORT_C int iswblank(wint_t);
The iswblank(wint_t)
iswblank(wint_t)
function tests whether 'i' is a wide-character that belongs to the character class - blank (see defns for definition). The
character class blank contains the character space('') and the horizontal tabulation(' ').
The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.
The functionality of this API is independent of the program's current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class blank, irrespective of the locale they belong to.
Examples:
#include<wctype.h> //iswblank()
#include<stdio.h> //printf()
int test_iswblank()
{
int arr[]={0x0020,'0',0x0009,'R',0x3000, 0x000A, 0x002};
int i = 0;
int size = 7;
for( i=0; i<size; i++)
{
int ret = iswblank(arr[i]); //call to the API with the chars in arr[]
if( (!ret) != 0 )
{
printf("
%lc is not wide blank ", arr[i]);
}
else
{
printf("
%lc is wide blank", arr[i]);
}
}
printf("
");
}
Output
is wide blank
0 is not wide blank
is wide blank
R is not wide blank
¡¡ is wide blank
is not wide blank
is not wide blank
|
|
Interface status: | externallyDefinedApi |
IMPORT_C int iswcntrl(wint_t);
The iswcntrl(wint_t)
iswcntrl(wint_t)
function tests whether 'i' is a wide control character i.e it belongs to class cntrl (see defns for definition).
The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.
The functionality of this API is independent of the program's current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class cntrl, irrespective of the locale they belong to.
The control characters are:
BELL
DELETE
BACKSPACE
LINE FEED
VERTICAL TABULATION
FORM FEED
CARRIAGE RETURN...and the like.
Examples:
#include<wctype.h> //iswcntrl()
#include<stdio.h> //printf()
int test_iswcntrl()
{
int arr[]={0x7F,'9','A','$','\a'};
int i = 0;
int size = 5;
for( i=0; i<size; i++)
{
int ret = iswcntrl(arr[i]); //call to API with chars in arr[]
if( (!ret) != 0 )
{
printf("
%lc is not wide cntrl char ", arr[i]);
}
else
{
printf("
%lc is wide cntrl char", arr[i]);
}
}
printf("
");
}
Output
is wide cntrl char
9 is not wide cntrl char
A is not wide cntrl char
$ is not wide cntrl char
is wide cntrl char
|
|
Interface status: | externallyDefinedApi |
IMPORT_C int iswctype(wint_t, wctype_t);
The iswctype(wint_t,wctype_t)
iswctype(wint_t,wctype_t)
function tests whether the wide-character wch belongs to the character class/category chcl.
The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.
The functionality of this API is independent of the program’s current locale and so it returns non-zero for all the characters
given in ’wch’(of various locales supported) that belong to the class chcl(see _ctype.h
for definition of values that can be used to specify category), irrespective of the locale they belong to.
For example: digits 0 to 9 would belong to _CTYPE_D class (i.e. class digit), and a to z would belong to _CTYPE_L class (i.e. class lower).
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 OS. It doesn't work for the locales which the Symbian OS
|
|
Interface status: | externallyDefinedApi |
IMPORT_C int iswdigit(wint_t);
The iswdigit(wint_t)
iswdigit(wint_t)
function tests whether 'i' is a wide digit. The functionality of this API is independent of the program's current locale
and so it returns non-zero for all the characters (of various locales supported) that belong to the class digit(see defns
for definition), irrespective of the locale they belong to.
For example, the digits 0 to 9 fall under class digit.
Examples:
#include<wctype.h> //iswdigit()
#include<stdio.h> //printf()
void test_iswdigit()
{
int arr[]={'8',0xe1,'5','Z',0xfd,
0xFF12,0xFF19,0xFF71,0x03A3};
int i = 0;
int size = 9;
for( i=0; i<size; i++)
{
int ret = iswdigit(arr[i]); //call to the API with chars in arr[]
if( (!ret) != 0 )
{
printf("
%lc is not a wide digit", arr[i]);
}
else
{
printf("
%lc is a wide digit", arr[i]);
}
}
printf("
");
}
Output
8 is wide digit
«¡ is not wide digit
5 is wide digit
Z is not wide digit
«ò is not wide digit
£² is wide digit
£¹ is wide digit
± is not wide digit
¦² is not wide digit
|
|
isdigit(int)
isdigit(int)
Tests whether the character is a standard decimal digit. For Unicode, this funct...iswctype(wint_t,wctype_t)
iswctype(wint_t,wctype_t)
...Interface status: | externallyDefinedApi |
IMPORT_C int iswgraph(wint_t);
The iswgraph(wint_t)
iswgraph(wint_t)
function tests whether 'wch' is a visible wide-character i.e it belongs to class graph (see defns for definition).
The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.
The functionality of this API is independent of the program's current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class graph, irrespective of the locale they belong to.
Examples:
#include<wctype.h>
#include<stdio.h>
int test_iswgraph()
{
int arr[]={'n','\f', 0xe1, '6', ' '};
int i = 0;
int size = 5;
for( i=0; i<size; i++)
{
int ret = iswgraph(arr[i]);
if( (!ret) != 0 )
{
printf("
%lc is not wide visible char ", arr[i]);
}
else
{
printf("
%lc is wide visible char", arr[i]);
}
}
printf("
");
}
Output
n is wide visible char
is not wide visible char
«¡ is wide visible char
6 is wide visible char
is not wide visible char
|
|
isgraph(int)
isgraph(int)
Tests whether the character is a graphic character. For Unicode, graphic charact...iswctype(wint_t,wctype_t)
iswctype(wint_t,wctype_t)
...Interface status: | externallyDefinedApi |
IMPORT_C int iswlower(wint_t);
The iswlower(wint_t)
iswlower(wint_t)
function tests whether 'i' is a wide-character which is from among lower-case alphabets.
Characters that belong to class cntrl, class punct and digit are not a part of class lower (see defns for definition).
The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.
The functionality of this API is independent of the program's current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class lower(see defns for definition), irrespective of the locale they belong to.
Examples:
#include<wctype.h> //iswlower()
#include<stdio.h> //printf()
int test_iswlower()
{
int arr[]={ 0x0126, 0xee, 'r' , '9' , 'g', 0xFF51, 0x0451, 0x03CE };
int i = 0;
int size = 8;
for( i=0; i<size; i++)
{
int ret = iswlower(arr[i]); //call to the API with chars in arr[]
if( (!ret) != 0 )
{
printf("
%lc is not wide lower-case ", arr[i]);
}
else
{
printf("
%lc is wide lower-case", arr[i]);
}
}
printf("
");
}
Output
©¤ is not wide lower-case
«Â is wide lower-case
r is wide lower-case
9 is not wide lower-case
g is wide lower-case
£ñ is wide lower-case
§× is wide lower-case
¦ü is wide lower-case
|
|
islower(int)
islower(int)
Tests if character is a lowercase letter. iswctype(wint_t,wctype_t)
iswctype(wint_t,wctype_t)
...Interface status: | externallyDefinedApi |
IMPORT_C int iswprint(wint_t);
The iswprint(wint_t)
iswprint(wint_t)
function tests whether 'i' is a wide-character that can be printed i.e it belongs to class print (see defns for definition).
Characters used for representing the alphabets, digits, punctuation characters and space are classified as printable. No characters under class cntrl are printable.
The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.
The functionality of this API is independent of the program's current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class print, irrespective of the locale they belong to.
Examples:
#include<wctype.h> //iswprint()
#include<stdio.h> //printf()
int test_iswprint()
{
int arr[]={'n',', 0xe1, '6', ' '};
int i = 0;
int size = 5;
for( i=0; i<size; i++)
{
int ret = iswprint(arr[i]); //call to the API with chars in the arr[]
if( (!ret) != 0 )
{
printf("
%lc is not wide printable char ", arr[i]);
}
else
{
printf("
%lc is wide printable char", arr[i]);
}
}
printf("
");
}
Output
n is wide printable char
is not wide printable char
«¡ is wide printable char
6 is wide printable char
is wide printable char
|
|
isprint(int)
isprint(int)
Tests whether the character is a printable character. For Unicode, printable cha...iswctype(wint_t,wctype_t)
iswctype(wint_t,wctype_t)
...Interface status: | externallyDefinedApi |
IMPORT_C int iswpunct(wint_t);
The iswpunct(wint_t)
iswpunct(wint_t)
function tests whether 'wch' can be classfied wide punctuation character i.e. it belongs to class punct (see defns for definition)
The characters that can be classified as alphabets, digits, space or control characters do not belong to punctuation wide-character code.
The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.
The functionality of this API is independent of the program's current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class punct, irrespective of the locale they belong to.
Examples:
#include<wctype.h> //iswpunct()
#include<stdio.h> //printf()
int test_iswpunct()
{
int arr[]={0x3003,'3',0x301C,'*', '+'};
int i = 0;
int size = 5;
for( i=0; i<size; i++)
{
int ret = iswpunct(arr[i]);//call to the API with chars in arr[]
if( (!ret) != 0 )
{
printf("
0x%x is not wide punc char ", arr[i]);
}
else
{
printf("
0x%x is a wide punc char", arr[i]);
}
}
printf("
");
}
Output
0x3003 is a wide punc char
0 0x33 is not wide punc char
0x301c is a wide punc char
0x2a is a wide punc char
0x2b is a wide punc char
|
|
ispunct(int)
ispunct(int)
Tests whether the character is a punctuation character. For Unicode, punctuation...iswctype(wint_t,wctype_t)
iswctype(wint_t,wctype_t)
...Interface status: | externallyDefinedApi |
IMPORT_C int iswspace(wint_t);
The iswspace(wint_t)
iswspace(wint_t)
function tests whether 'i' is a wide-character that introduces white-space (see defns for definition)
The following are such characters in the POSIX locale:
SPACE
FORM-FEED
NEWLINE
CARRIAGE-RETURN
TAB
VERTICAL-TAB
The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.
The functionality of this API is independent of the program's current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class space, irrespective of the locale they belong to.
Examples:
#include<wctype.h> //iswspace()
#include<stdio.h> //printf()
int test_iswspace()
{
int arr[]={'\n','0','w','R',0x3000,' ', 0x000A, 0x002};
int i = 0;
int size = 8;
for( i=0; i<size; i++)
{
int ret = iswspace(arr[i]); //call to the API with chars in arr[]
if( (!ret) != 0 )
{
printf("
%lc is not wide space ", arr[i]);
}
else
{
printf("
%lc is wide space", arr[i]);
}
}
printf("
");
}
Output
is wide space
0 is not wide space
w is not wide space
R is not wide space
¡¡ is wide space
is wide space
is wide space
is wide space
|
|
isspace(int)
isspace(int)
Tests whether the character is a white space character. White space includes spa...iswctype(wint_t,wctype_t)
iswctype(wint_t,wctype_t)
...Interface status: | externallyDefinedApi |
IMPORT_C int iswupper(wint_t);
The iswupper(wint_t)
iswupper(wint_t)
function tests whether wch is a wide-character that belongs to upper-case letters, i.e. checks if it belongs to class upper
(see defns for definition).
Characters that belong to class cntrl, punct and digit are not a part of class upper(see defns for definition).
The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.
The functionality of this API is independent of the program's current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class upper, irrespective of the locale they belong to.
Examples:
#include<wctype.h> //iswupper()
#include<stdio.h> //printf()
int test_iswupper()
{
int arr[]={'8',0xe1,'5','Z',0x0126 , 0xFF21 ,'G' , 0x03A4 , 0x00CF };
int i = 0;
int size = 9;
for( i=0; i<size; i++)
{
int ret = iswupper(arr[i]); //call to the API with the chars in arr[]
if( (!ret) != 0 )
{
printf("
%lc is not wide upper-case ", arr[i]);
}
else
{
printf("
%lc is wide upper-case", arr[i]);
}
}
printf("
");
}
Output
8 is not wide upper-case «¡ is not wide upper-case
5 is not wide upper-case
Z is wide upper-case
©¤ is wide upper-case
£Á is wide upper-case
G is wide upper-case
¦³ is wide upper-case
ªÁ is wide upper-case
|
|
isupper(int)
isupper(int)
Tests whether the character is uppercase. iswctype(wint_t,wctype_t)
iswctype(wint_t,wctype_t)
...Interface status: | externallyDefinedApi |
IMPORT_C int iswxdigit(wint_t);
The iswxdigit(wint_t)
iswxdigit(wint_t)
function tests whether 'i' is a wide-character belongs to the set of characters that are used to represent hexadecimal digits.
For example: The characters that can be used to represent hexadecimal values: are - 0,1,2,3,4,5,6,7,8,9 and a,b,c,d,e,f and A,B,C,D,E,F.
Generally, the characters that can be classified as digits are used for the representing hexadecimal values along with one or more sets of continuous characters of other categories that are used to represent the hexadecimal values other than the digits(base 10).
The result of this function is undefined unless the argument is WEOF or a valid wchar_t value.
The functionality of this API is independent of the program's current locale and so it returns non-zero for all the characters (of various locales supported) that belong to the class xdigit (see defns for definition), irrespective of the locale they belong to.
Examples:
#include<wctype.h> //iswxdigit()
#include<stdio.h> //printf()
int test_iswxdigit()
{
int arr[]={'F','a','M','9','2'};
int i = 0;
int size = 5;
for( i=0; i<size; i++)
{
int ret = iswxdigit(arr[i]); //call to the API with the chars in arr[]
if( (!ret) != 0 )
{
printf("
%c is not wide hex-digit ", arr[i]);
}
else
{
printf("
%c is wide hex-digit", arr[i]);
}
}
printf("
");
}
Output
F is wide hex-digit
a is wide hex-digit
M is not wide hex-digit
9 is wide hex-digit
2 is wide hex-digit
|
|
isdigit(int)
isdigit(int)
Tests whether the character is a standard decimal digit. For Unicode, this funct...iswctype(wint_t,wctype_t)
iswctype(wint_t,wctype_t)
...Interface status: | externallyDefinedApi |
IMPORT_C wint_t towctrans(wint_t, wctrans_t);
The wctrans function returns a value of type wctrans_t which represents the requested wide character mapping operation and may be used as the second argument for calls to towctrans .
The following character mapping names are recognised:
tolower toupper
The towctrans function transliterates the wide character wc according to the mapping described by desc .
The behavior of the wctrans and towtrans is affected by LC_CTYPE category of the current locale.
Examples:
#include <wchar.h>
/* Illustrates how to use wctrans API */
wctrans_t example_wctrans()
{
wctrans_t type;
/* get the type by passing the operation string to the wctrans API */
type = wctrans("alnum");
/* if the operation is successful then it should return non-zero value else returns 0 */
return type;
}
# 962 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wctype.dosc" 2
# 963 "d:/EPOC/release/9.4/common/generic/openenv/core/include/wctype.dosc" 2
/* Illustrates how to use towctrans API */
TInt example_towctrans(void)
{
wctrans_t type;
/* get the type by passing the string */
type = wctrans("tolower");
/* if the type is 0 then return an error, else call the API to translate */
if(type == (wctype_t)0)
return -1;
/* translate the input char to specified type */
wint_t twc = towctrans(L'K',type);
/* return no error if conversion is ok else return error */
if(twc != (wint_t)L'k')
return -1;
return 1;
}
Limitations:
The current implementation of wctrans and towtrans is dependent on the locale support of Symbian OS. It doesn't work for the locales which the Symbian OS doesn't support.
|
|
tolower(int)
tolower(int)
Tests whether the character is lowercase. toupper(int)
toupper(int)
Returns the character value after conversion to uppercase or the character's own...wctype(const char *)
wctype(const char *)
Interface status: | externallyDefinedApi |
IMPORT_C wint_t towlower(wint_t);
The towlower function converts an upper-case letter to the corresponding lower-case letter.
The behavior of the towlower is affected by LC_CTYPE category of the current locale.
Examples:
#include <wchar.h>
/* Illustrates how to use towlower API */
wint_t example_towlower(void)
{
/* input character */
wint_t uwc = L'M';
wint_t lwc;
/* convert a wide char from upper case to lower case */
lwc = towlower(uwc);
/* return the converted char or error if not */
return lwc;
}
Limitations:
The current implementation of towlower is dependent on the locale and works only for locales supported by Symbian OS.
|
|
iswlower(wint_t)
iswlower(wint_t)
...tolower(int)
tolower(int)
Tests whether the character is lowercase. towupper(wint_t)
towupper(wint_t)
...wctrans(const char *)
wctrans(const char *)
Interface status: | externallyDefinedApi |
IMPORT_C wint_t towupper(wint_t);
The towupper function converts a lower-case letter to the corresponding upper-case letter.
The behavior of the towupper is affected by LC_CTYPE category of the current locale.
Examples:
#include <wchar.h>
/* Illustrates how to use towupper API */
wint_t example_towupper(void)
{
/* input character */
wint_t lwc = L'm';
wint_t uwc;
/* convert a wide char from lower case to upper case */
uwc = towupper(lwc);
/* return the converted char or error if not */
return uwc;
}
Limitations:
The current implementation of towupper is dependent on the locale and works only for locales supported by Symbian OS.
|
|
iswupper(wint_t)
iswupper(wint_t)
...toupper(int)
toupper(int)
Returns the character value after conversion to uppercase or the character's own...towlower(wint_t)
towlower(wint_t)
...wctrans(const char *)
wctrans(const char *)
Interface status: | externallyDefinedApi |
IMPORT_C wctrans_t wctrans(const char *);
|
|
tolower(int)
tolower(int)
Tests whether the character is lowercase. toupper(int)
toupper(int)
Returns the character value after conversion to uppercase or the character's own...wctype(const char *)
wctype(const char *)
Interface status: | externallyDefinedApi |
IMPORT_C wctype_t wctype(const char *);
|
|