work save
This commit is contained in:
parent
261c0b4cea
commit
f4ca71803f
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <QFile>
|
||||
#include <QXmlStreamReader>
|
||||
#
|
||||
#include <QXmlStreamWriter>
|
||||
|
||||
QList<POJProblem> importFreeProblemSet(const QString &filename)
|
||||
{
|
||||
|
@ -14,7 +14,6 @@ QList<POJProblem> importFreeProblemSet(const QString &filename)
|
|||
xml.setDevice(&file);
|
||||
POJProblem currentProblem;
|
||||
POJProblemCase currentCase;
|
||||
QString currentText;
|
||||
QString currentEleName;
|
||||
while(!xml.atEnd()) {
|
||||
xml.readNext();
|
||||
|
@ -94,3 +93,14 @@ QList<POJProblem> importFreeProblemSet(const QString &filename)
|
|||
}
|
||||
return problems;
|
||||
}
|
||||
|
||||
void exportFreeProblemSet(const QList<POJProblem> &problems, const QString &filename)
|
||||
{
|
||||
QFile file(filename);
|
||||
if (!file.open(QFile::WriteOnly|QFile::Truncate))
|
||||
return;
|
||||
QXmlStreamWriter writer(&file);
|
||||
writer.setAutoFormatting(true);
|
||||
writer.writeStartDocument();
|
||||
writer.writeEndDocument();
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
#include "ojproblemset.h"
|
||||
|
||||
QList<POJProblem> importFreeProblemSet(const QString& filename);
|
||||
//void exportFreeProblemSet(const QList<POJProblem>& problems);
|
||||
void exportFreeProblemSet(const QList<POJProblem>& problems, const QString& filename);
|
||||
|
||||
#endif // FREEPROJECTSETFORMAT_H
|
||||
|
|
Loading…
Reference in New Issue