Changeset 51770 in vbox for trunk/src/VBox/Runtime/common/string/utf-8-case.cpp
- Timestamp:
- Jul 1, 2014 6:14:02 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 94611
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/bird/hardenedwindows (added) merged: 92692-94610
- Property svn:mergeinfo changed
-
trunk/src/VBox
- Property svn:mergeinfo changed
/branches/bird/hardenedwindows/src/VBox (added) merged: 92692-94610
- Property svn:mergeinfo changed
-
trunk/src/VBox/Runtime/common/string/utf-8-case.cpp
r48935 r51770 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - UTF-8 Case Sensitivity and Folding .3 * IPRT - UTF-8 Case Sensitivity and Folding, Part 1. 4 4 */ 5 5 … … 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 we346 * find something that can be folded.347 */348 RTUNICP uc;349 do350 {351 int rc = RTStrGetCpEx(&psz, &uc);352 if (RT_SUCCESS(rc))353 {354 if (RTUniCpIsFoldable(uc))355 return true;356 }357 else358 {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 do376 {377 int rc = RTStrGetCpEx(&psz, &uc);378 if (RT_SUCCESS(rc))379 {380 if (RTUniCpIsLower(uc))381 return false;382 }383 else384 {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 do402 {403 int rc = RTStrGetCpEx(&psz, &uc);404 if (RT_SUCCESS(rc))405 {406 if (RTUniCpIsUpper(uc))407 return false;408 }409 else410 {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
Note:
See TracChangeset
for help on using the changeset viewer.