Files
ResInsight/Fwk/AppFwk/cafPdmScripting/cafPdmScriptIOMessages.h

76 lines
2.5 KiB
C
Raw Normal View History

2020-03-05 08:48:13 +01:00
//##################################################################################################
2020-03-04 11:30:08 +01:00
//
2020-03-05 08:48:13 +01:00
// Custom Visualization Core library
// Copyright (C) Ceetron Solutions AS
2020-03-04 11:30:08 +01:00
//
2020-03-05 08:48:13 +01:00
// This library may be used under the terms of either the GNU General Public License or
// the GNU Lesser General Public License as follows:
2020-03-04 11:30:08 +01:00
//
2020-03-05 08:48:13 +01:00
// GNU General Public License Usage
// This library 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.
2020-03-04 11:30:08 +01:00
//
2020-03-05 08:48:13 +01:00
// This library 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.
2020-03-04 11:30:08 +01:00
//
2020-03-05 08:48:13 +01:00
// See the GNU General Public License at <<http://www.gnu.org/licenses/gpl.html>>
// for more details.
//
// GNU Lesser General Public License Usage
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library 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 Lesser General Public License at <<http://www.gnu.org/licenses/lgpl-2.1.html>>
// for more details.
//
//##################################################################################################
2020-03-04 11:30:08 +01:00
#pragma once
#include <QString>
#include <vector>
class QTextStream;
namespace caf {
class PdmScriptIOMessages
{
public:
PdmScriptIOMessages()
: m_currentLineNumber( 1 )
{
}
enum MessageType
{
MESSAGE_WARNING,
MESSAGE_ERROR
};
void addWarning( const QString& message );
void addError( const QString& message );
void skipWhiteSpaceWithLineNumberCount( QTextStream& inputStream );
void skipLineWithLineNumberCount( QTextStream& inputStream );
QChar readCharWithLineNumberCount( QTextStream& inputStream );
QChar peekNextChar( QTextStream& inputStream );
QString currentCommand;
QString currentArgument;
std::vector<std::pair<MessageType, QString>> m_messages;
private:
int m_currentLineNumber;
};
}