mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4683 clang-format on all files in ApplicationCode
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -21,13 +21,13 @@
|
||||
#include "RifEclipseSummaryAddress.h"
|
||||
#include "RifEclipseUserDataParserTools.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QPointer>
|
||||
#include <QStringList>
|
||||
#include <QDateTime>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QLocale>
|
||||
#include <QPointer>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QTextStream>
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -35,60 +35,64 @@ class Column;
|
||||
class AsciiDataParseOptions;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RifCsvUserDataParser
|
||||
{
|
||||
public:
|
||||
enum CsvLayout { ColumnBased, LineBased };
|
||||
enum CsvLayout
|
||||
{
|
||||
ColumnBased,
|
||||
LineBased
|
||||
};
|
||||
|
||||
public:
|
||||
RifCsvUserDataParser(QString* errorText = nullptr);
|
||||
RifCsvUserDataParser( QString* errorText = nullptr );
|
||||
virtual ~RifCsvUserDataParser();
|
||||
|
||||
bool parse(const AsciiDataParseOptions& parseOptions);
|
||||
const TableData& tableData() const;
|
||||
bool parse( const AsciiDataParseOptions& parseOptions );
|
||||
const TableData& tableData() const;
|
||||
|
||||
const Column* columnInfo(size_t columnIndex) const;
|
||||
const Column* dateTimeColumn() const;
|
||||
const Column* columnInfo( size_t columnIndex ) const;
|
||||
const Column* dateTimeColumn() const;
|
||||
|
||||
bool parseColumnInfo(const AsciiDataParseOptions& parseOptions);
|
||||
QString previewText(int lineCount, const AsciiDataParseOptions& parseOptions);
|
||||
QStringList timeColumnPreviewData(int lineCount, const AsciiDataParseOptions& parseOptions);
|
||||
bool parseColumnInfo( const AsciiDataParseOptions& parseOptions );
|
||||
QString previewText( int lineCount, const AsciiDataParseOptions& parseOptions );
|
||||
QStringList timeColumnPreviewData( int lineCount, const AsciiDataParseOptions& parseOptions );
|
||||
|
||||
CsvLayout determineCsvLayout();
|
||||
CsvLayout determineCsvLayout();
|
||||
|
||||
QString tryDetermineCellSeparator();
|
||||
QString tryDetermineDecimalSeparator(const QString& cellSeparator);
|
||||
QString tryDetermineCellSeparator();
|
||||
QString tryDetermineDecimalSeparator( const QString& cellSeparator );
|
||||
|
||||
static QLocale localeFromDecimalSeparator(const QString& decimalSeparator);
|
||||
static QLocale localeFromDecimalSeparator( const QString& decimalSeparator );
|
||||
|
||||
protected:
|
||||
virtual QTextStream* openDataStream() = 0;
|
||||
virtual void closeDataStream() = 0;
|
||||
virtual QTextStream* openDataStream() = 0;
|
||||
virtual void closeDataStream() = 0;
|
||||
|
||||
private:
|
||||
std::vector<int> parseLineBasedHeader(QStringList headerCols);
|
||||
std::vector<int> parseLineBasedHeader( QStringList headerCols );
|
||||
|
||||
bool parseColumnInfo(QTextStream* dataStream,
|
||||
const AsciiDataParseOptions& parseOptions,
|
||||
std::vector<Column>* columnInfoList);
|
||||
bool parseColumnBasedData(const AsciiDataParseOptions& parseOptions);
|
||||
bool parseLineBasedData();
|
||||
static QDateTime tryParseDateTime(const std::string& colData, const QString& format);
|
||||
bool parseColumnInfo( QTextStream* dataStream,
|
||||
const AsciiDataParseOptions& parseOptions,
|
||||
std::vector<Column>* columnInfoList );
|
||||
bool parseColumnBasedData( const AsciiDataParseOptions& parseOptions );
|
||||
bool parseLineBasedData();
|
||||
static QDateTime tryParseDateTime( const std::string& colData, const QString& format );
|
||||
|
||||
private:
|
||||
TableData m_tableData;
|
||||
QString* m_errorText;
|
||||
TableData m_tableData;
|
||||
QString* m_errorText;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RifCsvUserDataFileParser : public RifCsvUserDataParser
|
||||
{
|
||||
public:
|
||||
RifCsvUserDataFileParser(const QString& fileName, QString* errorText = nullptr);
|
||||
RifCsvUserDataFileParser( const QString& fileName, QString* errorText = nullptr );
|
||||
~RifCsvUserDataFileParser() override;
|
||||
|
||||
protected:
|
||||
@@ -96,23 +100,23 @@ protected:
|
||||
void closeDataStream() override;
|
||||
|
||||
private:
|
||||
bool openFile();
|
||||
void closeFile();
|
||||
bool openFile();
|
||||
void closeFile();
|
||||
|
||||
private:
|
||||
QString m_fileName;
|
||||
QFile* m_file;
|
||||
QTextStream* m_textStream;
|
||||
QString m_fileName;
|
||||
QFile* m_file;
|
||||
QTextStream* m_textStream;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
|
||||
class RifCsvUserDataPastedTextParser : public RifCsvUserDataParser
|
||||
{
|
||||
public:
|
||||
RifCsvUserDataPastedTextParser(const QString& text, QString* errorText = nullptr);
|
||||
RifCsvUserDataPastedTextParser( const QString& text, QString* errorText = nullptr );
|
||||
~RifCsvUserDataPastedTextParser() override;
|
||||
|
||||
protected:
|
||||
@@ -120,6 +124,6 @@ protected:
|
||||
void closeDataStream() override;
|
||||
|
||||
private:
|
||||
QString m_text;
|
||||
QTextStream* m_textStream;
|
||||
QString m_text;
|
||||
QTextStream* m_textStream;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user