GLIMSView Source Code Documentation

ValidationReport Class Reference

#include <ValidationReport.h>

List of all members.


Detailed Description

ValidationReport is a simple tool which allows the programmer to store messages from validation functions, which can be displayed on the screen and will be written to a file when the project is closed.

example of usage to print some information plus the value of x to the report:

ValidationReport reporter ; std::stringstream rptstream ; rptstream << "Message text " << x << endl ; reporter.report( rptstream.str() ) ;

Author:
Deborah Lee Soltesz
History:
2007-05-28 dls Converted from TraceLog class
What's New:
2007-06-14 ValidationReport collects validity information from metadata collection classes and generates an HTML formatted report.

Definition at line 38 of file ValidationReport.h.


Public Member Functions

 ValidationReport ()
 ValidationReport (string newFilename)
 ~ValidationReport ()
void report (char *msg)
 Add a message to the list of messages to be written to the report file when the application exits.
void report (string msg)
 Add a message to the list of messages to be written to the log file when the application exits.
void reportOkay (string msg)
 Formatted message.
void reportWarning (string msg)
 Formatted message.
void reportError (string msg)
 Formatted message.
void breakBegin (string subTitle="")
 Start a new messages section.
void breakEnd (string endMessage="")
 End a messages section.
void subsectionBegin (string subTitle="")
 Start a new messages subsection.
void subsectionEnd (string endMessage="")
 End a messages subsection.
string getReport ()
 Returns all the messages in a string object.
void writeReport ()
 Write the messages to the file and close the file.
void clearReport ()
 Clear/erase messages, and clear file if a file is open.
void openReport ()

Protected Attributes

fstream reportFile
string filename
std::vector< string > messages

Constructor & Destructor Documentation

ValidationReport::ValidationReport (  )  [inline]

Definition at line 45 of file ValidationReport.h.

References openReport().

Here is the call graph for this function:

ValidationReport::ValidationReport ( string  newFilename  )  [inline]

Definition at line 49 of file ValidationReport.h.

References filename, and openReport().

Here is the call graph for this function:

ValidationReport::~ValidationReport (  )  [inline]

Definition at line 54 of file ValidationReport.h.

References writeReport().

Here is the call graph for this function:


Member Function Documentation

void ValidationReport::report ( char *  msg  )  [inline]

Add a message to the list of messages to be written to the report file when the application exits.

Definition at line 66 of file ValidationReport.h.

References messages.

void ValidationReport::report ( string  msg  )  [inline]

Add a message to the list of messages to be written to the log file when the application exits.

Definition at line 76 of file ValidationReport.h.

References messages.

void ValidationReport::reportOkay ( string  msg  )  [inline]

Formatted message.

Add a message to the list of messages to be written to the log file when the application exits. Message will be formatted as an okay item (good, not a warning or error).

Definition at line 92 of file ValidationReport.h.

References messages.

Referenced by Session::validate().

void ValidationReport::reportWarning ( string  msg  )  [inline]

Formatted message.

Add a message to the list of messages to be written to the log file when the application exits. Message will be formatted as a warning.

Definition at line 105 of file ValidationReport.h.

References messages.

Referenced by Session::validate(), LineDef::validate(), ImageInf::validate(), GLIMSLineData::validate(), GLIMSGIDData::validate(), and GlacierIDDef::validate().

void ValidationReport::reportError ( string  msg  )  [inline]

Formatted message.

Add a message to the list of messages to be written to the log file when the application exits. Message will be formatted as an error.

Definition at line 118 of file ValidationReport.h.

References messages.

Referenced by Session::validate(), LineDef::validate(), ImageInf::validate(), GLIMSLineData::validate(), and GlacierIDDef::validate().

void ValidationReport::breakBegin ( string  subTitle = ""  )  [inline]

Start a new messages section.

Add a formatting break to messages, with optional subtitle to start next section.

Definition at line 130 of file ValidationReport.h.

References messages.

Referenced by Session::validate(), ImageInf::validate(), GLIMSLineData::validate(), and GLIMSGIDData::validate().

void ValidationReport::breakEnd ( string  endMessage = ""  )  [inline]

End a messages section.

Add a formatting break to messages, with optional message to wrap up section.

Definition at line 144 of file ValidationReport.h.

References messages.

Referenced by Session::validate(), ImageInf::validate(), GLIMSLineData::validate(), and GLIMSGIDData::validate().

void ValidationReport::subsectionBegin ( string  subTitle = ""  )  [inline]

Start a new messages subsection.

Add a formatting break to messages, with optional subtitle to start next section.

Definition at line 157 of file ValidationReport.h.

References messages.

Referenced by LineDefSet::validate(), GLIMSLineData::validate(), and GlacierIDDef::validate().

void ValidationReport::subsectionEnd ( string  endMessage = ""  )  [inline]

End a messages subsection.

Add a formatting break to messages, with optional message to wrap up section.

Definition at line 170 of file ValidationReport.h.

References messages.

Referenced by LineDefSet::validate(), GLIMSLineData::validate(), and GlacierIDDef::validate().

string ValidationReport::getReport (  )  [inline]

Returns all the messages in a string object.

Definition at line 187 of file ValidationReport.h.

References messages.

Referenced by ValidationReportDlg::setReport(), and ValidationReportDlg::show().

void ValidationReport::writeReport (  )  [inline]

Write the messages to the file and close the file.

If no file is open, nothing happens.

Definition at line 204 of file ValidationReport.h.

References messages, and reportFile.

Referenced by ~ValidationReport().

void ValidationReport::clearReport (  )  [inline]

Clear/erase messages, and clear file if a file is open.

Definition at line 220 of file ValidationReport.h.

References messages, openReport(), and reportFile.

Referenced by GLIMSProject::validate().

Here is the call graph for this function:

void ValidationReport::openReport (  )  [inline]

Definition at line 229 of file ValidationReport.h.

References filename, and reportFile.

Referenced by clearReport(), and ValidationReport().


Member Data Documentation

fstream ValidationReport::reportFile [protected]

Definition at line 40 of file ValidationReport.h.

Referenced by clearReport(), openReport(), and writeReport().

string ValidationReport::filename [protected]

Definition at line 41 of file ValidationReport.h.

Referenced by openReport(), and ValidationReport().

std::vector<string> ValidationReport::messages [protected]


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

Home | Search | Disclaimers & Privacy | Contact Us
GLIMSView Maintainer: dsoltesz@usgs.gov