VirtualBox

Changeset 17740 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Mar 12, 2009 12:38:38 PM (16 years ago)
Author:
vboxsync
Message:

Main: adds endsWith compare operation

File:
1 edited

Legend:

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

    r17648 r17740  
    462462    }
    463463
     464    bool endsWith (const Utf8Str &that) const
     465    {
     466        if (length() < that.length())
     467            return false;
     468
     469        int l = length() - that.length();
     470        return ::strcmp (&str[l], that.str) == 0;
     471    }
     472
    464473    bool isNull() const { return str == NULL; }
    465474    operator bool() const { return !isNull(); }
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