1 /************************************************************************ 2 ** 3 ** @file vexceptionobjecterror.h 4 ** @author Roman Telezhynskyi <dismine(at)gmail.com> 5 ** @date November 15, 2013 6 ** 7 ** @brief 8 ** @copyright 9 ** This source code is part of the Valentina project, a pattern making 10 ** program, whose allow create and modeling patterns of clothing. 11 ** Copyright (C) 2013-2015 Valentina project 12 ** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved. 13 ** 14 ** Valentina is free software: you can redistribute it and/or modify 15 ** it under the terms of the GNU General Public License as published by 16 ** the Free Software Foundation, either version 3 of the License, or 17 ** (at your option) any later version. 18 ** 19 ** Valentina is distributed in the hope that it will be useful, 20 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 21 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 ** GNU General Public License for more details. 23 ** 24 ** You should have received a copy of the GNU General Public License 25 ** along with Valentina. If not, see <http://www.gnu.org/licenses/>. 26 ** 27 *************************************************************************/ 28 29 #ifndef VEXCEPTIONOBJECTERROR_H 30 #define VEXCEPTIONOBJECTERROR_H 31 32 #include <qcompilerdetection.h> 33 #include <QString> 34 #include <QtGlobal> 35 36 #include "../ifcdef.h" 37 #include "vexception.h" 38 39 class QDomElement; 40 41 /** 42 * @brief The VExceptionObjectError class for exception object error 43 */ 44 class VExceptionObjectError : public VException 45 { 46 public: 47 VExceptionObjectError(const QString &what, const QDomElement &domElement) V_NOEXCEPT_EXPR (true); 48 explicit VExceptionObjectError(const QString &what) V_NOEXCEPT_EXPR (true); 49 VExceptionObjectError(const VExceptionObjectError &e) V_NOEXCEPT_EXPR (true); 50 VExceptionObjectError &operator=(const VExceptionObjectError &e) V_NOEXCEPT_EXPR (true); 51 virtual ~VExceptionObjectError() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT; 52 raise()53 Q_NORETURN virtual void raise() const override { throw *this; } 54 clone()55 Q_REQUIRED_RESULT virtual VExceptionObjectError *clone() const override { return new VExceptionObjectError(*this); } 56 57 virtual QString ErrorMessage() const override; 58 virtual QString DetailedInformation() const override; 59 QString TagText() const; 60 QString TagName() const; 61 qint32 LineNumber() const; 62 protected: 63 /** @brief tagText tag text */ 64 QString tagText; 65 66 /** @brief tagName tag name */ 67 QString tagName; 68 69 /** @brief lineNumber line number */ 70 qint32 lineNumber; 71 }; 72 73 //--------------------------------------------------------------------------------------------------------------------- 74 /** 75 * @brief TagText return tag text 76 * @return tag text 77 */ TagText()78inline QString VExceptionObjectError::TagText() const 79 { 80 return tagText; 81 } 82 83 //--------------------------------------------------------------------------------------------------------------------- 84 /** 85 * @brief TagName return tag name 86 * @return tag name 87 */ TagName()88inline QString VExceptionObjectError::TagName() const 89 { 90 return tagName; 91 } 92 93 //--------------------------------------------------------------------------------------------------------------------- 94 /** 95 * @brief LineNumber return line number in file 96 * @return line number 97 */ LineNumber()98inline qint32 VExceptionObjectError::LineNumber() const 99 { 100 return lineNumber; 101 } 102 103 #endif // VEXCEPTIONOBJECTERROR_H 104