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 file stream.
33 \*---------------------------------------------------------------------------*/
40 #include "className.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 /*---------------------------------------------------------------------------*\
53 Class OFstreamAllocator Declaration
54 \*---------------------------------------------------------------------------*/
56 //- A std::ostream with ability to handle compressed files
57 class OFstreamAllocator
59 friend class OFstream;
65 //- Construct from pathname
68 const fileName& pathname,
69 IOstream::compressionType compression=IOstream::UNCOMPRESSED
78 /*---------------------------------------------------------------------------*\
79 Class OFstream Declaration
80 \*---------------------------------------------------------------------------*/
84 private OFstreamAllocator,
94 // Declare name of the class and its debug switch
95 ClassName("OFstream");
100 //- Construct from pathname
103 const fileName& pathname,
104 streamFormat format=ASCII,
105 versionNumber version=currentVersion,
106 compressionType compression=UNCOMPRESSED
118 //- Return the name of the stream
119 const fileName& name() const
124 //- Return non-const access to the name of the stream
133 //- Access to underlying std::ostream
134 virtual ostream& stdStream();
136 //- Const access to underlying std::ostream
137 virtual const ostream& stdStream() const;
142 //- Print description of IOstream to Ostream
143 void print(Ostream&) const;
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 //- Global predefined null output stream "/dev/null"
150 extern OFstream Snull;
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 } // End namespace Foam
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 // ************************************************************************* //