1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Generic output stream.
35 \*---------------------------------------------------------------------------*/
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class OSstream Declaration
51 \*---------------------------------------------------------------------------*/
63 // Private Member Functions
65 //- Disallow default bitwise assignment
66 void operator=(const OSstream&);
71 //- Return the stream reference
77 //- Return the const stream reference
78 const ostream& stream() const
93 streamFormat format = ASCII,
94 versionNumber version = currentVersion,
95 compressionType compression=UNCOMPRESSED
103 //- Return the name of the stream
104 // Useful for Fstream to return the filename
105 virtual const fileName& name() const
110 //- Return non-const access to the name of the stream
111 // Useful to alter the stream name
112 virtual fileName& name()
117 //- Return flags of output stream
118 virtual ios_base::fmtflags flags() const;
123 //- Write next token to stream
124 virtual Ostream& write(const token&);
127 virtual Ostream& write(const char);
129 //- Write character string
130 virtual Ostream& write(const char*);
133 virtual Ostream& write(const word&);
136 // In the rare case that the string contains a final trailing
137 // backslash, it will be dropped to the appearance of an escaped
139 virtual Ostream& write(const string&);
141 //- Write std::string surrounded by quotes.
142 // Optional write without quotes.
143 virtual Ostream& writeQuoted
146 const bool quoted=true
150 virtual Ostream& write(const label);
152 //- Write floatScalar
153 virtual Ostream& write(const floatScalar);
155 //- Write doubleScalar
156 virtual Ostream& write(const doubleScalar);
158 //- Write longDoubleScalar
159 virtual Ostream& write(const longDoubleScalar);
161 //- Write binary block
162 virtual Ostream& write(const char*, std::streamsize);
164 //- Add indentation characters
165 virtual void indent();
168 // Stream state functions
170 //- Set flags of output stream
171 virtual ios_base::fmtflags flags(const ios_base::fmtflags flags);
174 virtual void flush();
176 //- Add newline and flush stream
179 //- Get width of output field
180 virtual int width() const;
182 //- Set width of output field (and return old width)
183 virtual int width(const int);
185 //- Get precision of output field
186 virtual int precision() const;
188 //- Set precision of output field (and return old precision)
189 virtual int precision(const int);
194 //- Print description of IOstream to Ostream
195 virtual void print(Ostream&) const;
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 } // End namespace Foam
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 #include "OSstreamI.H"
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 // ************************************************************************* //