Added function to get keyword from deck based on index. Added looping over all keywords in application. This should have been several commits

This commit is contained in:
Kristian Flikka
2013-08-20 15:51:19 +02:00
parent 13ec4f2b38
commit b5dac4b5bd
8 changed files with 74 additions and 5 deletions

View File

@@ -63,7 +63,7 @@ namespace Opm {
if (index < keywordList.size())
return keywordList[index];
else
throw std::invalid_argument("Keyword index is out of range.");
throw std::out_of_range("Keyword index is out of range.");
}
@@ -72,6 +72,12 @@ namespace Opm {
return keywordList.back();
}
DeckKeywordConstPtr KeywordContainer::getKeyword(size_t index) const {
if (index < m_keywordList.size())
return m_keywordList[index];
else
throw std::out_of_range("Keyword index is out of range.");
}
size_t KeywordContainer::numKeywords(const std::string& keyword) const{
if (hasKeyword(keyword)) {