當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。