1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 IOstream::compressionType compression=IOstream::UNCOMPRESSED
82 //- Access to underlying std::ostream
87 /*---------------------------------------------------------------------------*\
88 Class OFstream Declaration
89 \*---------------------------------------------------------------------------*/
93 private OFstreamAllocator,
103 // Declare name of the class and its debug switch
104 ClassName("OFstream");
109 //- Construct from pathname
112 const fileName& pathname,
113 streamFormat format=ASCII,
114 versionNumber version=currentVersion,
115 compressionType compression=UNCOMPRESSED
128 //- Return the name of the stream
129 const fileName& name() const
134 //- Return non-const access to the name of the stream
143 //- Print description of IOstream to Ostream
144 void print(Ostream&) const;
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 // Global predefined null output stream
151 extern OFstream Snull;
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 // ************************************************************************* //