VirtualBox

Changeset 1703 in vbox


Ignore:
Timestamp:
Mar 26, 2007 12:44:40 PM (18 years ago)
Author:
vboxsync
Message:

Added case-insensitive UTF-8 string compare (implemented via C library
functions for now).

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/string.h

    r1188 r1703  
    801801 */
    802802RTDECL(int8_t) RTStrToInt8(const char *pszValue);
     803
     804/**
     805 * Performs a case insensitive string compare between two UTF-8 strings.
     806 *
     807 * This is a simplified compare, as only the simplified lower/upper case folding
     808 * specified by the unicode specs are used. It does not consider character pairs
     809 * as they are used in some languages, just simple upper & lower case compares.
     810 *
     811 * @returns < 0 if the first string less than the second string.
     812 * @returns 0 if the first string identical to the second string.
     813 * @returns > 0 if the first string greater than the second string.
     814 * @param   psz1        First UTF-8 string.
     815 * @param   psz2        Second UTF-8 string.
     816 */
     817RTDECL(int) RTStrICmp(const char *psz1, const char *psz2);
    803818
    804819/** @} */
  • trunk/include/iprt/thread.h

    r403 r1703  
    9191 * used to select the scheduling properties.
    9292 *
    93  * The types in are placed in a rought order of ascending priority.
     93 * The types in are placed in a rough order of ascending priority.
    9494 */
    9595typedef enum RTTHREADTYPE
  • trunk/src/VBox/Runtime/utf-8.cpp

    r1 r1703  
    957957}
    958958
     959
     960/**
     961 * Performs a case insensitive string compare between two UTF-8 strings.
     962 *
     963 * This is a simplified compare, as only the simplified lower/upper case folding
     964 * specified by the unicode specs are used. It does not consider character pairs
     965 * as they are used in some languages, just simple upper & lower case compares.
     966 *
     967 * @returns < 0 if the first string less than the second string.
     968 * @returns 0 if the first string identical to the second string.
     969 * @returns > 0 if the first string greater than the second string.
     970 * @param   psz1        First UTF-8 string.
     971 * @param   psz2        Second UTF-8 string.
     972 */
     973RTDECL(int) RTStrICmp(const char *psz1, const char *psz2)
     974{
     975    /** @todo implement proper UTF-8 case-insensitive string comparison. */
     976#ifdef __WIN32__
     977    return stricmp(psz1, psz2);
     978#else /* !__WIN32__ */
     979    return strcasecmp(psz1, psz2);
     980#endif /* !__WIN32__ */
     981}
Note: See TracChangeset for help on using the changeset viewer.

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