Add size() method to EclFile
This commit is contained in:
parent
292d00417c
commit
290368985a
@ -64,6 +64,7 @@ public:
|
||||
bool hasKey(const std::string &name) const;
|
||||
|
||||
const std::vector<std::string>& arrayNames() const { return array_name; }
|
||||
std::size_t size() const;
|
||||
|
||||
protected:
|
||||
bool formatted;
|
||||
|
@ -898,4 +898,10 @@ const std::vector<std::string>& EclFile::get<std::string>(const std::string &nam
|
||||
return getImpl(search->second, CHAR, char_array, "string");
|
||||
}
|
||||
|
||||
|
||||
std::size_t EclFile::size() const {
|
||||
return this->array_name.size();
|
||||
}
|
||||
|
||||
|
||||
}} // namespace Opm::ecl
|
||||
|
@ -272,6 +272,8 @@ BOOST_AUTO_TEST_CASE(TestEcl_Write_formatted_not_finite) {
|
||||
BOOST_CHECK(std::isinf(d[0]));
|
||||
BOOST_CHECK(std::isnan(f[1]));
|
||||
BOOST_CHECK(std::isnan(d[1]));
|
||||
|
||||
BOOST_CHECK_EQUAL(file1.size(), 2);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user