diff --git a/src/OpenFOAM/primitives/strings/wordRes/wordRes.H b/src/OpenFOAM/primitives/strings/wordRes/wordRes.H index 00ca657fe80b2c5656a3f3a5f1c810dd71fbcb3c..30a7dd6b6b2eb789c0b6a65ae412785110e7cb21 100644 --- a/src/OpenFOAM/primitives/strings/wordRes/wordRes.H +++ b/src/OpenFOAM/primitives/strings/wordRes/wordRes.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -85,7 +85,7 @@ public: // Member Functions - // Access + // Access //- The number of elements in the list inline label size() const; @@ -94,7 +94,7 @@ public: inline bool empty() const; - // Searching + // Searching //- Return true if string matches any of the regular expressions // Smart match as regular expression or as a string. @@ -117,9 +117,27 @@ public: //- Return element of constant list inline const wordRe& operator[](const label i) const; + + // Writing + + //- Write wordReList, with line-breaks in ASCII if the list length + //- exceeds shortListLen. + // Using '0' suppresses line-breaks entirely. + inline Ostream& writeList + ( + Ostream& os, + const label shortListLen=0 + ) const; + }; +// Global Functions + +//- Write to Ostream, as per wordRes::writeList() with shortListLen=10 +inline Ostream& operator<<(Ostream& os, const wordRes& wres); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/primitives/strings/wordRes/wordResI.H b/src/OpenFOAM/primitives/strings/wordRes/wordResI.H index 504c0642b48f78fb4d0110ab2bb51a0bc9aaa75e..60460f31887167eeaf7e6f4ffe88e3680c21d143 100644 --- a/src/OpenFOAM/primitives/strings/wordRes/wordResI.H +++ b/src/OpenFOAM/primitives/strings/wordRes/wordResI.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -88,4 +88,22 @@ inline const Foam::wordRe& Foam::wordRes::operator[](const label i) const } +inline Foam::Ostream& Foam::wordRes::writeList +( + Ostream& os, + const label shortListLen +) const +{ + return list_.writeList(os, shortListLen); +} + + +// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // + +inline Foam::Ostream& Foam::operator<<(Ostream& os, const wordRes& wres) +{ + return wres.writeList(os, 10); +} + + // ************************************************************************* //