1 /************************************************************************ 2 ** 3 ** @file vexceptionwrongparameterid.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 VEXCEPTIONWRONGID_H 30 #define VEXCEPTIONWRONGID_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 VExceptionWrongId class for exception wrong id 43 */ 44 class VExceptionWrongId : public VException 45 { 46 public: 47 VExceptionWrongId(const QString &what, const QDomElement &domElement) V_NOEXCEPT_EXPR (true); 48 VExceptionWrongId(const VExceptionWrongId &e) V_NOEXCEPT_EXPR (true); 49 VExceptionWrongId &operator=(const VExceptionWrongId &e) V_NOEXCEPT_EXPR (true); 50 virtual ~VExceptionWrongId() V_NOEXCEPT_EXPR (true) Q_DECL_EQ_DEFAULT; 51 raise()52 Q_NORETURN virtual void raise() const override { throw *this; } 53 clone()54 Q_REQUIRED_RESULT virtual VExceptionWrongId *clone() const override { return new VExceptionWrongId(*this); } 55 56 virtual QString ErrorMessage() const override; 57 virtual QString DetailedInformation() const override; 58 QString TagText() const; 59 QString TagName() const; 60 qint32 LineNumber() const; 61 protected: 62 /** @brief tagText tag text */ 63 QString tagText; 64 65 /** @brief tagName tag name */ 66 QString tagName; 67 68 /** @brief lineNumber line number */ 69 qint32 lineNumber; 70 }; 71 72 //--------------------------------------------------------------------------------------------------------------------- 73 /** 74 * @brief TagText return tag text 75 * @return tag text 76 */ TagText()77inline QString VExceptionWrongId::TagText() const 78 { 79 return tagText; 80 } 81 82 //--------------------------------------------------------------------------------------------------------------------- 83 /** 84 * @brief TagName return tag name 85 * @return tag name 86 */ TagName()87inline QString VExceptionWrongId::TagName() const 88 { 89 return tagName; 90 } 91 92 //--------------------------------------------------------------------------------------------------------------------- 93 /** 94 * @brief LineNumber return line number in file 95 * @return line number 96 */ LineNumber()97inline qint32 VExceptionWrongId::LineNumber() const 98 { 99 return lineNumber; 100 } 101 102 #endif // VEXCEPTIONWRONGID_H 103