2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FBase_CharacterImpl.h
20 * @brief This is the header file for the _CharacterImpl class.
22 * This header file contains the declarations of the _CharacterImpl class.
25 #ifndef _FBASE_INTERNAL_CHARACTER_IMPL_H_
26 #define _FBASE_INTERNAL_CHARACTER_IMPL_H_
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
30 #include <FBaseCharacter.h>
33 namespace Tizen { namespace Base
40 * This is the destructor for this class.
44 virtual ~_CharacterImpl(void);
47 * Categorizes a Unicode character into a group identified by @n
48 * one of the UnicodeCategory values.
52 * @return A UnicodeCategory value that identifies the group that contains ch
53 * @param[in] ch The Unicode character to categorize
56 static UnicodeCategory GetUnicodeCategory(wchar_t ch);
59 * Converts the input Unicode character to its equivalent lowercase.@n
60 * Unicode characters other than English alphabets are also supported.
64 * @return A lowercase equivalent of the input Unicode character
65 * @param[in] ch A Unicode character to convert
67 static wchar_t ToLowerCase(wchar_t ch);
70 * Converts the input Unicode character to its equivalent uppercase.@n
71 * Unicode characters other than English alphabets are also supported.
75 * @return An uppercase equivalent of the input Unicode character
76 * @param[in] ch A Unicode character to convert
78 static wchar_t ToUpperCase(wchar_t ch);
81 * Checks whether the input character is a digit or not.
84 * @return @c true, if the input character is a digit @n
86 * @param[in] ch A Unicode character
88 static bool IsDigit(wchar_t ch);
91 * Checks whether the input character is an alphabet or not.
94 * @return @c true, if the input character is an alphabet @n
96 * @param[in] ch A Unicode character
98 static bool IsLetter(wchar_t ch);
101 * Checks whether the input character is a lowercase alphabet or not.@n
102 * Unicode characters other than English alphabets are also supported.
106 * @return @c true, if the input character is a lowercase alphabet @n
107 * @c false, otherwise
108 * @param[in] ch A Unicode character
110 static bool IsLowerCase(wchar_t ch);
113 * Checks whether the input character is an uppercase alphabet or not.@n
114 * Unicode characters other than English alphabets are also supported.
118 * @return @c true, if the input character is an uppercase alphabet @n
119 * @c false, otherwise
120 * @param[in] ch A Unicode character
122 static bool IsUpperCase(wchar_t ch);
125 * Returns the value of the input character in the supplied radix. The value of radix must be between RADIX_MIN and RADIX_MAX.
129 * @return ch the character to determine the value
131 * @param[in] radix the radix
133 static int ToDigit(wchar_t ch, int radix);
136 * Returns the character which represents the input digit with specified radix. The value of radix must be between RADIX_MIN and RADIX_MAX.
140 * @return A wide character value in radix if radix lies between RADIX_MIN and RADIX_MAX; null character (U+0000) otherwise
141 * @param[in] digit the digit to determine the value
142 * @param[in] radix the radix
144 static wchar_t ForDigit(int digit, int radix);
147 * Returns the numeric value of the input unicode character. This is used when some numeric values are fractions, negative, or too large for int32_t.
151 * @return A double value; -1 For characters without any numeric values in the Unicode Character
152 * @param[in] ch A Unicode character
154 static double GetNumericValue(wchar_t ch);
157 * Checks whether the input character is defined, which usually means that it is assigned a character in the Unicode.
161 * @return @c true, if the Unicode character is an assigned character @n
162 * @c false, otherwise
163 * @param[in] ch A Unicode character
165 static bool IsDefined(wchar_t ch);
168 * Checks whether the input character is a whitespace character
172 * @return @c true, if the Unicode character is a whitespace character @n
173 * @c false, otherwise
174 * @param[in] ch A Unicode character
176 static bool IsWhitespace(wchar_t ch);
179 * Checks whether the input character is a title character
183 * @return @c true, if the Unicode character is a title character @n
184 * @c false, otherwise
185 * @param[in] ch A Unicode character
187 static bool IsTitleCase(wchar_t ch);
190 * Returns the title case equivalent for the input character if it exists.
194 * @return A title case character equivalent for the input character. The character itself is returned if none is defined.
195 * @param[in] ch A Unicode character
197 static wchar_t ToTitleCase(wchar_t ch);
200 * Checks whether the input character is an ISO control code or not.
204 * @return @c true, if the Unicode character is an ISO control character @n
205 * @c false, otherwise
206 * @param[in] ch A Unicode character
208 static bool IsISOControl(wchar_t ch);
211 * Checks whether the input character is a control code.
213 * @return @c true, if the input character is a control code @n
215 * @param[in] ch A character code
217 static bool IsControl(wchar_t ch);
220 * Returns whether the input character is a punctuation mark or not.
222 * @return @c true, if the input character is a punctuation mark @n
224 * @param[in] ch A character code
226 static bool IsPunctuation(wchar_t ch);
229 * Returns whether the input character is the value between
230 * (0xD800) and (0xF8FF) or not.
232 * @return @c true, if the input character is between (0xD800) and (0xF8FF) @n
234 * @param[in] ch A character code
236 static bool IsSurrogate(wchar_t ch);
239 * Checks whether the input character is the arrow code.
241 * @return @c true, if the input character is the arrow code @n
243 * @param[in] ch A character code
245 static bool IsArrow(wchar_t ch);
248 * Checks whether the input character is a math code.
250 * @return @c true, if the input character is a math code @n
252 * @param[in] ch A character code
254 static bool IsMath(wchar_t ch);
257 * Checks whether the input character is the modifier code.
259 * @return @c true, if the input character is the modifier code @n
261 * @param[in] ch A character code
263 static bool IsModifier(wchar_t ch);
266 * Checks whether the input character is an Hangul code.
268 * @return @c true, if the input character is an Hangul code @n
270 * @param[in] ch A character code
272 static bool IsHangul(wchar_t ch);
275 * Checks whether the input character is a Chinese code.
277 * @return @c true, if the input character is a Chinese code @n
279 * @param[in] ch A character code
281 static bool IsCJK(wchar_t ch);
284 * Checks whether the input character is a Combining code.
286 * @return @c true, if the input character is a Combining code @n
288 * @param[in] ch A character code
290 static bool IsCombining(wchar_t ch);
293 * Checks whether the input character is a language code.
295 * @return @c true, if the input character is a language code @n
297 * @param[in] ch A character code
299 static bool IsLanguage(wchar_t ch);
303 * This is the default constructor for this class.
307 _CharacterImpl(wchar_t value);
310 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
313 * @param[in] rhs An instance of %_CharacterImpl
315 _CharacterImpl& operator =(const _CharacterImpl& rhs);
321 #endif // _FBASE_INTERNAL_CHARACTER_IMPL_H_