31
testHasttable/loadmatchexception.h
Normal file
31
testHasttable/loadmatchexception.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef LOADMATCHEXCEPTION_H
|
||||
#define LOADMATCHEXCEPTION_H
|
||||
|
||||
//有些负荷文件就不匹配了
|
||||
#include <QString>
|
||||
#include <QHash>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
class LoadMatchException
|
||||
{
|
||||
public:
|
||||
LoadMatchException();
|
||||
~LoadMatchException();
|
||||
bool contains(const QString& key);
|
||||
bool init(const QString& exceptionFilePath);
|
||||
|
||||
private:
|
||||
class CG // 它的唯一工作就是在析构函数中删除CSingleton的实例
|
||||
{
|
||||
public:
|
||||
~CG()
|
||||
{
|
||||
if (LoadMatchException::ht)
|
||||
delete LoadMatchException::ht;
|
||||
}
|
||||
};
|
||||
static CG Garbo; // 定义一个静态成员,在程序结束时,系统会调用它的析构函数
|
||||
static QHash<QString,char > *ht;
|
||||
};
|
||||
|
||||
#endif // LOADMATCHEXCEPTION_H
|
||||
Reference in New Issue
Block a user