void DataProvider::searchFile(){
struct dirent *ptr;
DIR *dir;
const char *path=filePath.c_str();
dir=opendir(path);
while((ptr=readdir(dir))!=NULL){
//filePrefix=IC|IF|IH
if(filePrefix.size()==2){
if(ptr->d_name[0]=='I'&&ptr->d_name[1]==filePrefix[1]){
string docName=ptr->d_name;
readDocs.push_back(docName.substr(0,6));
}
}
//filePrefix=*,means all
else{
if((ptr->d_name[0]='I')&&
(ptr->d_name[1]=='C'|ptr->d_name[1]=='F'|ptr->d_name[1]=='H')){
string docName=ptr->d_name;
readDocs.push_back(docName.substr(0,6));
}
}
}
}
C++便利文件夹下文件
最新推荐文章于 2023-04-12 11:14:29 发布