Engauge Digitizer  2
Public Member Functions | List of all members
DocumentScrub Class Reference

Check Document state. More...

#include <DocumentScrub.h>

Collaboration diagram for DocumentScrub:
Collaboration graph

Public Member Functions

 DocumentScrub ()
 Single constructor. More...
 
void check (MainWindow &mainWindow, const Document &document) const
 Check document state. More...
 

Detailed Description

Check Document state.

Primary reason is for catching when point identifiers get corrupted due, possibly, to mixed language alphabets

Definition at line 14 of file DocumentScrub.h.

Constructor & Destructor Documentation

◆ DocumentScrub()

DocumentScrub::DocumentScrub ( )

Single constructor.

Definition at line 17 of file DocumentScrub.cpp.

18 {
19  LOG4CPP_INFO_S ((*mainCat)) << "DocumentScrub::DocumentScrub";
20 }

Member Function Documentation

◆ check()

void DocumentScrub::check ( MainWindow mainWindow,
const Document document 
) const

Check document state.

Definition at line 22 of file DocumentScrub.cpp.

24 {
25  LOG4CPP_INFO_S ((*mainCat)) << "DocumentScrub::check";
26 
28 
29  Functor2wRet<const QString &, const Point &, CallbackSearchReturn> ftorWithCallback = functor_ret (ftor,
31 
32  document.iterateThroughCurvePointsAxes (ftorWithCallback);
33  document.iterateThroughCurvesPointsGraphs (ftorWithCallback);
34 
35  if (!ftor.success ()) {
36 
37  QMessageBox::critical (&mainWindow,
39  QString ("%1: %2")
40  .arg (QObject::tr ("Point identifier error encountered. Please notify the Engauge "
41  "developers along with any comments about the country and language locale. "
42  "The invalid point name was"))
43  .arg (ftor.badPointName ().replace (POINT_IDENTIFIER_DELIMITER_SAFE, "<tab>")));
44  exit (-1);
45  }
46 }

The documentation for this class was generated from the following files:
CallbackDocumentScrub::badPointName
QString badPointName() const
Scrub result details. Applies when unsuccessful.
Definition: CallbackDocumentScrub.cpp:19
Document::iterateThroughCurvePointsAxes
void iterateThroughCurvePointsAxes(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for the axes curve.
Definition: Document.cpp:449
POINT_IDENTIFIER_DELIMITER_SAFE
const QString POINT_IDENTIFIER_DELIMITER_SAFE
CallbackDocumentScrub::callback
CallbackSearchReturn callback(const QString &curveName, const Point &point)
Callback method.
Definition: CallbackDocumentScrub.cpp:24
CallbackDocumentScrub
Callback for scrubbing Document. Any state error will be caught.
Definition: CallbackDocumentScrub.h:15
LOG4CPP_INFO_S
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
engaugeWindowTitle
QString engaugeWindowTitle()
Text for title bars of dialogs.
Definition: Version.cpp:14
mainCat
log4cpp::Category * mainCat
Definition: Logger.cpp:14
Document::iterateThroughCurvesPointsGraphs
void iterateThroughCurvesPointsGraphs(const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback)
See Curve::iterateThroughCurvePoints, for all the graphs curves.
Definition: Document.cpp:472
CallbackDocumentScrub::success
bool success() const
Scrub overall result.
Definition: CallbackDocumentScrub.cpp:72