///////////////////////////////////////////////////////////////////////////////// // // 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RifEclipseSummaryAddress.h" #include #include #include #include #include #include struct ColumnInfo { bool isAVector = false; RifEclipseSummaryAddress::SummaryVarCategory category; std::string quantityName; std::string scaleFactor; int regionNumber; int regionNumber2; std::string wellGroupName; std::string wellName; int wellSegmentNumber; std::string lgrName; int cellI; int cellJ; int cellK; std::string unitName; std::vector values; }; //================================================================================================== /// //================================================================================================== class RifColumnBasedRsmspecParser { public: RifColumnBasedRsmspecParser(const QString& data); const std::vector< std::vector >& tables() const; private: static bool isLineSkippable(const std::string& line); static std::vector splitLine(const std::string& line); static bool isAMnemonic(const std::string& word); static RifEclipseSummaryAddress::SummaryVarCategory identifyCategory(const std::string& word); bool splitLineToDoubles(const std::string& line, std::vector& values); static std::vector columnInfoForTable(std::stringstream& data, std::string& line); void parseData(const QString& data); private: std::vector< std::vector > m_tables; };