1.修复小bug
2.增加Node到Terminal的映射。 Signed-off-by: facat@lab.com <facat@lab.com>
This commit is contained in:
33
testHasttable/nodetoterminal.cpp
Normal file
33
testHasttable/nodetoterminal.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "nodetoterminal.h"
|
||||
QHash<QString,QString> *NodeToTerminal::ht=NULL;
|
||||
NodeToTerminal::NodeToTerminal()
|
||||
{
|
||||
if(!NodeToTerminal::ht)
|
||||
{
|
||||
NodeToTerminal::ht=new QHash<QString,QString>;
|
||||
}
|
||||
}
|
||||
|
||||
void NodeToTerminal::add(const QString& key,const QString& value)
|
||||
{
|
||||
(*NodeToTerminal::ht)[key]=value;
|
||||
}
|
||||
|
||||
bool NodeToTerminal::contains(const QString& key)
|
||||
{
|
||||
return NodeToTerminal::ht->contains(key);
|
||||
}
|
||||
|
||||
QString NodeToTerminal::value(const QString& key)
|
||||
{
|
||||
return NodeToTerminal::ht->value(key);
|
||||
}
|
||||
|
||||
NodeToTerminal::~NodeToTerminal()
|
||||
{
|
||||
if(NodeToTerminal::ht)
|
||||
{
|
||||
delete NodeToTerminal::ht;
|
||||
NodeToTerminal::ht=NULL;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user