41
testHasttable/loadmatchexception.cpp
Normal file
41
testHasttable/loadmatchexception.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "loadmatchexception.h"
|
||||
|
||||
|
||||
QHash<QString,char > *LoadMatchException::ht=NULL;
|
||||
LoadMatchException::LoadMatchException()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
LoadMatchException::~LoadMatchException()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool LoadMatchException::contains(const QString& key)
|
||||
{
|
||||
return LoadMatchException::ht->contains(key);
|
||||
}
|
||||
|
||||
bool LoadMatchException::init(const QString& exceptionFilePath)
|
||||
{
|
||||
LoadMatchException::ht=new QHash<QString,char >;
|
||||
QFile file(exceptionFilePath);
|
||||
QString line;
|
||||
if(file.open(QFile::ReadOnly))
|
||||
{
|
||||
QTextStream reader(&file);
|
||||
while(!reader.atEnd())
|
||||
{
|
||||
line=reader.readLine().trimmed();
|
||||
if(line.length()==0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
(*LoadMatchException::ht)[line]=0;
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user