Cppcheck
|
XML file report version 1. More...
#include <xmlreportv1.h>
Public Member Functions | |
XmlReportV1 (const QString &filename) | |
virtual | ~XmlReportV1 () |
virtual bool | create () |
Create the report (file). More... | |
bool | open () |
Open existing report file. More... | |
virtual void | writeHeader () |
Write report header. More... | |
virtual void | writeFooter () |
Write report footer. More... | |
virtual void | writeError (const ErrorItem &error) |
Write error to report. More... | |
virtual QList< ErrorItem > | read () |
Read contents of the report file. More... | |
Public Member Functions inherited from XmlReport | |
XmlReport (const QString &filename) | |
Public Member Functions inherited from Report | |
Report (const QString &filename) | |
virtual | ~Report () |
virtual void | close () |
Close the report (file). More... | |
Protected Member Functions | |
ErrorItem | readError (QXmlStreamReader *reader) |
Read and parse error item from XML stream. More... | |
Protected Member Functions inherited from Report | |
QFile * | getFile () |
Get the file object where the report is written to. More... | |
Private Attributes | |
QXmlStreamReader * | mXmlReader |
XML stream reader for reading the report in XML format. More... | |
QXmlStreamWriter * | mXmlWriter |
XML stream writer for writing the report in XML format. More... | |
Additional Inherited Members | |
Public Types inherited from Report | |
enum | Type { TXT, XML, XMLV2, CSV } |
Static Public Member Functions inherited from XmlReport | |
static QString | quoteMessage (const QString &message) |
Quote the message. More... | |
static QString | unquoteMessage (const QString &message) |
Unquote the message. More... | |
static int | determineVersion (const QString &filename) |
Get the XML report format version from the file. More... | |
XML file report version 1.
This report outputs XML-formatted report, version 1. The XML format must match command line version's XML output.
Definition at line 36 of file xmlreportv1.h.
|
explicit |
Definition at line 38 of file xmlreportv1.cpp.
|
virtual |
Definition at line 45 of file xmlreportv1.cpp.
References mXmlReader, and mXmlWriter.
|
virtual |
Create the report (file).
Reimplemented from Report.
Definition at line 51 of file xmlreportv1.cpp.
References Report::create(), Report::getFile(), and mXmlWriter.
|
virtual |
Open existing report file.
Reimplemented from Report.
Definition at line 60 of file xmlreportv1.cpp.
References Report::getFile(), mXmlReader, and Report::open().
|
virtual |
Read contents of the report file.
Implements XmlReport.
Definition at line 109 of file xmlreportv1.cpp.
References ErrorElementName, mXmlReader, readError(), and ResultElementName.
|
protected |
Read and parse error item from XML stream.
reader | XML stream reader to use. |
Definition at line 151 of file xmlreportv1.cpp.
References ErrorElementName, ErrorItem::errorId, ErrorItem::errorPath, QErrorPathItem::file, FilenameAttribute, GuiSeverity::fromString(), IdAttribute, QErrorPathItem::line, LineAttribute, ErrorItem::message, MsgAttribute, ErrorItem::severity, SeverityAttribute, ErrorItem::summary, and XmlReport::unquoteMessage().
Referenced by read().
|
virtual |
Write error to report.
error | Error data. |
Implements Report.
Definition at line 82 of file xmlreportv1.cpp.
References ErrorElementName, ErrorItem::errorId, ErrorItem::errorPath, FilenameAttribute, IdAttribute, ErrorItem::inconclusive, LineAttribute, ErrorItem::message, MsgAttribute, mXmlWriter, XmlReport::quoteMessage(), ErrorItem::severity, SeverityAttribute, and GuiSeverity::toString().
|
virtual |
Write report footer.
Implements Report.
Definition at line 76 of file xmlreportv1.cpp.
References mXmlWriter.
|
virtual |
Write report header.
Implements Report.
Definition at line 69 of file xmlreportv1.cpp.
References mXmlWriter, and ResultElementName.
|
private |
XML stream reader for reading the report in XML format.
Definition at line 84 of file xmlreportv1.h.
Referenced by open(), read(), and ~XmlReportV1().
|
private |
XML stream writer for writing the report in XML format.
Definition at line 89 of file xmlreportv1.h.
Referenced by create(), writeError(), writeFooter(), writeHeader(), and ~XmlReportV1().