예제 #1
0
t_Str::t_Str(const t_Str &str, size_t start, size_t chars)
{
	init();
	char *ptr = str.getText();
	size_t len = str.getLength();

	if(start >= len)
		return;

	ptr += start;
	len -= start;
	
	if(chars >= len)
		chars = len;

	set(ptr, chars);
}
예제 #2
0
void t_Str::copy(const t_Str &original)
{
	clear();

	if(original.getLength() < minsize)
	{
		content.ministring.length = (unsigned)original.getLength();
		memmove(content.ministring.text, original.getText(), original.getLength() + 1);
		content.ministring.big = false;
		return;
	}

//	ptr = original.getText();
	content.bigstring.length = original.getLength();
	content.bigstring.size = setSize(original.getLength() + 1);
	content.bigstring.text = getSpace(content.bigstring.size);
	content.ministring.big = true;
	memmove(content.bigstring.text, original.getText(), original.getLength() + 1);
}
예제 #3
0
bool t_Str::operator*=(const t_Str &s1) const
{
	return search(s1.getText(), s1.getLength()) != npos;
}
예제 #4
0
size_t t_Str::rfind(const t_Str &str, size_t ind) const
{
	return rfind(str.getText(), ind, str.getLength());
}
예제 #5
0
size_t t_Str::find(const t_Str &str, size_t ind, unsigned instance) const
{
	return find(str.getText(), ind, str.getLength(), instance);
}
예제 #6
0
unsigned t_Str::count(const t_Str &str, size_t ind) const
{
	return count(str.getText(), ind, str.getLength());
}
예제 #7
0
void t_Str::append(const t_Str &str)
{
	append(str.getText(), str.getLength());
}
예제 #8
0
void t_Str::set(const t_Str &str)
{
	set(str.getText(), str.getLength());
}
예제 #9
0
void t_Str::insert(size_t start, const t_Str &s)
{
	insert(start, s.getText(), s.getLength());
}