Commit cb743778 authored by mattijs's avatar mattijs
Browse files

BUG: Ostream: streaming of unexpanded variables over processorstreams

parent 1cf9d85b
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -172,6 +172,13 @@ Foam::Istream& Foam::UIPstream::read(token& t)
t.type() = token::VERBATIMSTRING;
return *this;
}
case token::VARIABLE :
{
// Recurse to read actual string
read(t);
t.type() = token::VARIABLE;
return *this;
}
case token::STRING :
{
string* pval = new string;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -159,6 +159,11 @@ Foam::Ostream& Foam::UOPstream::write(const token& t)
write(char(token::VERBATIMSTRING));
write(t.stringToken());
}
else if (t.type() == token::VARIABLE)
{
write(char(token::VARIABLE));
write(t.stringToken());
}
else
{
notImplemented("Ostream& UOPstream::write(const token&)");
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -39,6 +39,10 @@ Foam::Ostream& Foam::OSstream::write(const token& t)
write(char(token::HASH));
write(char(token::END_BLOCK));
}
else if (t.type() == token::VARIABLE)
{
writeQuoted( t.stringToken(), false);
}
return *this;
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -75,6 +75,10 @@ Foam::Ostream& Foam::prefixOSstream::write(const token& t)
write(char(token::HASH));
write(char(token::END_BLOCK));
}
else if (t.type() == token::VARIABLE)
{
writeQuoted(t.stringToken(), false);
}
return *this;
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -75,8 +75,8 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const token& t)
break;
case token::VARIABLE:
// Write variable as word so without ""
os.writeQuoted(*t.stringTokenPtr_, false);
// Behaviour differs according to stream type
os.write(t);
break;
case token::LABEL:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment