File indexing completed on 2024-07-14 14:25:35

0001 /*
0002     This file is part of KDE.
0003 
0004     SPDX-FileCopyrightText: 2010 Dan Leinir Turthra Jensen <admin@leinir.dk>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #include "buildservicejoboutputparser.h"
0010 #include "qdebug.h"
0011 
0012 using namespace Attica;
0013 
0014 BuildServiceJobOutput BuildServiceJobOutput::Parser::parseXml(QXmlStreamReader &xml)
0015 {
0016     BuildServiceJobOutput buildservicejoboutput;
0017 
0018     // For specs about the XML provided, see here:
0019     // http://www.freedesktop.org/wiki/Specifications/open-collaboration-services-draft#BuildServiceJobs
0020     while (!xml.atEnd()) {
0021         if (xml.isStartElement()) {
0022             if (xml.name() == QLatin1String("output")) {
0023                 buildservicejoboutput.setOutput(xml.readElementText());
0024             }
0025         } else if (xml.isEndElement() && xml.name() == QLatin1String("output")) {
0026             break;
0027         }
0028         xml.readNext();
0029     }
0030     return buildservicejoboutput;
0031 }
0032 
0033 QStringList BuildServiceJobOutput::Parser::xmlElement() const
0034 {
0035     return QStringList(QStringLiteral("output"));
0036 }