1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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 Generic output stream.
36 \*---------------------------------------------------------------------------*/
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class OSstream Declaration
52 \*---------------------------------------------------------------------------*/
66 // Private Member Functions
68 //- Disallow default bitwise assignment
69 void operator=(const OSstream&);
74 //- Return the stream reference
80 //- Return the const stream reference
81 const ostream& stream() const
96 streamFormat format=ASCII,
97 versionNumber version=currentVersion,
98 compressionType compression=UNCOMPRESSED
106 //- Return the name of the stream
107 // Useful for Fstream to return the filename
108 virtual const fileName& name() const
113 //- Return non-const access to the name of the stream
114 // Useful to alter the stream name
115 virtual fileName& name()
120 //- Return flags of output stream
121 virtual ios_base::fmtflags flags() const;
126 //- Write next token to stream
127 virtual Ostream& write(const token&);
130 virtual Ostream& write(const char);
132 //- Write character string
133 virtual Ostream& write(const char*);
136 virtual Ostream& write(const word&);
139 virtual Ostream& write(const string&);
142 virtual Ostream& write(const label);
144 //- Write floatScalar
145 virtual Ostream& write(const floatScalar);
147 //- Write doubleScalar
148 virtual Ostream& write(const doubleScalar);
150 //- Write binary block
151 virtual Ostream& write(const char*, std::streamsize);
153 //- Add indentation characters
154 virtual void indent();
157 // Stream state functions
159 //- Set flags of output stream
160 virtual ios_base::fmtflags flags(const ios_base::fmtflags flags);
163 virtual void flush();
165 //- Add '\n' and flush stream
168 //- Get width of output field
169 virtual int width() const;
171 //- Set width of output field (and return old width)
172 virtual int width(const int w);
174 //- Get precision of output field
175 virtual int precision() const;
177 //- Set precision of output field (and return old precision)
178 virtual int precision(const int p);
183 //- Print description of IOstream to Ostream
184 virtual void print(Ostream&) const;
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 } // End namespace Foam
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 #include "OSstreamI.H"
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 // ************************************************************************* //