Skip to content
Snippets Groups Projects
Commit eb7f6d24 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: add output methods for wordRes

parent 2b0eaf2d
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -85,7 +85,7 @@ public: ...@@ -85,7 +85,7 @@ public:
// Member Functions // Member Functions
// Access // Access
//- The number of elements in the list //- The number of elements in the list
inline label size() const; inline label size() const;
...@@ -94,7 +94,7 @@ public: ...@@ -94,7 +94,7 @@ public:
inline bool empty() const; inline bool empty() const;
// Searching // Searching
//- Return true if string matches any of the regular expressions //- Return true if string matches any of the regular expressions
// Smart match as regular expression or as a string. // Smart match as regular expression or as a string.
...@@ -117,9 +117,27 @@ public: ...@@ -117,9 +117,27 @@ public:
//- Return element of constant list //- Return element of constant list
inline const wordRe& operator[](const label i) const; 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 } // End namespace Foam
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -88,4 +88,22 @@ inline const Foam::wordRe& Foam::wordRes::operator[](const label i) const ...@@ -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);
}
// ************************************************************************* // // ************************************************************************* //
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