Exemple #1
0
void   add_debug_info_restrictions (debug::text_tree& root_s, const xr_string& restr)
{
	size_t cur_i = 0;

	do 
	{
		size_t pos = restr.find(',', cur_i);
		if ( pos == xr_string::npos )
		{
			pos = restr.size()-1;
		}

		if ( cur_i > pos )
		{
			

			root_s.add_line(restr.substr(cur_i, pos-cur_i));
		}
		cur_i = pos + 1;

	} while ( cur_i < restr.size() );
}
Exemple #2
0
void IReader::r_stringZ(xr_string& dest)
{
    dest = (char*)(data + Pos);
    Pos += int(dest.size() + 1);
};
Exemple #3
0
bool CUILine::GetWord(Word& w, const xr_string& text, int begin) const{

	if (text.empty())
		return false;

	StrSize first, last, lastsp/*last space*/;
	first  = text.find_first_not_of(' ', begin);
	last   = text.find_first_of(' ', first);
	
	if( npos==last && npos==first )
		return false;

	if( npos==last && npos!=first )
	{
		w.pos		= (int)first;
		w.len		= (int)(text.length()-first);
		w.len_full	= w.len;
		return		true;
	}

	lastsp			= text.find_first_not_of(' ', last);

	if (npos == lastsp && npos == first) // maybe we have string only with spaces
	{
		first		= text.find_first_of(' ',begin);
		last		= text.find_last_of(' ',begin);
		
		if (npos == first) //suxxx it is empty string
			return	false;

		w.pos		= (int)first;
		w.len		= (int)(last - first + 1);
		w.len_full	= w.len;
		return		true;
	}
	

	if (npos == lastsp)
		lastsp = last;
	else
		--lastsp;

	if (npos == last && npos != first)
		last = text.size() - 1;
	else
		--last;

	if (npos == lastsp)
		lastsp = last;

	first = begin;

	w.pos		= (int) first;
	w.len		= (int)(last - first + 1);
	w.len_full	= (int)(lastsp - first + 1);

#ifdef DEBUG
	if (npos != first && (npos == last || npos == lastsp ))
		R_ASSERT2(false,"CUILine::InitPos -- impossible match");
#endif

	return true;        
}