ISstream::getLine: continuation lines are now optional
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -769,13 +769,13 @@ Foam::Istream& Foam::ISstream::readVerbatim(verbatimString& str)
|
||||
}
|
||||
|
||||
|
||||
Foam::ISstream& Foam::ISstream::getLine(string& s)
|
||||
Foam::ISstream& Foam::ISstream::getLine(string& s, const bool continuation)
|
||||
{
|
||||
getline(is_, s);
|
||||
setState(is_.rdstate());
|
||||
lineNumber_++;
|
||||
|
||||
while (s.back() == '\\')
|
||||
while (continuation && s.back() == '\\')
|
||||
{
|
||||
string contLine;
|
||||
getline(is_, contLine);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -133,7 +133,8 @@ public:
|
||||
inline ISstream& putback(const char&);
|
||||
|
||||
//- Read line into a string
|
||||
ISstream& getLine(string&);
|
||||
// with optional support for continuation lines
|
||||
ISstream& getLine(string&, const bool continuation = true);
|
||||
|
||||
//- Read a '(...)' delimited set of characters into a string
|
||||
Istream& readList(string&);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -126,7 +126,8 @@ void Foam::dynamicCode::copyAndFilter
|
||||
string line;
|
||||
do
|
||||
{
|
||||
is.getLine(line);
|
||||
// Read the next line without continuation
|
||||
is.getLine(line, false);
|
||||
|
||||
// Expand according to mapping.
|
||||
// Expanding according to env variables might cause too many
|
||||
|
||||
Reference in New Issue
Block a user