mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add output methods for wordRes
This commit is contained in:
@ -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:
|
|||||||
|
|
||||||
// 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:
|
|||||||
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:
|
|||||||
//- 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 @@
|
|||||||
\\ / 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
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
Reference in New Issue
Block a user