2017-06-29 09:12:51 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
2017-06-29 10:44:05 -05:00
|
|
|
|
2017-06-29 09:12:51 -05:00
|
|
|
#include <vector>
|
|
|
|
#include <QString>
|
|
|
|
|
2017-06-29 10:44:05 -05:00
|
|
|
class QTextStream;
|
|
|
|
|
2017-06-29 09:12:51 -05:00
|
|
|
class RicfMessages
|
|
|
|
{
|
|
|
|
public:
|
2017-06-29 10:44:05 -05:00
|
|
|
RicfMessages() : m_currentLineNumber(1) {}
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2017-06-29 10:44:05 -05:00
|
|
|
void addWarning(const QString& message);
|
|
|
|
void addError(const QString& message);
|
|
|
|
|
|
|
|
void skipWhiteSpaceWithLineNumberCount(QTextStream& inputStream);
|
2018-03-06 05:35:02 -06:00
|
|
|
void skipLineWithLineNumberCount(QTextStream& inputStream);
|
|
|
|
|
2017-06-29 10:44:05 -05:00
|
|
|
QChar readCharWithLineNumberCount(QTextStream& inputStream);
|
2017-07-26 09:22:46 -05:00
|
|
|
QChar peekNextChar(QTextStream& inputStream);
|
2017-06-29 09:12:51 -05:00
|
|
|
|
2017-06-29 09:29:50 -05:00
|
|
|
QString currentCommand;
|
|
|
|
QString currentArgument;
|
2017-06-29 09:12:51 -05:00
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
|