1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 Output to memory buffer stream.
33 \*---------------------------------------------------------------------------*/
35 #ifndef OStringStream_H
36 #define OStringStream_H
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class OStringStream Declaration
48 \*---------------------------------------------------------------------------*/
59 //- Construct and set stream status
62 streamFormat format=ASCII,
63 versionNumber version=currentVersion
68 *(new std::ostringstream()),
69 "OStringStream.sinkFile",
76 OStringStream(const OStringStream& oss)
81 new std::ostringstream
83 dynamic_cast<const std::ostringstream&>
99 delete &dynamic_cast<std::ostringstream&>(stdStream());
107 //- Return the string
110 return dynamic_cast<const std::ostringstream&>
119 //- Clear the OStringStream
122 # if __GNUC__ < 4 && __GNUC_MINOR__ < 4
123 stdStream().rdbuf()->pubsetbuf(" ", 1);
125 stdStream().rdbuf()->pubseekpos(0);
132 //- Print description to Ostream
133 void print(Ostream&) const;
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 } // End namespace Foam
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 // ************************************************************************* //