RawKeyword::isTerminator uses is_separator

This commit is contained in:
Jørgen Kvalsvik
2016-03-04 10:38:01 +01:00
parent 1d1715b421
commit 38f88b4e14
2 changed files with 5 additions and 8 deletions

View File

@@ -103,16 +103,13 @@ namespace Opm {
}
}
bool RawKeyword::isTerminator(std::string line) {
boost::algorithm::trim_left( line );
if (line[0] == RawConsts::slash) {
return true;
} else
return false;
bool RawKeyword::isTerminator( const std::string& line ) {
auto fst = std::find_if_not( line.begin(), line.end(),
RawConsts::is_separator );
return fst != line.end() && *fst == RawConsts::slash;
}
RawRecordPtr RawKeyword::getRecord(size_t index) const {
if (index < m_records.size()) {
return m_records[index];

View File

@@ -47,7 +47,7 @@ namespace Opm {
std::shared_ptr< RawRecord > getRecord(size_t index) const;
static bool isKeywordPrefix(const std::string& line, std::string& keywordName);
static bool isTerminator(std::string line);
static bool isTerminator( const std::string& line );
bool isPartialRecordStringEmpty() const;