@@ -18,22 +18,40 @@ LoadMapping::~LoadMapping()
|
||||
|
||||
bool LoadMapping::load(const QString &loadDir,const QString &matchdDir,const QString &exceptionFile)
|
||||
{
|
||||
|
||||
if(LoadMapping::ht->keys().length()>0)
|
||||
{
|
||||
return true;//只执行一次
|
||||
}
|
||||
if(!QFileInfo::exists(loadDir)|!QFileInfo::exists(matchdDir)|!QFileInfo::exists(exceptionFile))
|
||||
if(!QFileInfo::exists(loadDir))
|
||||
{
|
||||
std::cout<<"load file not exists."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
if(!QFileInfo::exists(matchdDir))
|
||||
{
|
||||
std::cout<<"match file not exists."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
if(!QFileInfo::exists(exceptionFile))
|
||||
{
|
||||
std::cout<<"match file not exists."<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!this->readMatch(matchdDir))
|
||||
{
|
||||
std::cout<<"read match failed"<<std::endl;
|
||||
return false;
|
||||
}
|
||||
this->loadMatchException.init(exceptionFile);
|
||||
|
||||
if(!this->readLoads(loadDir))
|
||||
{
|
||||
std::cout<<"read load failed"<<std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
@@ -57,6 +75,12 @@ bool LoadMapping::readLoads(const QString &dir)
|
||||
continue;
|
||||
}
|
||||
QString fileName=fileInfo.baseName();
|
||||
|
||||
if(this->loadMatchException.contains(fileName))
|
||||
{
|
||||
std::cout<<"ignore "<<fileName.toLocal8Bit().data()<<std::endl;
|
||||
continue;
|
||||
}
|
||||
if(!this->loadsToLoadInfo.contains(fileName))
|
||||
{
|
||||
std::cout<<filePath.toLocal8Bit().data()<<" no match."<<std::endl;
|
||||
|
||||
Reference in New Issue
Block a user