Added count() method to Section class
This commit is contained in:
parent
1669138bf6
commit
29df8e9f89
@ -41,6 +41,10 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
size_t Section::count(const std::string& keyword) const {
|
||||
return m_keywords.numKeywords( keyword );
|
||||
}
|
||||
|
||||
const std::string& Section::name() const {
|
||||
return m_name;
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ namespace Opm {
|
||||
DeckKeywordConstPtr getKeyword(const std::string& keyword) const;
|
||||
DeckKeywordConstPtr getKeyword(size_t index) const;
|
||||
const std::string& name() const;
|
||||
size_t count(const std::string& keyword) const;
|
||||
|
||||
static bool hasSCHEDULE(DeckConstPtr deck) { return hasSection( deck , "SCHEDULE" ); }
|
||||
static bool hasSOLUTION(DeckConstPtr deck) { return hasSection( deck , "SOLUTION" ); }
|
||||
|
@ -45,6 +45,8 @@ BOOST_AUTO_TEST_CASE(SectionTest) {
|
||||
BOOST_CHECK_EQUAL(false, section.hasKeyword("TEST4"));
|
||||
|
||||
BOOST_CHECK_EQUAL( section.name() , "TEST1" );
|
||||
BOOST_CHECK_EQUAL( section.count("TEST1") , 1);
|
||||
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(IteratorTest) {
|
||||
|
Loading…
Reference in New Issue
Block a user