diff --git a/testHasttable/loadmapping.cpp b/testHasttable/loadmapping.cpp index 2ae4731..e0725fd 100644 --- a/testHasttable/loadmapping.cpp +++ b/testHasttable/loadmapping.cpp @@ -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."<readMatch(matchdDir)) { + std::cout<<"read match failed"<loadMatchException.init(exceptionFile); + if(!this->readLoads(loadDir)) { + std::cout<<"read load failed"<loadMatchException.contains(fileName)) + { + std::cout<<"ignore "<loadsToLoadInfo.contains(fileName)) { std::cout< > *ht; QHash > > loads; QHash > loadsToLoadInfo; + LoadMatchException loadMatchException; }; #endif // LOADMAPPING_H diff --git a/testHasttable/loadmatchexception.cpp b/testHasttable/loadmatchexception.cpp index 0d4dbc9..17aad04 100644 --- a/testHasttable/loadmatchexception.cpp +++ b/testHasttable/loadmatchexception.cpp @@ -1,6 +1,6 @@ #include "loadmatchexception.h" - +#include QHash *LoadMatchException::ht=NULL; LoadMatchException::LoadMatchException() { @@ -14,6 +14,7 @@ LoadMatchException::~LoadMatchException() bool LoadMatchException::contains(const QString& key) { + return LoadMatchException::ht->contains(key); } @@ -36,6 +37,10 @@ bool LoadMatchException::init(const QString& exceptionFilePath) } file.close(); } + else + { + std::cout<<"cannot open exception file "< #include #include + class LoadMatchException { public: diff --git a/testHasttable/main.cpp b/testHasttable/main.cpp index 3414b01..3484803 100644 --- a/testHasttable/main.cpp +++ b/testHasttable/main.cpp @@ -8,7 +8,7 @@ int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); LoadMapping lm; - lm.load("D:/Project/佛山项目/数据/搭网架参数文件/泰安/泰安负荷","D:/Project/佛山项目/数据/匹配的数据",""); + lm.load("D:/Project/佛山项目/数据/搭网架参数文件/泰安/泰安负荷","D:/Project/佛山项目/数据/匹配的数据","D:/Project/佛山项目/数据/exception.txt"); // ReadWrite aa; // RegexExtract re;