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