Changeset 7345 in vbox
- Timestamp:
- Mar 6, 2008 9:16:50 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/string.h
r6935 r7345 130 130 int compare (const BSTR str) const 131 131 { 132 return ::RT StrUcs2Cmp ((PRTUCS2) bstr, (PRTUCS2) str);132 return ::RTUtf16Cmp ((PRTUTF16) bstr, (PRTUTF16) str); 133 133 } 134 134 … … 165 165 bool isEmpty() const { return isNull() || *bstr == 0; } 166 166 167 size_t length() const { return isNull() ? 0 : ::RT StrUcs2Len ((PRTUCS2) bstr); }167 size_t length() const { return isNull() ? 0 : ::RTUtf16Len ((PRTUTF16) bstr); } 168 168 169 169 /** Intended to to pass instances as |BSTR| input parameters to methods. */ … … 252 252 if (rs) 253 253 { 254 PRTU CS2s = NULL;255 ::RTStr Utf8ToUcs2 (&s, rs);254 PRTUTF16 s = NULL; 255 ::RTStrToUtf16 (rs, &s); 256 256 raw_copy (ls, (BSTR) s); 257 ::RT StrUcs2Free (s);257 ::RTUtf16Free (s); 258 258 } 259 259 } … … 272 272 /** 273 273 * Helper class that represents UTF8 (|char *|) strings. Useful in 274 * conjunction with Bstr to simplify conversions beetween U CS2(|BSTR|)274 * conjunction with Bstr to simplify conversions beetween UTF16 (|BSTR|) 275 275 * and UTF8. 276 276 * … … 371 371 int compare (const char *s) const 372 372 { 373 return str == s ? 0 : ::strcmp (str, s); 373 if (str == s) 374 return 0; 375 if (str == NULL) 376 return -1; 377 if (s == NULL) 378 return 1; 379 380 return ::strcmp (str, s); 374 381 } 375 382 … … 486 493 { 487 494 #if !defined (VBOX_WITH_XPCOM) 488 ::RT StrUcs2ToUtf8 (&ls, (PRTUCS2) rs);495 ::RTUtf16ToUtf8 ((PRTUTF16) rs, &ls); 489 496 #else 490 497 char *s = NULL; 491 ::RT StrUcs2ToUtf8 (&s, (PRTUCS2) rs);498 ::RTUtf16ToUtf8 ((PRTUTF16) rs, &s); 492 499 raw_copy (ls, s); 493 500 ::RTStrFree (s);
Note:
See TracChangeset
for help on using the changeset viewer.