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


C++ string_t::clear方法代码示例

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


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

示例1:

// Creates a string of neighboring edge pixels.
inline
void
linking_procedure(string_t &string, unsigned char *binary_image, const size_t image_width, const size_t image_height, const int x_ref, const int y_ref, const double half_width, const double half_height)
{
	/* Leandro A. F. Fernandes, Manuel M. Oliveira
	 * Real-time line detection through an improved Hough transform voting scheme
	 * Pattern Recognition (PR), Elsevier, 41:1, 2008, 299-314.
	 *
	 * Algorithm 5
	 */

	int x, y;

	string.clear();
	
	// Find and add feature pixels to the end of the string.
	x = x_ref;
	y = y_ref;
	do
	{
		pixel_t &p = string.push_back();
		
		p.x_index = x;
		p.y_index = y;

		p.x = x - half_width;
		p.y = y - half_height;

		binary_image[y*image_width+x] = 0;
	}
	while (next( x, y, binary_image, image_width, image_height ));

	pixel_t temp;
	for (size_t i=0, j=string.size()-1; i<j; ++i, --j)
	{
		temp = string[i];
		string[i] = string[j];
		string[j] = temp;
	}

	// Find and add feature pixels to the begin of the string.
	x = x_ref;
	y = y_ref;
	if (next( x, y, binary_image, image_width, image_height ))
	{
		do
		{
			pixel_t &p = string.push_back();

			p.x_index = x;
			p.y_index = y;

			p.x = x - half_width;
			p.y = y - half_height;

			binary_image[y*image_width+x] = 0;
		}
		while (next( x, y, binary_image, image_width, image_height ));
	}
}
开发者ID:project-capo,项目名称:amber-java-drivers,代码行数:61,代码来源:linking.cpp

示例2: column_value

void statement::column_value(int column, string_t& value) const
{
	char_t const* str = reinterpret_cast<char_t const*>(
		aux::select(::sqlite3_column_text, ::sqlite3_column_text16)(impl_, column));
	s_.check_last_error();
	if ( str )
	{
		value = str;
	}
	else
	{
		value.clear();
	}
}
开发者ID:XyzalZhang,项目名称:SPlayer,代码行数:14,代码来源:statement.cpp

示例3: ParseValue

	void ParseValue(string_t &val)
	{
		if(!val.empty()&&m_idx.empty())
		{
			if(!_istspace((ushort)*val.rbegin()))
			{//append a blank in order to reserve space for '\0' of the last string.
				val.push_back(_TX(' '));
			}
			_create_arg_index(&val[0],&val[0]+val.size(),m_idx);
			
			if(m_idx.empty()) //if contains no string
				val.clear();
		}
	}
开发者ID:cugwhp,项目名称:FacGraph,代码行数:14,代码来源:argv.cpp


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