Cppcheck
Public Types | Public Member Functions | Protected Member Functions | Private Attributes
Report Class Reference

A base class for reports. More...

#include <report.h>

Inheritance diagram for Report:
CsvReport TxtReport XmlReport XmlReportV1 XmlReportV2

List of all members.

Public Types

enum  Type { TXT, XML, XMLV2, CSV }

Public Member Functions

 Report (const QString &filename)
virtual ~Report ()
virtual bool Create ()
 Create the report (file).
virtual bool Open ()
 Open the existing report (file).
virtual void Close ()
 Close the report (file).
virtual void WriteHeader ()=0
 Write report header.
virtual void WriteFooter ()=0
 Write report footer.
virtual void WriteError (const ErrorItem &error)=0
 Write error to report.

Protected Member Functions

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

Private Attributes

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

Detailed Description

A base class for reports.

Definition at line 33 of file report.h.


Member Enumeration Documentation

Enumerator:
TXT 
XML 
XMLV2 
CSV 

Definition at line 36 of file report.h.


Constructor & Destructor Documentation

Report::Report ( const QString &  filename)

Definition at line 24 of file report.cpp.

Report::~Report ( ) [virtual]

Definition at line 29 of file report.cpp.

References Close().


Member Function Documentation

void Report::Close ( ) [virtual]

Close the report (file).

Definition at line 54 of file report.cpp.

References mFile.

Referenced by ~Report().

bool Report::Create ( ) [virtual]

Create the report (file).

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

Reimplemented in XmlReportV2, CsvReport, TxtReport, and XmlReportV1.

Definition at line 34 of file report.cpp.

References mFile, and mFilename.

Referenced by CsvReport::Create(), XmlReportV1::Create(), TxtReport::Create(), XmlReportV2::Create(), and ResultsView::Save().

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(), XmlReportV1::Create(), XmlReportV2::Create(), XmlReportV1::Open(), and XmlReportV2::Open().

bool Report::Open ( ) [virtual]

Open the existing report (file).

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

Reimplemented in XmlReportV2, and XmlReportV1.

Definition at line 44 of file report.cpp.

References mFile, and mFilename.

Referenced by XmlReportV1::Open(), XmlReportV2::Open(), and ResultsView::ReadErrorsXml().

virtual void Report::WriteError ( const ErrorItem error) [pure virtual]

Write error to report.

Parameters:
errorError data.

Implemented in XmlReportV2, XmlReportV1, CsvReport, and TxtReport.

Referenced by ResultsTree::SaveErrors().

virtual void Report::WriteFooter ( ) [pure virtual]

Write report footer.

Implemented in XmlReportV2, XmlReportV1, CsvReport, and TxtReport.

Referenced by ResultsTree::SaveResults().

virtual void Report::WriteHeader ( ) [pure virtual]

Write report header.

Implemented in XmlReportV2, XmlReportV1, CsvReport, and TxtReport.

Referenced by ResultsTree::SaveResults().


Member Data Documentation

QFile Report::mFile [private]

Fileobject for the report file.

Definition at line 96 of file report.h.

Referenced by Close(), Create(), GetFile(), and Open().

QString Report::mFilename [private]

Filename of the report.

Definition at line 91 of file report.h.

Referenced by Create(), and Open().


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