1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Output to file stream.
34 \*---------------------------------------------------------------------------*/
41 #include "className.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 /*---------------------------------------------------------------------------*\
54 Class OFstreamAllocator Declaration
55 \*---------------------------------------------------------------------------*/
57 //- A std::ostream with ability to handle compressed files
58 class OFstreamAllocator
60 friend class OFstream;
66 //- Construct from pathname
69 const fileName& pathname,
70 ios_base::openmode mode,
71 IOstream::compressionType compression = IOstream::UNCOMPRESSED
84 //- Access to underlying std::ostream
89 /*---------------------------------------------------------------------------*\
90 Class OFstream Declaration
91 \*---------------------------------------------------------------------------*/
95 private OFstreamAllocator,
105 // Declare name of the class and its debug switch
106 ClassName("OFstream");
111 //- Construct from pathname
114 const fileName& pathname,
115 ios_base::openmode mode = ios_base::out|ios_base::trunc,
116 streamFormat format=ASCII,
117 versionNumber version=currentVersion,
118 compressionType compression=UNCOMPRESSED
131 //- Return the name of the stream
132 const fileName& name() const
137 //- Return non-const access to the name of the stream
146 //- Print description of IOstream to Ostream
147 void print(Ostream&) const;
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 // Global predefined null output stream
154 extern OFstream Snull;
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 } // End namespace Foam
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 // ************************************************************************* //