Cppcheck
Public Member Functions | Private Attributes | List of all members
TxtReport Class Reference

Text file report. More...

#include <txtreport.h>

Inheritance diagram for TxtReport:
Report

Public Member Functions

 TxtReport (const QString &filename)
 
bool create () override
 Create the report (file). More...
 
void writeHeader () override
 Write report header. More...
 
void writeFooter () override
 Write report footer. More...
 
void writeError (const ErrorItem &error) override
 Write error to report. More...
 
- Public Member Functions inherited from Report
 Report (QString filename)
 
 ~Report () override
 
virtual bool open ()
 Open the existing report (file). More...
 
void close ()
 Close the report (file). More...
 

Private Attributes

QTextStream mTxtWriter
 Text stream writer for writing the report in text format. More...
 

Additional Inherited Members

- Public Types inherited from Report
enum  Type { TXT , XMLV2 , CSV }
 
- Protected Member Functions inherited from Report
QFile * getFile ()
 Get the file object where the report is written to. More...
 

Detailed Description

Text file report.

This report mimics the output of the command line cppcheck.

Definition at line 38 of file txtreport.h.

Constructor & Destructor Documentation

◆ TxtReport()

TxtReport::TxtReport ( const QString &  filename)
explicit

Definition at line 28 of file txtreport.cpp.

Member Function Documentation

◆ create()

bool TxtReport::create ( )
overridevirtual

Create the report (file).

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

Reimplemented from Report.

Definition at line 32 of file txtreport.cpp.

References Report::create(), Report::getFile(), and mTxtWriter.

◆ writeError()

void TxtReport::writeError ( const ErrorItem error)
overridevirtual

Write error to report.

Parameters
errorError data.

Implements Report.

Definition at line 51 of file txtreport.cpp.

References error, mTxtWriter, and GuiSeverity::toString().

◆ writeFooter()

void TxtReport::writeFooter ( )
overridevirtual

Write report footer.

Implements Report.

Definition at line 46 of file txtreport.cpp.

◆ writeHeader()

void TxtReport::writeHeader ( )
overridevirtual

Write report header.

Implements Report.

Definition at line 41 of file txtreport.cpp.

Member Data Documentation

◆ mTxtWriter

QTextStream TxtReport::mTxtWriter
private

Text stream writer for writing the report in text format.

Definition at line 71 of file txtreport.h.

Referenced by create(), and writeError().


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