Changeset 18529 in vbox
- Timestamp:
- Mar 30, 2009 11:54:06 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/include/VBox/com/string.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/string.h
r18148 r18529 504 504 } 505 505 506 bool contains (const Utf8Str &that, CaseSensitivity cs = CaseSensitive) const 507 { 508 if (isNull() || that.isNull()) 509 return false; 510 511 char *pszString = ::RTStrDup(str); 512 char *pszTmp; 513 514 /* Create the generic pattern */ 515 ::RTStrAPrintf(&pszTmp, "*%s*", that.str); 516 /* We have to duplicate the strings as long as there is no case 517 * insensitive version of RTStrSimplePatternMatch. */ 518 if (cs == CaseInsensitive) 519 { 520 pszTmp = ::RTStrToLower(pszTmp); 521 pszString = ::RTStrToLower(pszString); 522 } 523 bool fResult = ::RTStrSimplePatternMatch(pszTmp, pszString); 524 RTStrFree(pszTmp); 525 RTStrFree(pszString); 526 527 return fResult; 528 } 529 530 Utf8Str& toLower() 531 { 532 if (isEmpty()) 533 return *this; 534 535 ::RTStrToLower(str); 536 537 return *this; 538 } 539 540 Utf8Str& toUpper() 541 { 542 if (isEmpty()) 543 return *this; 544 545 ::RTStrToUpper(str); 546 547 return *this; 548 } 549 506 550 bool isNull() const { return str == NULL; } 507 551 operator bool() const { return !isNull(); }
Note:
See TracChangeset
for help on using the changeset viewer.

