本文整理汇总了C++中StringList::clearAll方法的典型用法代码示例。如果您正苦于以下问题:C++ StringList::clearAll方法的具体用法?C++ StringList::clearAll怎么用?C++ StringList::clearAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringList
的用法示例。
在下文中一共展示了StringList::clearAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dir
// Return all suffix-matched files in the directory 'dirpath'
bool
suffix_matched_files_in_dir(const char *dirpath, StringList &file_list, const char *suffix, bool use_fullname)
{
Directory dir(dirpath);
bool found_it = false;
file_list.clearAll();
const char *f = NULL;
dir.Rewind();
while( (f=dir.Next()) ) {
if( dir.IsDirectory() ) {
continue;
}
if( has_suffix(f, suffix) ) {
if( use_fullname ) {
file_list.append(dir.GetFullPath());
}else {
file_list.append(f);
}
found_it = true;
}
}
return found_it;
}
示例2: initStringListFromAttrs
// copy attrs into stringlist, returns true if list was modified
// if append is false, list is cleared first.
// if check_exist is true, items are only added if the are not already in the list. comparison is case-insensitive.
bool initStringListFromAttrs(StringList & list, bool append, const classad::References & attrs, bool check_exist /*=false*/)
{
bool modified = false;
if ( ! append) {
if ( ! list.isEmpty()) {
modified = true;
list.clearAll();
}
check_exist = false; // no need to do this if we cleared the list
}
for (classad::References::const_iterator it = attrs.begin(); it != attrs.end(); ++it) {
if (check_exist && list.contains_anycase(it->c_str())) {
continue;
}
list.append(it->c_str());
modified = true;
}
return modified;
}