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:
@@ -1107,7 +1107,15 @@ BString::ReplaceSet(const char *setOfChars, char with)
|
|||||||
BString&
|
BString&
|
||||||
BString::ReplaceSet(const char *setOfChars, const char *with)
|
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;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user