QElectroTech  0.70
Public Member Functions | Private Attributes | List of all members
QETResult Class Reference

#include <qetresult.h>

Public Member Functions

 QETResult ()
 
 QETResult (const QString &error_message, bool=false)
 
virtual ~QETResult ()
 
bool isOk () const
 
void setResult (bool)
 
QString errorMessage () const
 
void setErrorMessage (const QString &)
 

Private Attributes

bool result_
 Embedded boolean value. More...
 
QString error_message_
 Embedded error message, typically used to explain what failed to users. More...
 

Detailed Description

This class represents the result of a lambda operation. Technically, it is a mere boolean+error message pair.

Definition at line 26 of file qetresult.h.

Constructor & Destructor Documentation

◆ QETResult() [1/2]

QETResult::QETResult ( )

Construct a default "true" QET result without an error message.

Definition at line 23 of file qetresult.cpp.

◆ QETResult() [2/2]

QETResult::QETResult ( const QString &  error_message,
bool  result = false 
)

Construct a QET result embedding error_message and result (defaults to false).

Definition at line 32 of file qetresult.cpp.

◆ ~QETResult()

QETResult::~QETResult ( )
virtual

Destructor

Definition at line 41 of file qetresult.cpp.

Member Function Documentation

◆ errorMessage()

QString QETResult::errorMessage ( ) const
Returns
the error message embedded within this result.

Definition at line 61 of file qetresult.cpp.

References error_message_.

Referenced by QETDiagramEditor::showError(), and ProjectView::tryClosing().

◆ isOk()

bool QETResult::isOk ( ) const
Returns
the boolean value embedded within this result.

Definition at line 47 of file qetresult.cpp.

References result_.

Referenced by QETDiagramEditor::save(), QETDiagramEditor::saveAs(), QETDiagramEditor::showError(), and ProjectView::tryClosing().

◆ setErrorMessage()

void QETResult::setErrorMessage ( const QString &  error_message)

Embed error_message wihthin this result.

Definition at line 68 of file qetresult.cpp.

References error_message_.

◆ setResult()

void QETResult::setResult ( bool  result)

Embed result.

Definition at line 54 of file qetresult.cpp.

References result_.

Member Data Documentation

◆ error_message_

QString QETResult::error_message_
private

Embedded error message, typically used to explain what failed to users.

Definition at line 43 of file qetresult.h.

Referenced by errorMessage(), and setErrorMessage().

◆ result_

bool QETResult::result_
private

Embedded boolean value.

Definition at line 42 of file qetresult.h.

Referenced by isOk(), and setResult().


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