#1959 : Improve detection of comment lines in header

This commit is contained in:
Magne Sjaastad
2017-10-03 08:07:18 +02:00
parent 5375da3fc8
commit 2fc1d20f45
2 changed files with 63 additions and 3 deletions

View File

@@ -34,16 +34,25 @@
//--------------------------------------------------------------------------------------------------
bool RifEclipseUserDataParserTools::isLineSkippable(const std::string& line)
{
if (std::all_of(line.begin(), line.end(), isspace))
std::size_t found = line.find_first_not_of(" ");
if (found == std::string::npos)
{
// Line with only spaces
return true;
}
else if (line.size() > 1 && line[0] == '-' && line[1] == '-')
if (line[found] == '-')
{
// Comments start with -
return true;
}
else if (line.size() == 1 && line[0] == '1')
if (line[0] == '1')
{
// Single 1 at start of file
return true;
}