本文整理汇总了C++中FileInfo::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ FileInfo::GetName方法的具体用法?C++ FileInfo::GetName怎么用?C++ FileInfo::GetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileInfo
的用法示例。
在下文中一共展示了FileInfo::GetName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PassesFilterByFilename
bool FileInfosFilter::PassesFilterByFilename(const FileInfo& fi) const {
// Use regex engine:
if (query_->UseRegex) {
if (!helpers::Utf16ToUtf8(fi.GetName(), buffer_.get(), kBufferSize)) return false;
return re2::RE2::PartialMatch(buffer_.get(), *re_);
}
// Use Indexer++ implemented search (only with * ):
if (filename_filter_->MinLength == 0) {
return true;
}
if (fi.NameLength < filename_filter_->MinLength) {
return false;
}
if (filename_filter_->NChars.size() == 0) // No wildcards.
{
return search(fi.GetName(), filename_filter_->Strs[0], match_case_table_) != nullptr;
}
int index = 0;
for (auto i = 0; i < filename_filter_->NStrs; ++i) {
auto* res = search(fi.GetName() + index, filename_filter_->Strs[i], match_case_table_);
if (res == nullptr) return false;
index = (res - fi.GetName()) + filename_filter_->StrLengths[i];
}
return true;
}
示例2: PassesFilterByFilename
// TODO implement ? wildcard.
bool FileInfosFilter::PassesFilterByFilename(const FileInfo& fi) const {
if (filename_filter_->MinLength == 0) {
return true;
}
if (fi.NameLength < filename_filter_->MinLength) {
return false;
}
if (filename_filter_->NChars.size() == 0) // No wildcards.
{
return search(fi.GetName(), filename_filter_->Strs[0], match_case_table_) != nullptr;
}
int index = 0;
for (auto i = 0; i < filename_filter_->NStrs; ++i) {
auto* res = search(fi.GetName() + index, filename_filter_->Strs[i], match_case_table_);
if (res == nullptr) return false;
index = (res - fi.GetName()) + filename_filter_->StrLengths[i];
}
return true;
}
示例3: operator
__forceinline void operator()(const FileInfo& file){
if(file.IsDirectory()){
int namesize = CurrentDestPath.size();
CurrentDestPath.append(file.GetName());
CurrentDestPath.push_back('/');
CurrentPath /= file.cFileName;
namesize = CurrentDestPath.size()-namesize;
//lambda recursion fun times
//ForEachFile(CurrentPath, foreachFunc);
//CurrentPath.remove_filename()
//shrink the path back down one directory
CurrentPathS.resize(CurrentPathS.size()-namesize);
CurrentDestPath.resize(CurrentDestPath.size()-namesize);
}else{
CurrentPath/file.cFileName;
}
}