Added method ParserRecord::hasItem()

This commit is contained in:
Joakim Hove
2015-06-04 17:42:28 +02:00
parent 155ad22a05
commit bb4d676d45
2 changed files with 8 additions and 0 deletions

View File

@@ -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.");