1 /************************************************************************
2  **
3  **  @file   vexceptionemptyparameter.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 VEXCEPTIONEMPTYPARAMETER_H
30 #define VEXCEPTIONEMPTYPARAMETER_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 VExceptionEmptyParameter class for exception empty parameter
43  */
44 class VExceptionEmptyParameter : public VException
45 {
46 public:
47     VExceptionEmptyParameter(const QString &what, const QString &name,
48                              const QDomElement &domElement) V_NOEXCEPT_EXPR (true);
49     VExceptionEmptyParameter(const VExceptionEmptyParameter &e) V_NOEXCEPT_EXPR (true);
50     VExceptionEmptyParameter &operator=(const VExceptionEmptyParameter &e) V_NOEXCEPT_EXPR (true);
51     virtual         ~VExceptionEmptyParameter() 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 VExceptionEmptyParameter *clone() const override
56     { return new VExceptionEmptyParameter(*this); }
57 
58     virtual QString ErrorMessage() const override;
59     virtual QString DetailedInformation() const override;
60     QString         Name() const;
61     QString         TagText() const;
62     QString         TagName() const;
63     qint32          LineNumber() const;
64 protected:
65     /** @brief name name attribute */
66     QString         name;
67 
68     /** @brief tagText tag text */
69     QString         tagText;
70 
71     /** @brief tagName tag name */
72     QString         tagName;
73 
74     /** @brief lineNumber line number */
75     qint32          lineNumber;
76 };
77 
78 //---------------------------------------------------------------------------------------------------------------------
79 /**
80  * @brief Name return name of attribute where error
81  * @return name
82  */
Name()83 inline QString VExceptionEmptyParameter::Name() const
84 {
85     return name;
86 }
87 
88 //---------------------------------------------------------------------------------------------------------------------
89 /**
90  * @brief TagText return tag text
91  * @return tag text
92  */
TagText()93 inline QString VExceptionEmptyParameter::TagText() const
94 {
95     return tagText;
96 }
97 
98 //---------------------------------------------------------------------------------------------------------------------
99 /**
100  * @brief TagName return tag name
101  * @return tag name
102  */
TagName()103 inline QString VExceptionEmptyParameter::TagName() const
104 {
105     return tagName;
106 }
107 
108 //---------------------------------------------------------------------------------------------------------------------
109 /**
110  * @brief LineNumber return line number of tag
111  * @return line number
112  */
LineNumber()113 inline qint32 VExceptionEmptyParameter::LineNumber() const
114 {
115     return lineNumber;
116 }
117 
118 #endif // VEXCEPTIONEMPTYPARAMETER_H
119