当前位置: 首页>>代码示例>>C++>>正文


C++ xr_string::size方法代码示例

本文整理汇总了C++中xr_string::size方法的典型用法代码示例。如果您正苦于以下问题:C++ xr_string::size方法的具体用法?C++ xr_string::size怎么用?C++ xr_string::size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xr_string的用法示例。


在下文中一共展示了xr_string::size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: while

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() );
}
开发者ID:2asoft,项目名称:xray,代码行数:22,代码来源:base_monster_debug.cpp

示例2: r_stringZ

void IReader::r_stringZ(xr_string& dest)
{
    dest = (char*)(data + Pos);
    Pos += int(dest.size() + 1);
};
开发者ID:BubbaXXX,项目名称:xray-16,代码行数:5,代码来源:FS.cpp

示例3: GetWord

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;        
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:63,代码来源:UILine.cpp


注:本文中的xr_string::size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。