예제 #1
0
bool
TrackerString::Contains(const char* string, bool caseSensitivity) const
{
	if (caseSensitivity)
		return FindFirst(string) > -1;
	else
		return IFindFirst(string) > -1;
}
예제 #2
0
bool
TrackerString::StartsWith(const char* string, bool caseSensitivity) const
{
	if (caseSensitivity)
		return FindFirst(string) == 0;
	else
		return IFindFirst(string) == 0;
}
예제 #3
0
BString&
BString::IReplaceFirst(const char* replaceThis, const char* withThis)
{
	if (!replaceThis || !withThis || IFindFirst(replaceThis) < 0)
		return *this;

	if (_MakeWritable() != B_OK)
		return *this;
	return _DoReplace(replaceThis, withThis, 1, 0, IGNORE_CASE);
}
예제 #4
0
BString&
BString::IReplaceAll(const char* replaceThis, const char* withThis,
	int32 fromOffset)
{
	if (!replaceThis || !withThis || IFindFirst(replaceThis) < 0)
		return *this;

	if (_MakeWritable() != B_OK)
		return *this;

	return _DoReplace(replaceThis, withThis, REPLACE_ALL,
		min_clamp0(fromOffset, Length()), IGNORE_CASE);
}
예제 #5
0
int32
TrackerString::IFindFirst(const BString &string, int32 fromOffset) const
{
	return IFindFirst(string.String(), fromOffset);
}
예제 #6
0
int32
TrackerString::IFindFirst(const char* string) const
{
	return IFindFirst(string, 0);
}
예제 #7
0
int32
TrackerString::IFindFirst(const BString &string) const
{
	return IFindFirst(string.String(), 0);
}