VirtualBox

Ignore:
Timestamp:
Jul 1, 2014 6:14:02 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94611
Message:

Merged in iprt++ dev branch.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/VBox

  • trunk/src/VBox/Runtime/common/string/utf-8-case.cpp

    r48935 r51770  
    11/* $Id$ */
    22/** @file
    3  * IPRT - UTF-8 Case Sensitivity and Folding.
     3 * IPRT - UTF-8 Case Sensitivity and Folding, Part 1.
    44 */
    55
     
    339339RT_EXPORT_SYMBOL(RTStrToUpper);
    340340
    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 
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette