加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
DxmlSttringMap.cpp 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
箜栢 提交于 2020-03-02 09:14 . 第一次提交
#include "DxmlSttringMap.h"
appInstances::DxmlSttringMap::DxmlSttringMap( ) {
this->map = new QHash<QString, dXml::XmlDataDoc*>;
defaultDoc = new dXml::XmlDataDoc;
defaultDoc->setName("setting");
}
appInstances::DxmlSttringMap* appInstances::DxmlSttringMap::getInstance( ) {
static DxmlSttringMap stance;
return &stance;
}
appInstances::DxmlSttringMap::~DxmlSttringMap( ) {
QList<dXml::XmlDataDoc*> list = map->values( );
while( !list.isEmpty( ) ) {
delete list.last( );
list.removeLast( );
}
delete map;
delete defaultDoc;
}
appInstances::DxmlSttringMap::xmlPrit appInstances::DxmlSttringMap::getXmlFile(QString& fileName) {
dXml::XmlDataDoc* const value = map->value(fileName);
return xmlPrit(fileName, value);
}
const dXml::XmlDataDoc* appInstances::DxmlSttringMap::getDefaultDocXmlFile( ) {
return defaultDoc;
}
appInstances::DxmlSttringMap::xmlPrit appInstances::DxmlSttringMap::addXmlFile(QString& fileName) {
dXml::XmlDataDoc* value = map->value(fileName);
if( !value ) {
value = new dXml::XmlDataDoc;
}
value->clear( );
map->insert(fileName, value);
return xmlPrit(fileName, value);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化