From bac78ef989d664668eb0127a6409f997d4114798 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sun, 17 Apr 2016 15:45:29 +0100 Subject: [PATCH] PtrListIO: Indent list elements on output. Particularly useful for lists of dictionaries. --- src/OpenFOAM/containers/Lists/PtrList/PtrListIO.C | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrListIO.C b/src/OpenFOAM/containers/Lists/PtrList/PtrListIO.C index 81741ed1c6..893a1cfd02 100644 --- a/src/OpenFOAM/containers/Lists/PtrList/PtrListIO.C +++ b/src/OpenFOAM/containers/Lists/PtrList/PtrListIO.C @@ -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 Foam::Ostream& Foam::operator<<(Ostream& os, const PtrList& 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& 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&)");