Changeset 46010 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- May 13, 2013 11:28:22 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/utf-8-case.cpp
r33562 r46010 339 339 RT_EXPORT_SYMBOL(RTStrToUpper); 340 340 341 342 RTDECL(bool) RTStrIsCaseFoldable(const char *psz) 343 { 344 /* 345 * Loop the code points in the string, checking them one by one until we 346 * find something that can be folded. 347 */ 348 RTUNICP uc; 349 do 350 { 351 int rc = RTStrGetCpEx(&psz, &uc); 352 if (RT_SUCCESS(rc)) 353 { 354 if (RTUniCpIsFoldable(uc)) 355 return true; 356 } 357 else 358 { 359 /* bad encoding, just skip it quietly (uc == RTUNICP_INVALID (!= 0)). */ 360 AssertRC(rc); 361 } 362 } while (uc != 0); 363 364 return false; 365 } 366 RT_EXPORT_SYMBOL(RTStrIsCaseFoldable); 367 368 369 RTDECL(bool) RTStrIsUpperCased(const char *psz) 370 { 371 /* 372 * Check that there are no lower case chars in the string. 373 */ 374 RTUNICP uc; 375 do 376 { 377 int rc = RTStrGetCpEx(&psz, &uc); 378 if (RT_SUCCESS(rc)) 379 { 380 if (RTUniCpIsLower(uc)) 381 return false; 382 } 383 else 384 { 385 /* bad encoding, just skip it quietly (uc == RTUNICP_INVALID (!= 0)). */ 386 AssertRC(rc); 387 } 388 } while (uc != 0); 389 390 return true; 391 } 392 RT_EXPORT_SYMBOL(RTStrIsUpperCased); 393 394 395 RTDECL(bool) RTStrIsLowerCased(const char *psz) 396 { 397 /* 398 * Check that there are no lower case chars in the string. 399 */ 400 RTUNICP uc; 401 do 402 { 403 int rc = RTStrGetCpEx(&psz, &uc); 404 if (RT_SUCCESS(rc)) 405 { 406 if (RTUniCpIsUpper(uc)) 407 return false; 408 } 409 else 410 { 411 /* bad encoding, just skip it quietly (uc == RTUNICP_INVALID (!= 0)). */ 412 AssertRC(rc); 413 } 414 } while (uc != 0); 415 416 return true; 417 } 418 RT_EXPORT_SYMBOL(RTStrIsLowerCased); 419 420
Note:
See TracChangeset
for help on using the changeset viewer.