From 4e520ceb6dcdb03c578ef04b46c06cb00ee583ec Mon Sep 17 00:00:00 2001 From: Tristan Youngs Date: Fri, 19 Oct 2018 15:17:27 +0100 Subject: [PATCH] Add LineParser::atEndOfFile() function. --- src/base/lineparser.cpp | 12 ++++++------ src/base/lineparser.h | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/base/lineparser.cpp b/src/base/lineparser.cpp index 55cd9f849..7133283f3 100644 --- a/src/base/lineparser.cpp +++ b/src/base/lineparser.cpp @@ -389,12 +389,6 @@ bool LineParser::getNextArg(int optionMask, QString& destArg) // Clear destination argument destArg.clear(); - if (endOfLine_) - { -// printf("Lineparser is at end of line - returning...\n"); - return true; - } - while (linePos_ < lineLength_) { c = line_.at(linePos_).toLatin1(); @@ -1223,3 +1217,9 @@ bool LineParser::hasArg(int i) const if ((i < 0) || (i >= nArgs())) return false; return true; } + +// Return whether we are at the end of the current line +bool LineParser::atEndOfLine() const +{ + return endOfLine_; +} diff --git a/src/base/lineparser.h b/src/base/lineparser.h index 1159ee9a5..6a2728c72 100644 --- a/src/base/lineparser.h +++ b/src/base/lineparser.h @@ -202,6 +202,8 @@ class LineParser float argf(int i); // Returns whether the specified argument exists bool hasArg(int i) const; + // Return whether we are at the end of the current line + bool atEndOfLine() const; }; ATEN_END_NAMESPACE