///////////////////////////////////////////////////////////////////////////////// // // 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 summaryAddress; std::string unitName; std::string scaleFactor; std::vector values; std::string dateFormat; std::string origin; }; //================================================================================================== /// //================================================================================================== class RifRsmspecParserTools { public: static bool isLineSkippable(const std::string& line); static std::vector splitLine(const std::string& line); static bool isAComment(const std::string& word); static std::vector splitLineAndRemoveComments(const std::string& line); static bool canBeAMnemonic(const std::string& word); static RifEclipseSummaryAddress::SummaryVarCategory identifyCategory(const std::string& word); static void splitLineToDoubles(const std::string& line, std::vector& values); static size_t findFirstNonEmptyEntryIndex(std::vector& list); static RifEclipseSummaryAddress makeAndFillAddress(std::string quantityName, std::vector< std::string > headerColumn); static std::vector columnInfoForTable(std::stringstream& data, std::string& line); static bool isANumber(const std::string& line); static std::vector headerReader(std::stringstream& streamData, std::string& line); };