Skip to content

Commit

Permalink
Fix FileParser::getNextArg() to read in line if required.
Browse files Browse the repository at this point in the history
  • Loading branch information
trisyoungs committed Oct 19, 2018
1 parent 4e520ce commit 839cb16
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/base/fileparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,21 @@ class FileParser
return (result == 0);
}
// Read next delimited argument from file
bool readArg(QString& variable)
bool readNextArg(QString& variable)
{
// If we are at the end of the current line, read in the next...
if (parser_.atEndOfLine())
{
if (parser_.readNextLine(Parser::Defaults) != 0)
{
variable.clear();
return false;
}
}

// Get next argument from current line
if (!parser_.getNextArg(Parser::Defaults, variable)) return false;

return true;
}
// Read next line from file into the variable supplied, and parse it as well
Expand Down

0 comments on commit 839cb16

Please sign in to comment.