257 Tests whether the character is the C/C++ end-of-string character - 0. |
250 Tests whether the character is the C/C++ end-of-string character - 0. |
258 |
251 |
259 @return True, if the character is 0; false, otherwise. |
252 @return True, if the character is 0; false, otherwise. |
260 */ |
253 */ |
261 {return(iChar==0);} |
254 {return(iChar==0);} |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 inline TBool TChar::IsSupplementary(TUint aChar) |
|
260 /** |
|
261 @param aChar The 32-bit code point value of a Unicode character. |
|
262 |
|
263 @return True, if aChar is supplementary character; false, otherwise. |
|
264 */ |
|
265 { |
|
266 return (aChar > 0xFFFF); |
|
267 } |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 inline TBool TChar::IsSurrogate(TText16 aInt16) |
|
273 /** |
|
274 @return True, if aText16 is high surrogate or low surrogate; false, otherwise. |
|
275 */ |
|
276 { |
|
277 return (aInt16 & 0xF800) == 0xD800; |
|
278 } |
|
279 |
|
280 |
|
281 |
|
282 |
|
283 inline TBool TChar::IsHighSurrogate(TText16 aInt16) |
|
284 /** |
|
285 @return True, if aText16 is high surrogate; false, otherwise. |
|
286 */ |
|
287 { |
|
288 return (aInt16 & 0xFC00) == 0xD800; |
|
289 } |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 inline TBool TChar::IsLowSurrogate(TText16 aInt16) |
|
295 /** |
|
296 @return True, if aText16 is low surrogate; false, otherwise. |
|
297 */ |
|
298 { |
|
299 return (aInt16 & 0xFC00) == 0xDC00; |
|
300 } |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 inline TUint TChar::JoinSurrogate(TText16 aHighSurrogate, TText16 aLowSurrogate) |
|
306 /** |
|
307 Combine a high surrogate and a low surrogate into a supplementary character. |
|
308 |
|
309 @return The 32-bit code point value of the generated Unicode supplementary |
|
310 character. |
|
311 */ |
|
312 { |
|
313 return ((aHighSurrogate - 0xD7F7) << 10) + aLowSurrogate; |
|
314 } |
|
315 |
|
316 |
|
317 |
|
318 |
|
319 inline TText16 TChar::GetHighSurrogate(TUint aChar) |
|
320 /** |
|
321 Retrieve the high surrogate of a supplementary character. |
|
322 |
|
323 @param aChar The 32-bit code point value of a Unicode character. |
|
324 |
|
325 @return High surrogate of aChar, if aChar is a supplementary character; |
|
326 aChar itself, if aChar is not a supplementary character. |
|
327 |
|
328 @see TChar::GetLowSurrogate |
|
329 */ |
|
330 { |
|
331 return STATIC_CAST(TText16, 0xD7C0 + (aChar >> 10)); |
|
332 } |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 inline TText16 TChar::GetLowSurrogate(TUint aChar) |
|
338 /** |
|
339 Retrieve the low surrogate of a supplementary character. |
|
340 |
|
341 @param aChar The 32-bit code point value of a Unicode character. |
|
342 |
|
343 @return Low surrogate of aChar, if aChar is a supplementary character; |
|
344 zero, if aChar is not a supplementary character. |
|
345 |
|
346 @see TChar::GetHighSurrogate |
|
347 */ |
|
348 { |
|
349 return STATIC_CAST(TText16, 0xDC00 | (aChar & 0x3FF)); |
|
350 } |
262 #endif // _UNICODE |
351 #endif // _UNICODE |
263 |
352 |
264 |
353 |
265 |
354 |
266 |
355 |