mirror of
https://github.com/taglib/taglib.git
synced 2025-07-23 15:34:30 -04:00
Add String:rfind
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@961188 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
@ -293,6 +293,17 @@ int String::find(const String &s, int offset) const
|
||||
return -1;
|
||||
}
|
||||
|
||||
int String::rfind(const String &s, int offset) const
|
||||
{
|
||||
wstring::size_type position =
|
||||
d->data.rfind(s.d->data, offset == -1 ? wstring::npos : offset);
|
||||
|
||||
if(position != wstring::npos)
|
||||
return position;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool String::startsWith(const String &s) const
|
||||
{
|
||||
if(s.length() > length())
|
||||
|
@ -225,6 +225,13 @@ namespace TagLib {
|
||||
*/
|
||||
int find(const String &s, int offset = 0) const;
|
||||
|
||||
/*!
|
||||
* Finds the last occurrence of pattern \a s in this string, searched backwards,
|
||||
* either from the end of the string or starting from \a offset. If the pattern
|
||||
* is not found, -1 is returned.
|
||||
*/
|
||||
int rfind(const String &s, int offset = -1) const;
|
||||
|
||||
/*!
|
||||
* Returns true if the strings starts with the substring \a s.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user