Commit 0368962e authored by mattijs's avatar mattijs
Browse files

BUG: CSV: binary writing

parent 1e2a6b5e
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -182,8 +182,17 @@ void Foam::csvTableReader<Type>::write(Ostream& os) const
<< headerLine_ << token::END_STATEMENT << nl;
os.writeKeyword("timeColumn")
<< timeColumn_ << token::END_STATEMENT << nl;
os.writeKeyword("valueColumns")
<< componentColumns_ << token::END_STATEMENT << nl;
// Force writing labelList in ascii
os.writeKeyword("valueColumns");
if (os.format() == IOstream::BINARY)
{
os.format(IOstream::ASCII);
os << componentColumns_;
os.format(IOstream::BINARY);
}
os << token::END_STATEMENT << nl;
os.writeKeyword("separator")
<< string(separator_) << token::END_STATEMENT << nl;
}
......
......@@ -74,8 +74,17 @@ void Foam::CSV<Type>::writeData(Ostream& os) const
os.writeKeyword("nHeaderLine") << nHeaderLine_ << token::END_STATEMENT
<< nl;
os.writeKeyword("refColumn") << refColumn_ << token::END_STATEMENT << nl;
os.writeKeyword("componentColumns") << componentColumns_
<< token::END_STATEMENT << nl;
// Force writing labelList in ascii
os.writeKeyword("componentColumns");
if (os.format() == IOstream::BINARY)
{
os.format(IOstream::ASCII);
os << componentColumns_;
os.format(IOstream::BINARY);
}
os << token::END_STATEMENT << nl;
os.writeKeyword("separator") << string(separator_)
<< token::END_STATEMENT << nl;
os.writeKeyword("mergeSeparators") << string(mergeSeparators_)
......
Markdown is supported
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