diff --git a/RedPandaIDE/problems/freeprojectsetformat.cpp b/RedPandaIDE/problems/freeprojectsetformat.cpp index e8e71012..4e79235b 100644 --- a/RedPandaIDE/problems/freeprojectsetformat.cpp +++ b/RedPandaIDE/problems/freeprojectsetformat.cpp @@ -2,7 +2,7 @@ #include #include -# +#include QList importFreeProblemSet(const QString &filename) { @@ -14,7 +14,6 @@ QList 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 importFreeProblemSet(const QString &filename) } return problems; } + +void exportFreeProblemSet(const QList &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(); +} diff --git a/RedPandaIDE/problems/freeprojectsetformat.h b/RedPandaIDE/problems/freeprojectsetformat.h index 8b635000..ffac0ed2 100644 --- a/RedPandaIDE/problems/freeprojectsetformat.h +++ b/RedPandaIDE/problems/freeprojectsetformat.h @@ -4,6 +4,6 @@ #include "ojproblemset.h" QList importFreeProblemSet(const QString& filename); -//void exportFreeProblemSet(const QList& problems); +void exportFreeProblemSet(const QList& problems, const QString& filename); #endif // FREEPROJECTSETFORMAT_H