本文整理汇总了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 ));
}
}
示例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();
}
}
示例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();
}
}