1ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/*
2ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru**********************************************************************
364339d36f8bd4db5025fe2988eda22b491a9219cFredrik Roubert* Copyright (C) 2016 and later: Unicode, Inc. and others.
464339d36f8bd4db5025fe2988eda22b491a9219cFredrik Roubert* License & terms of use: http://www.unicode.org/copyright.html#License
564339d36f8bd4db5025fe2988eda22b491a9219cFredrik Roubert**********************************************************************
664339d36f8bd4db5025fe2988eda22b491a9219cFredrik Roubert**********************************************************************
7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* Copyright (c) 2002-2006, International Business Machines
8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* Corporation and others.  All Rights Reserved.
9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru**********************************************************************
10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru**********************************************************************
11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*/
12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#ifndef _CHARPERF_H
13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define _CHARPERF_H
14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/uchar.h"
16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/uperf.h"
18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include <stdlib.h>
19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include <stdio.h>
20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include <wchar.h>
21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include <wctype.h>
22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querutypedef void (*CharPerfFn)(UChar32 ch);
24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querutypedef void (*StdLibCharPerfFn)(wchar_t ch);
25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass CharPerfFunction : public UPerfFunction
27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querupublic:
29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual void call(UErrorCode* status)
30ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    {
31ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        for (UChar32 i = MIN_; i < MAX_; i ++) {
32ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru            (*m_fn_)(i);
33ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        }
34ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    }
35ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
36ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual long getOperationsPerIteration()
37ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    {
38ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        return MAX_ - MIN_;
39ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    }
40ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    CharPerfFunction(CharPerfFn func, UChar32 min, UChar32 max)
41ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    {
42ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        m_fn_ = func;
43ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        MIN_ = min;
44ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        MAX_ = max;
45ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    }
46ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
47ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruprivate:
48ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    CharPerfFn m_fn_;
49ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UChar32 MIN_;
50ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UChar32 MAX_;
51ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru};
52ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
53ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass StdLibCharPerfFunction : public UPerfFunction
54ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
55ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querupublic:
56ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual void call(UErrorCode* status)
57ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    {
58ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        // note wchar_t is unsigned, it will revert to 0 once it reaches
59ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        // 65535
60ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        for (wchar_t i = MIN_; i < MAX_; i ++) {
61ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru            (*m_fn_)(i);
62ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        }
63ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    }
64ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
65ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual long getOperationsPerIteration()
66ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    {
67ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        return MAX_ - MIN_;
68ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    }
69ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
70ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    StdLibCharPerfFunction(StdLibCharPerfFn func, wchar_t min, wchar_t max)
71ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    {
72ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        m_fn_ = func;
73ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        MIN_ = min;
74ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        MAX_ = max;
75ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    }
76ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
77ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    ~StdLibCharPerfFunction()
78ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    {
79ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    }
80ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
81ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruprivate:
82ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    StdLibCharPerfFn m_fn_;
83ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    wchar_t MIN_;
84ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    wchar_t MAX_;
85ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru};
86ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
87ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruclass CharPerformanceTest : public UPerfTest
88ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
89ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Querupublic:
90ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    CharPerformanceTest(int32_t argc, const char *argv[], UErrorCode &status);
91ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    ~CharPerformanceTest();
92ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    virtual UPerfFunction* runIndexedTest(int32_t index, UBool exec,
93ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        const char *&name,
94ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru        char *par = NULL);
95ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestIsAlpha();
96ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestIsUpper();
97ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestIsLower();
98ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestIsDigit();
99ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestIsSpace();
100ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestIsAlphaNumeric();
101ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestIsPrint();
102ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestIsControl();
103ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestToLower();
104ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestToUpper();
105ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestIsWhiteSpace();
106ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestStdLibIsAlpha();
107ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestStdLibIsUpper();
108ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestStdLibIsLower();
109ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestStdLibIsDigit();
110ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestStdLibIsSpace();
111ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestStdLibIsAlphaNumeric();
112ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestStdLibIsPrint();
113ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestStdLibIsControl();
114ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestStdLibToLower();
115ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestStdLibToUpper();
116ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UPerfFunction* TestStdLibIsWhiteSpace();
117ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
118ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruprivate:
119ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UChar32 MIN_;
120ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    UChar32 MAX_;
121ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru};
122ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
123ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void isAlpha(UChar32 ch)
124ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
125ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    u_isalpha(ch);
126ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
127ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
128ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void isUpper(UChar32 ch)
129ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
130ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    u_isupper(ch);
131ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
132ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
133ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void isLower(UChar32 ch)
134ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
135ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    u_islower(ch);
136ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
137ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
138ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void isDigit(UChar32 ch)
139ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
140ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    u_isdigit(ch);
141ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
142ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
143ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void isSpace(UChar32 ch)
144ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
145ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    u_isspace(ch);
146ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
147ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
148ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void isAlphaNumeric(UChar32 ch)
149ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
150ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    u_isalnum(ch);
151ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
152ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
153ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/**
154ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* This test may be different since c lib has a type PUNCT and it is printable.
155ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* iswgraph is not used for testing since it is a subset of iswprint with the
156ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* exception of returning true for white spaces. no match found in icu4c.
157ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*/
158ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void isPrint(UChar32 ch)
159ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
160ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    u_isprint(ch);
161ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
162ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
163ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void isControl(UChar32 ch)
164ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
165ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    u_iscntrl(ch);
166ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
167ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
168ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void toLower(UChar32 ch)
169ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
170ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    u_tolower(ch);
171ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
172ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
173ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void toUpper(UChar32 ch)
174ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
175ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    u_toupper(ch);
176ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
177ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
178ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void isWhiteSpace(UChar32 ch)
179ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
180ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    u_isWhitespace(ch);
181ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
182ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
183ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void StdLibIsAlpha(wchar_t ch)
184ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
185ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    iswalpha(ch);
186ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
187ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
188ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void StdLibIsUpper(wchar_t ch)
189ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
190ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    iswupper(ch);
191ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
192ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
193ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void StdLibIsLower(wchar_t ch)
194ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
195ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    iswlower(ch);
196ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
197ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
198ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void StdLibIsDigit(wchar_t ch)
199ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
200ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    iswdigit(ch);
201ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
202ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
203ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void StdLibIsSpace(wchar_t ch)
204ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
205ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    iswspace(ch);
206ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
207ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
208ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void StdLibIsAlphaNumeric(wchar_t ch)
209ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
210ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    iswalnum(ch);
211ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
212ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
213ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/**
214ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* This test may be different since c lib has a type PUNCT and it is printable.
215ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* iswgraph is not used for testing since it is a subset of iswprint with the
216ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* exception of returning true for white spaces. no match found in icu4c.
217ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*/
218ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void StdLibIsPrint(wchar_t ch)
219ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
220ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    iswprint(ch);
221ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
222ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
223ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void StdLibIsControl(wchar_t ch)
224ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
225ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    iswcntrl(ch);
226ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
227ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
228ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void StdLibToLower(wchar_t ch)
229ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
230ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    towlower(ch);
231ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
232ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
233ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void StdLibToUpper(wchar_t ch)
234ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
235ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    towupper(ch);
236ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
237ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
238ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queruinline void StdLibIsWhiteSpace(wchar_t ch)
239ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{
240ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    iswspace(ch);
241ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru}
242ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
243ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif // CHARPERF_H
244