Cppcheck
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Report Class Referenceabstract

A base class for reports. More...

#include <report.h>

Inheritance diagram for Report:
CsvReport PrintableReport TxtReport XmlReport XmlReportV2

Public Types

enum  Type { TXT , XMLV2 , CSV }
 

Public Member Functions

 Report (QString filename)
 
 ~Report () override
 
virtual bool create ()
 Create the report (file). More...
 
virtual bool open ()
 Open the existing report (file). More...
 
void close ()
 Close the report (file). More...
 
virtual void writeHeader ()=0
 Write report header. More...
 
virtual void writeFooter ()=0
 Write report footer. More...
 
virtual void writeError (const ErrorItem &error)=0
 Write error to report. More...
 

Protected Member Functions

QFile * getFile ()
 Get the file object where the report is written to. More...
 

Private Attributes

QString mFilename
 Filename of the report. More...
 
QFile mFile
 Fileobject for the report file. More...
 

Detailed Description

A base class for reports.

Definition at line 34 of file report.h.

Member Enumeration Documentation

◆ Type

Enumerator
TXT 
XMLV2 
CSV 

Definition at line 36 of file report.h.

Constructor & Destructor Documentation

◆ Report()

Report::Report ( QString  filename)
explicit

Definition at line 25 of file report.cpp.

◆ ~Report()

Report::~Report ( )
override

Definition at line 29 of file report.cpp.

References close().

Member Function Documentation

◆ close()

void Report::close ( )

Close the report (file).

Definition at line 54 of file report.cpp.

References mFile.

Referenced by ResultsTree::updateFromOldReport(), and ~Report().

◆ create()

bool Report::create ( )
virtual

Create the report (file).

Returns
true if succeeded, false if file could not be created.

Reimplemented in XmlReportV2, TxtReport, PrintableReport, and CsvReport.

Definition at line 34 of file report.cpp.

References mFile, and mFilename.

Referenced by CsvReport::create(), TxtReport::create(), XmlReportV2::create(), and ResultsView::save().

◆ getFile()

QFile * Report::getFile ( )
protected

Get the file object where the report is written to.

Definition at line 60 of file report.cpp.

References mFile.

Referenced by CsvReport::create(), TxtReport::create(), XmlReportV2::create(), and XmlReportV2::open().

◆ open()

bool Report::open ( )
virtual

Open the existing report (file).

Returns
true if succeeded, false if file could not be created.

Reimplemented in XmlReportV2.

Definition at line 44 of file report.cpp.

References mFile, and mFilename.

Referenced by XmlReportV2::open().

◆ writeError()

virtual void Report::writeError ( const ErrorItem error)
pure virtual

Write error to report.

Parameters
errorError data.

Implemented in XmlReportV2, TxtReport, PrintableReport, and CsvReport.

Referenced by ResultsTree::saveErrors().

◆ writeFooter()

virtual void Report::writeFooter ( )
pure virtual

Write report footer.

Implemented in XmlReportV2, TxtReport, PrintableReport, and CsvReport.

Referenced by ResultsTree::saveResults().

◆ writeHeader()

virtual void Report::writeHeader ( )
pure virtual

Write report header.

Implemented in XmlReportV2, TxtReport, PrintableReport, and CsvReport.

Referenced by ResultsTree::saveResults().

Member Data Documentation

◆ mFile

QFile Report::mFile
private

Fileobject for the report file.

Definition at line 95 of file report.h.

Referenced by close(), create(), getFile(), and open().

◆ mFilename

QString Report::mFilename
private

Filename of the report.

Definition at line 90 of file report.h.

Referenced by create(), and open().


The documentation for this class was generated from the following files: