mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: CSV: binary writing
This commit is contained in:
@ -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_)
|
||||
|
||||
Reference in New Issue
Block a user