Changeset 7420 in vbox
- Timestamp:
- Mar 10, 2008 4:13:56 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 28854
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/string.h
r7418 r7420 1083 1083 1084 1084 /** 1085 * Performs a case sensitive string compare between two UTF-8 strings. 1086 * 1087 * Encoding errors are ignored by the current implementation. So, the only 1088 * difference between this and the CRT strcmp function is the handling of 1089 * NULL arguments. 1090 * 1091 * @returns < 0 if the first string less than the second string. 1092 * @returns 0 if the first string identical to the second string. 1093 * @returns > 0 if the first string greater than the second string. 1094 * @param psz1 First UTF-8 string. Null is allowed. 1095 * @param psz2 Second UTF-8 string. Null is allowed. 1096 */ 1097 RTDECL(int) RTStrCmp(const char *psz1, const char *psz2); 1098 1099 /** 1085 1100 * Performs a case insensitive string compare between two UTF-8 strings. 1086 1101 * … … 1092 1107 * @returns 0 if the first string identical to the second string. 1093 1108 * @returns > 0 if the first string greater than the second string. 1094 * @param psz1 First UTF-8 string. 1095 * @param psz2 Second UTF-8 string. 1109 * @param psz1 First UTF-8 string. Null is allowed. 1110 * @param psz2 Second UTF-8 string. Null is allowed. 1096 1111 */ 1097 1112 RTDECL(int) RTStrICmp(const char *psz1, const char *psz2); -
trunk/src/VBox/Runtime/common/string/utf-8.cpp
r5999 r7420 964 964 965 965 /** 966 * Performs a case sensitive string compare between two UTF-8 strings. 967 * 968 * Encoding errors are ignored by the current implementation. So, the only 969 * difference between this and the CRT strcmp function is the handling of 970 * NULL arguments. 971 * 972 * @returns < 0 if the first string less than the second string. 973 * @returns 0 if the first string identical to the second string. 974 * @returns > 0 if the first string greater than the second string. 975 * @param psz1 First UTF-8 string. Null is allowed. 976 * @param psz2 Second UTF-8 string. Null is allowed. 977 */ 978 RTDECL(int) RTStrCmp(const char *psz1, const char *psz2) 979 { 980 if (psz1 == psz2) 981 return 0; 982 if (!psz1) 983 return -1; 984 if (!psz2) 985 return 1; 986 987 return strcmp(psz1, psz2); 988 } 989 990 991 /** 966 992 * Performs a case insensitive string compare between two UTF-8 strings. 967 993 * … … 973 999 * @returns 0 if the first string identical to the second string. 974 1000 * @returns > 0 if the first string greater than the second string. 975 * @param psz1 First UTF-8 string. 976 * @param psz2 Second UTF-8 string. 1001 * @param psz1 First UTF-8 string. Null is allowed. 1002 * @param psz2 Second UTF-8 string. Null is allowed. 977 1003 */ 978 1004 RTDECL(int) RTStrICmp(const char *psz1, const char *psz2) 979 1005 { 1006 if (psz1 == psz2) 1007 return 0; 1008 if (!psz1) 1009 return -1; 1010 if (!psz2) 1011 return 1; 1012 980 1013 /** @todo implement proper UTF-8 case-insensitive string comparison. */ 981 1014 #ifdef RT_OS_WINDOWS
Note:
See TracChangeset
for help on using the changeset viewer.