Documentation for OpenFLUID 2.2.2
Loading...
Searching...
No Matches
WareSrcMsgParser.hpp
Go to the documentation of this file.
1/*
2
3 This file is part of OpenFLUID software
4 Copyright(c) 2021-2026, INRAE
5
6
7 == GNU General Public License Usage ==
8
9 OpenFLUID is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 OpenFLUID is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21
22
23 == Other Usage ==
24
25 Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26 license, and requires a written agreement between You and INRA.
27 Licensees for Other Usage of OpenFLUID may use this file in accordance
28 with the terms contained in the written agreement between You and INRA.
29
30 */
31
32
33/**
34 @file WareSrcMsgParser.hpp
35
36 @author Aline LIBRES <aline.libres@gmail.com>
37 @author Jean-Christophe Fabre <jean-christophe.fabre@inra.fr>
38 @author Armel THÖNI <armel.thoni@inrae.fr>
39*/
40
41
42#ifndef __OPENFLUID_UIWARESDEV_WARESRCMSGPARSER_HPP__
43#define __OPENFLUID_UIWARESDEV_WARESRCMSGPARSER_HPP__
44
45
46#if (QT_VERSION_MAJOR < 6)
47
48
49# include <QRegExp>
50#else
51
52
53# include <QRegularExpression>
54#endif
55#include <QDir>
56
58
59
60namespace openfluid { namespace ui { namespace waresdev {
61
62
64{
65 public:
66
68 {
69 public:
70
71 enum class MessageType
72 {
73 MSG_COMMAND, MSG_STANDARD, MSG_WARNING, MSG_ERROR, MSG_SUCCESS
74 };
75
78 QString m_Path;
79 int m_LineNb = -1;
80 int m_ColNb = -1;
81 QString m_Content;
82
83 WareSrcMsg(const QString& MessageLine, MessageType MsgType = MessageType::MSG_STANDARD) :
84 m_Type(MsgType)
85 {
86 m_OriginalMsgLine = MessageLine.toUtf8();
87 }
88 };
89
91 { }
92
93 virtual WareSrcMsg parse(const QString& MessageLine,
95};
96
97
98// =====================================================================
99// =====================================================================
100
101
103{
104
105 public:
106
107 WareSrcMsgParser::WareSrcMsg parse(const QString& MessageLine,
109};
110
111
112// =====================================================================
113// =====================================================================
114
115
117{
118 private:
119
120#if (QT_VERSION_MAJOR < 6)
121 QRegExp m_GccMsgParseRx = QRegExp("^(.+):(\\d+):(\\d+): *(warning|error|note): *(.+)");
122#else
123 QRegularExpression m_GccMsgParseRx = QRegularExpression("^(.+):(\\d+):(\\d+): *(warning|error|note): *(.+)");
124#endif
125
126 public:
127
128 WareSrcMsgParser::WareSrcMsg parse(const QString& MessageLine,
130};
131
132
133// =====================================================================
134// =====================================================================
135
136
138{
139 private:
140
141#if (QT_VERSION_MAJOR < 6)
142 QRegExp m_CMakeMsgParseRx = QRegExp("^CMake Error at (.+):(\\d+) *(.+)");
143#else
144 QRegularExpression m_CMakeMsgParseRx = QRegularExpression("^CMake Error at (.+):(\\d+) *(.+)");
145#endif
146
147 QDir m_AbsoluteDir;
148
149 public:
150
151 WareSrcMsgParserCMake(const QString& AbsolutePath);
152
153 WareSrcMsgParser::WareSrcMsg parse(const QString& MessageLine,
155};
156
157
158// =====================================================================
159// =====================================================================
160
161
163{
164 private:
165
166#if (QT_VERSION_MAJOR < 6)
167 QRegExp m_CMakeMsgParseRx = QRegExp("Failed|FAILED|failed|Error|error|Passed");
168#else
169 QRegularExpression m_CMakeMsgParseRx = QRegularExpression("Failed|FAILED|failed|Error|error|Passed");
170#endif
171
172 QDir m_AbsoluteDir;
173
174 public:
175
176 WareSrcMsgParser::WareSrcMsg parse(const QString& MessageLine,
178};
179
180
181} } } // namespaces
182
183
184#endif /* __OPENFLUID_UIWARESDEV_WARESRCMSGPARSER_HPP__ */
Definition WareSrcMsgParser.hpp:138
WareSrcMsgParserCMake(const QString &AbsolutePath)
WareSrcMsgParser::WareSrcMsg parse(const QString &MessageLine, WareSrcMsgParser::WareSrcMsg::MessageType DefaultMsgType)
Definition WareSrcMsgParser.hpp:163
WareSrcMsgParser::WareSrcMsg parse(const QString &MessageLine, WareSrcMsgParser::WareSrcMsg::MessageType DefaultMsgType)
Definition WareSrcMsgParser.hpp:117
WareSrcMsgParser::WareSrcMsg parse(const QString &MessageLine, WareSrcMsgParser::WareSrcMsg::MessageType DefaultMsgType)
Definition WareSrcMsgParser.hpp:103
WareSrcMsgParser::WareSrcMsg parse(const QString &MessageLine, WareSrcMsgParser::WareSrcMsg::MessageType DefaultMsgType)
QString m_Path
Definition WareSrcMsgParser.hpp:78
QByteArray m_OriginalMsgLine
Definition WareSrcMsgParser.hpp:76
WareSrcMsg(const QString &MessageLine, MessageType MsgType=MessageType::MSG_STANDARD)
Definition WareSrcMsgParser.hpp:83
QString m_Content
Definition WareSrcMsgParser.hpp:81
MessageType
Definition WareSrcMsgParser.hpp:72
MessageType m_Type
Definition WareSrcMsgParser.hpp:77
Definition WareSrcMsgParser.hpp:64
virtual WareSrcMsg parse(const QString &MessageLine, WareSrcMsgParser::WareSrcMsg::MessageType DefaultMsgType)=0
virtual ~WareSrcMsgParser()
Definition WareSrcMsgParser.hpp:90
#define OPENFLUID_API
Definition dllexport.hpp:86
Definition ApplicationException.hpp:47