diff --git a/opm/parser/eclipse/Parser/ParserRecord.cpp b/opm/parser/eclipse/Parser/ParserRecord.cpp index da9452ff4..757dcb089 100644 --- a/opm/parser/eclipse/Parser/ParserRecord.cpp +++ b/opm/parser/eclipse/Parser/ParserRecord.cpp @@ -97,6 +97,13 @@ namespace Opm { throw std::out_of_range("Out of range"); } + bool ParserRecord::hasItem(const std::string& itemName) const { + if (m_itemMap.find(itemName) == m_itemMap.end()) + return false; + else + return true; + } + ParserItemConstPtr ParserRecord::get(const std::string& itemName) const { if (m_itemMap.find(itemName) == m_itemMap.end()) throw std::invalid_argument("Itemname: " + itemName + " does not exist."); diff --git a/opm/parser/eclipse/Parser/ParserRecord.hpp b/opm/parser/eclipse/Parser/ParserRecord.hpp index b0d090236..de5a5a8ce 100644 --- a/opm/parser/eclipse/Parser/ParserRecord.hpp +++ b/opm/parser/eclipse/Parser/ParserRecord.hpp @@ -43,6 +43,7 @@ namespace Opm { bool isDataRecord() const; bool equal(const ParserRecord& other) const; bool hasDimension() const; + bool hasItem(const std::string& itemName) const; void applyUnitsToDeck(std::shared_ptr deck , std::shared_ptr deckRecord) const; std::vector::const_iterator begin() const; std::vector::const_iterator end() const;