2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FBase_CharacterImpl.h
19 * @brief This is the header file for the _CharacterImpl class.
21 * This header file contains the declarations of the _CharacterImpl class.
23 #ifndef _FBASE_INTERNAL_CHARACTER_IMPL_H_
24 #define _FBASE_INTERNAL_CHARACTER_IMPL_H_
26 #include <FBaseObject.h>
27 #include <FBaseString.h>
28 #include <FBaseCharacter.h>
30 namespace Tizen { namespace Base
37 * This is the destructor for this class.
41 virtual ~_CharacterImpl(void);
44 * Categorizes a Unicode character into a group identified by @n
45 * one of the UnicodeCategory values.
49 * @return A UnicodeCategory value that identifies the group that contains ch
50 * @param[in] ch The Unicode character to categorize
53 static UnicodeCategory GetUnicodeCategory(wchar_t ch);
56 * Converts the input Unicode character to its equivalent lowercase.@n
57 * Unicode characters other than English alphabets are also supported.
61 * @return A lowercase equivalent of the input Unicode character
62 * @param[in] ch A Unicode character to convert
64 static wchar_t ToLowerCase(wchar_t ch);
67 * Converts the input Unicode character to its equivalent uppercase.@n
68 * Unicode characters other than English alphabets are also supported.
72 * @return An uppercase equivalent of the input Unicode character
73 * @param[in] ch A Unicode character to convert
75 static wchar_t ToUpperCase(wchar_t ch);
78 * Checks whether the input character is a digit or not.
81 * @return @c true, if the input character is a digit @n
83 * @param[in] ch A Unicode character
85 static bool IsDigit(wchar_t ch);
88 * Checks whether the input character is an alphabet or not.
91 * @return @c true, if the input character is an alphabet @n
93 * @param[in] ch A Unicode character
95 static bool IsLetter(wchar_t ch);
98 * Checks whether the input character is a lowercase alphabet or not.@n
99 * Unicode characters other than English alphabets are also supported.
103 * @return @c true, if the input character is a lowercase alphabet @n
104 * @c false, otherwise
105 * @param[in] ch A Unicode character
107 static bool IsLowerCase(wchar_t ch);
110 * Checks whether the input character is an uppercase alphabet or not.@n
111 * Unicode characters other than English alphabets are also supported.
115 * @return @c true, if the input character is an uppercase alphabet @n
116 * @c false, otherwise
117 * @param[in] ch A Unicode character
119 static bool IsUpperCase(wchar_t ch);
122 * Returns the value of the input character in the supplied radix. The value of radix must be between RADIX_MIN and RADIX_MAX.
126 * @return ch the character to determine the value
128 * @param[in] radix the radix
130 static int ToDigit(wchar_t ch, int radix);
133 * Returns the character which represents the input digit with specified radix. The value of radix must be between RADIX_MIN and RADIX_MAX.
137 * @return A wide character value in radix if radix lies between RADIX_MIN and RADIX_MAX; null character (U+0000) otherwise
138 * @param[in] digit the digit to determine the value
139 * @param[in] radix the radix
141 static wchar_t ForDigit(int digit, int radix);
144 * 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.
148 * @return A double value; -1 For characters without any numeric values in the Unicode Character
149 * @param[in] ch A Unicode character
151 static double GetNumericValue(wchar_t ch);
154 * Checks whether the input character is defined, which usually means that it is assigned a character in the Unicode.
158 * @return @c true, if the Unicode character is an assigned character @n
159 * @c false, otherwise
160 * @param[in] ch A Unicode character
162 static bool IsDefined(wchar_t ch);
165 * Checks whether the input character is a whitespace character
169 * @return @c true, if the Unicode character is a whitespace character @n
170 * @c false, otherwise
171 * @param[in] ch A Unicode character
173 static bool IsWhitespace(wchar_t ch);
176 * Checks whether the input character is a title character
180 * @return @c true, if the Unicode character is a title character @n
181 * @c false, otherwise
182 * @param[in] ch A Unicode character
184 static bool IsTitleCase(wchar_t ch);
187 * Returns the title case equivalent for the input character if it exists.
191 * @return A title case character equivalent for the input character. The character itself is returned if none is defined.
192 * @param[in] ch A Unicode character
194 static wchar_t ToTitleCase(wchar_t ch);
197 * Checks whether the input character is an ISO control code or not.
201 * @return @c true, if the Unicode character is an ISO control character @n
202 * @c false, otherwise
203 * @param[in] ch A Unicode character
205 static bool IsISOControl(wchar_t ch);
208 * Checks whether the input character is a control code.
210 * @return @c true, if the input character is a control code @n
212 * @param[in] ch A character code
214 static bool IsControl(wchar_t ch);
217 * Returns whether the input character is a punctuation mark or not.
219 * @return @c true, if the input character is a punctuation mark @n
221 * @param[in] ch A character code
223 static bool IsPunctuation(wchar_t ch);
226 * Returns whether the input character is the value between
227 * (0xD800) and (0xF8FF) or not.
229 * @return @c true, if the input character is between (0xD800) and (0xF8FF) @n
231 * @param[in] ch A character code
233 static bool IsSurrogate(wchar_t ch);
236 * Checks whether the input character is the arrow code.
238 * @return @c true, if the input character is the arrow code @n
240 * @param[in] ch A character code
242 static bool IsArrow(wchar_t ch);
245 * Checks whether the input character is a math code.
247 * @return @c true, if the input character is a math code @n
249 * @param[in] ch A character code
251 static bool IsMath(wchar_t ch);
254 * Checks whether the input character is the modifier code.
256 * @return @c true, if the input character is the modifier code @n
258 * @param[in] ch A character code
260 static bool IsModifier(wchar_t ch);
263 * Checks whether the input character is an Hangul code.
265 * @return @c true, if the input character is an Hangul code @n
267 * @param[in] ch A character code
269 static bool IsHangul(wchar_t ch);
272 * Checks whether the input character is a Chinese code.
274 * @return @c true, if the input character is a Chinese code @n
276 * @param[in] ch A character code
278 static bool IsCJK(wchar_t ch);
281 * Checks whether the input character is a Combining code.
283 * @return @c true, if the input character is a Combining code @n
285 * @param[in] ch A character code
287 static bool IsCombining(wchar_t ch);
290 * Checks whether the input character is a language code.
292 * @return @c true, if the input character is a language code @n
294 * @param[in] ch A character code
296 static bool IsLanguage(wchar_t ch);
300 * This is the default constructor for this class.
304 _CharacterImpl(wchar_t value);
307 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
310 * @param[in] rhs An instance of %_CharacterImpl
312 _CharacterImpl& operator =(const _CharacterImpl& rhs);
318 #endif // _FBASE_INTERNAL_CHARACTER_IMPL_H_