Commit bac78ef9 authored by Henry Weller's avatar Henry Weller
Browse files

PtrListIO: Indent list elements on output.

Particularly useful for lists of dictionaries.
parent 04fe8859
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -188,7 +188,8 @@ template<class T>
Foam::Ostream& Foam::operator<<(Ostream& os, const PtrList<T>& L)
{
// Write size and start delimiter
os << nl << L.size() << nl << token::BEGIN_LIST;
os << nl << indent << L.size() << nl
<< indent << token::BEGIN_LIST << incrIndent;
// Write contents
forAll(L, i)
......@@ -197,7 +198,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const PtrList<T>& L)
}
// Write end delimiter
os << nl << token::END_LIST << nl;
os << nl << decrIndent << indent << token::END_LIST << nl;
// Check state of IOstream
os.check("Ostream& operator<<(Ostream&, const PtrList&)");
......
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