2017-06-29 09:12:51 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-06-29 09:12:51 -05:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-06-29 09:12:51 -05:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-06-29 09:12:51 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
2017-06-29 10:44:05 -05:00
|
|
|
|
2017-06-29 09:12:51 -05:00
|
|
|
#include <QString>
|
2019-09-06 03:40:57 -05:00
|
|
|
#include <vector>
|
2017-06-29 09:12:51 -05:00
|
|
|
|
2017-06-29 10:44:05 -05:00
|
|
|
class QTextStream;
|
|
|
|
|
2017-06-29 09:12:51 -05:00
|
|
|
class RicfMessages
|
|
|
|
{
|
|
|
|
public:
|
2019-09-06 03:40:57 -05:00
|
|
|
RicfMessages()
|
|
|
|
: m_currentLineNumber( 1 )
|
|
|
|
{
|
|
|
|
}
|
2017-06-29 10:44:05 -05:00
|
|
|
|
2017-06-29 09:12:51 -05:00
|
|
|
enum MessageType
|
|
|
|
{
|
2017-07-26 09:22:46 -05:00
|
|
|
MESSAGE_WARNING,
|
|
|
|
MESSAGE_ERROR
|
2017-06-29 09:12:51 -05:00
|
|
|
};
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void addWarning( const QString& message );
|
|
|
|
void addError( const QString& message );
|
|
|
|
|
|
|
|
void skipWhiteSpaceWithLineNumberCount( QTextStream& inputStream );
|
|
|
|
void skipLineWithLineNumberCount( QTextStream& inputStream );
|
2017-06-29 10:44:05 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
QChar readCharWithLineNumberCount( QTextStream& inputStream );
|
|
|
|
QChar peekNextChar( QTextStream& inputStream );
|
2017-06-29 09:12:51 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
QString currentCommand;
|
|
|
|
QString currentArgument;
|
|
|
|
std::vector<std::pair<MessageType, QString>> m_messages;
|
2017-06-29 10:44:05 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
int m_currentLineNumber;
|
2017-06-29 09:12:51 -05:00
|
|
|
};
|