Implemented the last function (ReplaceSet()). Now it's just a matter

of doing tests for the remaining functions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1734 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2002-10-28 15:01:32 +00:00
parent bbdc29a05d
commit e0060f3ff2
+9 -1
View File
@@ -1107,7 +1107,15 @@ BString::ReplaceSet(const char *setOfChars, char with)
BString&
BString::ReplaceSet(const char *setOfChars, const char *with)
{
//TODO: Implement
if (with == NULL)
return *this; //TODO: do something smart
int32 pos;
int32 withLen = strlen(with);
while ((pos = strcspn(String(), setofChars)) < Length()) {
_OpenAtBy(pos, withLen - 1);
memcpy(_privateData + pos, with, withLen);
}
return *this;
}