File indexing completed on 2024-04-28 04:37:01

0001 /*
0002     SPDX-FileCopyrightText: 1999-2001 Bernd Gehrmann <bernd@kdevelop.org>
0003     SPDX-FileCopyrightText: 2007 Dukju Ahn <dukjuahn@gmail.com>
0004     SPDX-FileCopyrightText: 2012 Morten Danielsen Volden <mvolden2@gmail.com>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #ifndef KDEVPLATFORM_OUTPUTFORMATS_H
0010 #define KDEVPLATFORM_OUTPUTFORMATS_H
0011 
0012 #include <QString>
0013 #include <QRegularExpression>
0014 
0015 namespace KDevelop
0016 {
0017 
0018 struct ActionFormat
0019 {
0020     ActionFormat() = default;
0021     ActionFormat( const QString& _tool, const QString& regExp, int file );
0022     ActionFormat( int file, const QString& regExp );
0023     QRegularExpression expression;
0024     QString tool;
0025     int fileGroup;
0026 };
0027 
0028 struct ErrorFormat
0029 {
0030     ErrorFormat() = default;
0031     ErrorFormat( const QString& regExp, int file, int line, int text, int column=-1 );
0032     ErrorFormat( const QString& regExp, int file, int line, int text, const QString& comp, int column=-1 );
0033     QRegularExpression expression;
0034     int fileGroup;
0035     int lineGroup, columnGroup;
0036     int textGroup;
0037     QString compiler;
0038 
0039     // Returns the column number starting with 0 as the first column
0040     // If no match was found for columns or if index was not valid
0041     // (i.e. less than zero) - 0 is returned.
0042     int columnNumber(const QRegularExpressionMatch& match) const;
0043 };
0044 
0045 }
0046 #endif
0047 
0048 
0049