CuteHMI - CuteHMI (CuteHMI.2)
cutehmi::InplaceError Struct Reference

In-place error. More...

#include <cutehmi/InplaceError.hpp>

Inheritance diagram for cutehmi::InplaceError:
cutehmi::Error

Public Member Functions

 InplaceError (const QString &message="Error.", const char *file=nullptr, int line=0, const char *function=nullptr, int code=Error::FAIL)
 Constructor. More...
 
QString str () const
 Get error string. More...
 
- Public Member Functions inherited from cutehmi::Error
 Error ()
 Default constructor. More...
 
 Error (int code)
 Conversion constructor. More...
 
bool operator== (const Error &other) const
 
bool operator!= (const Error &other) const
 
 operator bool () const
 Conversion to bool. More...
 
int code () const
 Get error code. More...
 
QString str () const
 Get error string. More...
 

Public Attributes

QString message
 
const char * file
 
int line
 
const char * function
 

Additional Inherited Members

- Public Types inherited from cutehmi::Error
enum  : int { UNINITIALIZED = -2, FAIL = -1, OK = 0, SUBCLASS_BEGIN = 1 }
 
- Protected Member Functions inherited from cutehmi::Error
void setCode (int code)
 

Detailed Description

In-place error.

This class can be more conveniently used with CUTEHMI_ERROR macro.

Remarks
This class is registered as metatype by Init instance.

Constructor & Destructor Documentation

◆ InplaceError()

cutehmi::InplaceError::InplaceError ( const QString message = "Error.",
const char *  file = nullptr,
int  line = 0,
const char *  function = nullptr,
int  code = Error::FAIL 
)

Constructor.

Parameters
messageerror message.
filefile name, where error occurred.
lineline at which error occurred.
functionfunction inside which error occurred.
codeerror code.
Note
It is not intended to use this constructor directly. To conveniently create an instance of this class a CUTEHMI_ERROR macro, which takes only message as an argument, should be used.

Member Function Documentation

◆ str()

QString cutehmi::InplaceError::str ( ) const

Get error string.

Returns
error string.

Member Data Documentation

◆ file

const char* cutehmi::InplaceError::file

◆ function

const char* cutehmi::InplaceError::function

◆ line

int cutehmi::InplaceError::line

◆ message

QString cutehmi::InplaceError::message