#ifndef LOADMAPPING_H #define LOADMAPPING_H #include #include #include #include #include #include #include #include #include #include #include "recursedir.h" #include "loadinfo.h" #include "loadmatchexception.h" //这是一个单例 class LoadMapping { public: LoadMapping(); ~LoadMapping(); bool load(const QString& loadDir, const QString &matchdDir, const QString &exceptionFile); bool readLoads(const QString& dir); bool readMatch(const QString& dir); private: class CG // 它的唯一工作就是在析构函数中删除CSingleton的实例 { public: ~CG() { if (LoadMapping::ht) delete LoadMapping::ht; } }; static CG Garbo; // 定义一个静态成员,在程序结束时,系统会调用它的析构函数 static QHash > *ht; QHash > > loads; QHash > loadsToLoadInfo; LoadMatchException loadMatchException; }; #endif // LOADMAPPING_H