VirtualBox

Changeset 18589 in vbox for trunk/include


Ignore:
Timestamp:
Apr 1, 2009 9:11:02 AM (16 years ago)
Author:
vboxsync
Message:

Main: use RTStrStr & friends

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/string.h

    r18529 r18589  
    506506    bool contains (const Utf8Str &that, CaseSensitivity cs = CaseSensitive) const
    507507    {
    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;
     508        if (cs == CaseSensitive)
     509            return ::RTStrStr (str, that.str) != NULL;
     510        else
     511            return ::RTStrIStr (str, that.str) != NULL;
    528512    }
    529513
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