43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
#ifndef LOADMAPPING_H
|
|
#define LOADMAPPING_H
|
|
|
|
#include <QString>
|
|
#include <QHash>
|
|
#include <QVector>
|
|
#include <QDir>
|
|
#include <QFileInfo>
|
|
#include <QStringList>
|
|
#include <QFile>
|
|
#include <QTextStream>
|
|
#include <QRegExp>
|
|
#include <QSharedPointer>
|
|
|
|
#include "recursedir.h"
|
|
#include "loadinfo.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<QString,QVector<double> > *ht;
|
|
QHash<QString,QVector<QSharedPointer<LoadInfo> > > loads;
|
|
QHash<QString,QSharedPointer<LoadInfo> > loadsToLoadInfo;
|
|
};
|
|
|
|
#endif // LOADMAPPING_H
|