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 Generic output stream.
36 \*---------------------------------------------------------------------------*/
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class OSstream Declaration
52 \*---------------------------------------------------------------------------*/
64 // Private Member Functions
66 //- Disallow default bitwise assignment
67 void operator=(const OSstream&);
72 //- Return the stream reference
78 //- Return the const stream reference
79 const ostream& stream() const
94 streamFormat format=ASCII,
95 versionNumber version=currentVersion,
96 compressionType compression=UNCOMPRESSED
104 //- Return the name of the stream
105 // Useful for Fstream to return the filename
106 virtual const fileName& name() const
111 //- Return non-const access to the name of the stream
112 // Useful to alter the stream name
113 virtual fileName& name()
118 //- Return flags of output stream
119 virtual ios_base::fmtflags flags() const;
124 //- Write next token to stream
125 virtual Ostream& write(const token&);
128 virtual Ostream& write(const char);
130 //- Write character string
131 virtual Ostream& write(const char*);
134 virtual Ostream& write(const word&);
137 // In the rare case that the string contains a final trailing
138 // backslash, it will be dropped to the appearance of an escaped
140 virtual Ostream& write(const string&);
142 //- Write std::string surrounded by quotes.
143 // Optional write without quotes.
144 virtual Ostream& writeQuoted
147 const bool quoted=true
151 virtual Ostream& write(const label);
153 //- Write floatScalar
154 virtual Ostream& write(const floatScalar);
156 //- Write doubleScalar
157 virtual Ostream& write(const doubleScalar);
159 //- Write binary block
160 virtual Ostream& write(const char*, std::streamsize);
162 //- Add indentation characters
163 virtual void indent();
166 // Stream state functions
168 //- Set flags of output stream
169 virtual ios_base::fmtflags flags(const ios_base::fmtflags flags);
172 virtual void flush();
174 //- Add newline and flush stream
177 //- Get width of output field
178 virtual int width() const;
180 //- Set width of output field (and return old width)
181 virtual int width(const int);
183 //- Get precision of output field
184 virtual int precision() const;
186 //- Set precision of output field (and return old precision)
187 virtual int precision(const int);
192 //- Print description of IOstream to Ostream
193 virtual void print(Ostream&) const;
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 } // End namespace Foam
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 #include "OSstreamI.H"
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 // ************************************************************************* //