本文整理汇总了C++中stdString::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ stdString::empty方法的具体用法?C++ stdString::empty怎么用?C++ stdString::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stdString
的用法示例。
在下文中一共展示了stdString::empty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: copy
// Copy samples from archive with index_name
// to new index copy_name.
// Uses all samples in source archive or [start ... end[ .
void copy(const stdString &index_name, const stdString ©_name,
int RTreeM, const epicsTime *start, const epicsTime *end,
const stdString &single_name)
{
IndexFile index(RTreeM), new_index(RTreeM);
IndexFile::NameIterator names;
size_t channel_count = 0, value_count = 0, back_count = 0;
BenchTimer timer;
stdString dir1, dir2;
Filename::getDirname(index_name, dir1);
Filename::getDirname(copy_name, dir2);
if (dir1 == dir2)
{
printf("You have to assert that the new index (%s)\n"
"is in a directory different from the old index\n"
"(%s)\n", copy_name.c_str(), index_name.c_str());
return;
}
index.open(index_name, true);
new_index.open(copy_name, false);
if (verbose)
printf("Copying values from '%s' to '%s'\n",
index_name.c_str(), copy_name.c_str());
RawDataReader reader(index);
if (single_name.empty())
{
bool ok = index.getFirstChannel(names);
while (ok)
{
copy_channel(names.getName(), start, end, index, reader,
new_index, channel_count, value_count, back_count);
ok = index.getNextChannel(names);
}
}
else
copy_channel(single_name, start, end, index, reader,
new_index, channel_count, value_count, back_count);
new_index.close();
index.close();
timer.stop();
if (verbose)
{
printf("Total: %lu channels, %lu values\n",
(unsigned long) channel_count, (unsigned long) value_count);
printf("Skipped %lu back-in-time values\n",
(unsigned long) back_count);
printf("Runtime: %s\n", timer.toString().c_str());
}
}