ULAPI  8.0
ulchar.h
1 
7 #ifndef ULCHAR_H
8 #define ULCHAR_H
9 
10 #include "ultypes.h"
11 
12 #ifdef UL_USING_ICU
13 #include "unicode/uchar.h"
14 typedef UChar ulchar;
15 
16 #elif defined(UL_USING_COCOA_STRINGS)
17 # ifdef __OBJC__
18 typedef unichar ulchar;
19 # else
20 typedef uluint16 ulchar;
21 # endif
22 
23 # elif defined(UL_USING_LEGACY_STRINGS)
24 # ifdef UL_USING_32BIT_ULCHAR
25 typedef uluint32 ulchar;
26 # else
27 typedef uluint16 ulchar;
28 # endif
29 
30 #endif
31 
32 class ULLanguage;
33 
34 // Some ulchar functions
35 
40 ulchar ulcharToLower(ulchar ch);
41 
46 ulchar ulcharToUpper(ulchar ch);
47 
54 ulchar ulcharToBase(ulchar ch);
55 
63 ulchar ulcharNormalize(ulchar ch, bool toLower, bool toBase);
64 
70 ulchar ulcharAddAcuteAccent(ulchar ch);
71 
77 ulchar ulcharAddUmlaut(ulchar ch);
78 
84 bool ulcharIsWordChar(ulchar ch);
85 
90 bool ulcharIsAlpha(ulchar ch);
91 
96 bool ulcharIsDigit(ulchar ch);
97 
102 bool ulcharIsHexDigit(ulchar ch);
103 
108 bool ulcharIsSpace(ulchar ch);
109 
114 bool ulcharIsUppercase(ulchar ch);
115 
120 bool ulcharIsLowercase(ulchar ch);
121 
127 bool ulcharIsVowel(ulchar ch, const ULLanguage& language);
128 
133 ulchar ulcharFirstLetterForLanguage(const ULLanguage& language);
134 
143 void ulcharToUTF8(ulchar ch, char *buffer, int& nBytes);
144 
153 void ulcharToUTF16BigEndian(ulchar ch, char *buffer, int& nBytes);
154 
163 void ulcharToUTF16LittleEndian(ulchar ch, char *buffer, int& nBytes);
164 
165 #ifdef UL_USING_LEGACY_STRINGS
166 
171 const char *utf8ToULChar(const char *p, ulchar& ch);
172 #endif
173 
174 #endif // ULCHAR_H
175