Seamly2D
Code documentation
qmu::QmuParserError Class Reference

Error class of the parser. More...

#include <qmuparsererror.h>

Inheritance diagram for qmu::QmuParserError:
Collaboration diagram for qmu::QmuParserError:

Public Member Functions

 QmuParserError ()
 Default constructor. More...
 
 QmuParserError (EErrorCodes a_iErrc)
 This Constructor is used for internal exceptions only. More...
 
 QmuParserError (const QString &sMsg)
 Construct an error from a message text. More...
 
 QmuParserError (EErrorCodes a_iErrc, const QString &sTok, const QString &sFormula=QString(), int a_iPos=-1)
 Construct an error object. More...
 
 QmuParserError (EErrorCodes a_iErrc, int a_iPos, const QString &sTok)
 Construct an error object. More...
 
 QmuParserError (const QString &szMsg, int iPos, const QString &sTok=QString())
 Construct an error object. More...
 
 QmuParserError (const QmuParserError &a_Obj)
 Copy constructor. More...
 
QmuParserErroroperator= (const QmuParserError &a_Obj)
 Assignment operator. More...
 
virtual ~QmuParserError () Q_DECL_OVERRIDE
 
void SetFormula (const QString &a_strFormula)
 Set the expression related to this error. More...
 
const QString & GetExpr () const
 gets the expression related tp this error. More...
 
const QString & GetMsg () const
 Returns the message string for this error. More...
 
int GetPos () const
 Return the formula position related to the error. More...
 
const QString & GetToken () const
 Return string related with this token (if available). More...
 
EErrorCodes GetCode () const
 Return the error code. More...
 
virtual Q_NORETURN void raise () const Q_DECL_OVERRIDE
 raise method raise for exception More...
 
virtual Q_REQUIRED_RESULT QmuParserErrorclone () const Q_DECL_OVERRIDE
 clone clone exception More...
 

Private Member Functions

void Reset ()
 Reset the erro object. More...
 

Private Attributes

QString m_sMsg
 The message string. More...
 
QString m_sExpr
 Formula string. More...
 
QString m_sTok
 Token related with the error. More...
 
int m_iPos
 Formula position related to the error. More...
 
EErrorCodes m_iErrc
 Error code. More...
 
const QmuParserErrorMsgm_ErrMsg
 

Detailed Description

Error class of the parser.

Author
Ingo Berg

Part of the math parser package.

Definition at line 136 of file qmuparsererror.h.

Constructor & Destructor Documentation

◆ QmuParserError() [1/7]

qmu::QmuParserError::QmuParserError ( )

Default constructor.

Definition at line 169 of file qmuparsererror.cpp.

Referenced by clone().

◆ QmuParserError() [2/7]

qmu::QmuParserError::QmuParserError ( EErrorCodes  a_iErrc)
explicit

This Constructor is used for internal exceptions only.

It does not contain any information but the error code.

Definition at line 180 of file qmuparsererror.cpp.

References m_ErrMsg, m_iErrc, m_iPos, m_sMsg, and m_sTok.

◆ QmuParserError() [3/7]

qmu::QmuParserError::QmuParserError ( const QString &  sMsg)
explicit

Construct an error from a message text.

Definition at line 193 of file qmuparsererror.cpp.

◆ QmuParserError() [4/7]

qmu::QmuParserError::QmuParserError ( EErrorCodes  iErrc,
const QString &  sTok,
const QString &  sExpr = QString(),
int  iPos = -1 
)

Construct an error object.

Parameters
[in]iErrcthe error code.
[in]sTokThe token string related to this error.
[in]sExprThe expression related to the error.
[in]iPosthe position in the expression where the error occured.

Definition at line 206 of file qmuparsererror.cpp.

References m_ErrMsg, m_iErrc, m_iPos, m_sMsg, and m_sTok.

◆ QmuParserError() [5/7]

qmu::QmuParserError::QmuParserError ( EErrorCodes  a_iErrc,
int  a_iPos,
const QString &  sTok 
)

Construct an error object.

Parameters
[in]a_iErrcthe error code.
[in]a_iPosthe position in the expression where the error occured.
[in]sTokThe token string related to this error.

Definition at line 222 of file qmuparsererror.cpp.

References m_ErrMsg, m_iErrc, m_iPos, m_sMsg, and m_sTok.

◆ QmuParserError() [6/7]

qmu::QmuParserError::QmuParserError ( const QString &  szMsg,
int  iPos,
const QString &  sTok = QString() 
)

Construct an error object.

Parameters
[in]szMsgThe error message text.
[in]iPosthe position related to the error.
[in]sTokThe token string related to this error.

Definition at line 237 of file qmuparsererror.cpp.

References m_iPos, m_sMsg, and m_sTok.

◆ QmuParserError() [7/7]

qmu::QmuParserError::QmuParserError ( const QmuParserError a_Obj)

Copy constructor.

Definition at line 249 of file qmuparsererror.cpp.

◆ ~QmuParserError()

virtual qmu::QmuParserError::~QmuParserError ( )
inlinevirtual

Definition at line 147 of file qmuparsererror.h.

Member Function Documentation

◆ clone()

QmuParserError * qmu::QmuParserError::clone ( ) const
virtual

clone clone exception

Returns
new exception

Definition at line 299 of file qmuparsererror.cpp.

References QmuParserError().

◆ GetCode()

EErrorCodes qmu::QmuParserError::GetCode ( ) const
inline

Return the error code.

Definition at line 218 of file qmuparsererror.h.

Referenced by qmu::QmuParserTokenReader::IsEOF(), and qmu::Test::QmuParserTester::ThrowTest().

◆ GetExpr()

const QString & qmu::QmuParserError::GetExpr ( ) const
inline

◆ GetMsg()

◆ GetPos()

int qmu::QmuParserError::GetPos ( ) const
inline

Return the formula position related to the error.

If the error is not related to a distinct position this will return -1

Definition at line 200 of file qmuparsererror.h.

◆ GetToken()

const QString & qmu::QmuParserError::GetToken ( ) const
inline

Return string related with this token (if available).

Definition at line 209 of file qmuparsererror.h.

Referenced by qmu::Test::QmuParserTester::Run().

◆ operator=()

QmuParserError & qmu::QmuParserError::operator= ( const QmuParserError a_Obj)

Assignment operator.

Definition at line 256 of file qmuparsererror.cpp.

References m_iErrc, m_iPos, m_sExpr, m_sMsg, and m_sTok.

◆ raise()

Q_NORETURN void qmu::QmuParserError::raise ( ) const
virtual

raise method raise for exception

Definition at line 289 of file qmuparsererror.cpp.

◆ Reset()

void qmu::QmuParserError::Reset ( )
private

Reset the erro object.

Definition at line 276 of file qmuparsererror.cpp.

References qmu::ecUNDEFINED, m_iErrc, m_iPos, m_sExpr, m_sMsg, and m_sTok.

◆ SetFormula()

void qmu::QmuParserError::SetFormula ( const QString &  a_strFormula)
inline

Set the expression related to this error.

Definition at line 171 of file qmuparsererror.h.

Referenced by qmu::QmuParserBase::ParseString().

Member Data Documentation

◆ m_ErrMsg

const QmuParserErrorMsg& qmu::QmuParserError::m_ErrMsg
private

Definition at line 163 of file qmuparsererror.h.

Referenced by QmuParserError().

◆ m_iErrc

EErrorCodes qmu::QmuParserError::m_iErrc
private

Error code.

Definition at line 162 of file qmuparsererror.h.

Referenced by operator=(), QmuParserError(), and Reset().

◆ m_iPos

int qmu::QmuParserError::m_iPos
private

Formula position related to the error.

Definition at line 161 of file qmuparsererror.h.

Referenced by operator=(), QmuParserError(), and Reset().

◆ m_sExpr

QString qmu::QmuParserError::m_sExpr
private

Formula string.

Definition at line 159 of file qmuparsererror.h.

Referenced by operator=(), and Reset().

◆ m_sMsg

QString qmu::QmuParserError::m_sMsg
private

The message string.

Definition at line 158 of file qmuparsererror.h.

Referenced by operator=(), QmuParserError(), and Reset().

◆ m_sTok

QString qmu::QmuParserError::m_sTok
private

Token related with the error.

Definition at line 160 of file qmuparsererror.h.

Referenced by operator=(), QmuParserError(), and Reset().


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