mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
loadXMLtoDOM, saveDOMtoXML перенес в Tools
This commit is contained in:
@@ -87,38 +87,6 @@ QByteArray DataParser::xmlAnswer(QList<SXmlAnswerTag> listTag, QString elemUp1,
|
||||
|
||||
}
|
||||
|
||||
bool DataParser::loadXMLtoDOM(QString nameFile, QDomDocument *commonDOM)
|
||||
{
|
||||
QFile blankFile(nameFile);
|
||||
|
||||
if (! blankFile.open(QFile::ReadOnly | QFile::Text)) {
|
||||
qDebug() << "loadBlankXML: Couldn't read the file: " + nameFile;
|
||||
return false;
|
||||
}
|
||||
|
||||
commonDOM->setContent(blankFile.readAll());
|
||||
blankFile.close();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DataParser::saveDOMtoXML(QString nameFile, QDomDocument *commonDOM)
|
||||
{
|
||||
QFile xmlOutFile(nameFile);
|
||||
if (!xmlOutFile.open(QFile::WriteOnly | QFile::Text))
|
||||
{
|
||||
qDebug() << "saveDOMtoXML: Failed to write a file: " + nameFile;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
QTextStream outFile(&xmlOutFile);
|
||||
commonDOM->save(outFile, 4);
|
||||
xmlOutFile.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
QByteArray DataParser::readTempFile()
|
||||
{
|
||||
QByteArray array;
|
||||
|
||||
Reference in New Issue
Block a user