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 Version of OSstream which prints a prefix on each line.
31 This is useful for running in parallel as it allows the processor number
32 to be automatically prepended to each message line.
37 \*---------------------------------------------------------------------------*/
39 #ifndef prefixOSstream_H
40 #define prefixOSstream_H
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class prefixOSstream Declaration
51 \*---------------------------------------------------------------------------*/
63 // Private member functions
65 inline void checkWritePrefix();
77 streamFormat format=ASCII,
78 versionNumber version=currentVersion,
79 compressionType compression=UNCOMPRESSED
87 //- Return the prefix of the stream
88 const string& prefix() const
93 //- Return non-const access to the prefix of the stream
102 //- Write next token to stream
103 virtual Ostream& write(const token&);
106 virtual Ostream& write(const char);
108 //- Write character string
109 virtual Ostream& write(const char*);
112 virtual Ostream& write(const word&);
115 virtual Ostream& write(const string&);
117 //- Write std::string surrounded by quotes.
118 // Optional write without quotes.
119 virtual Ostream& writeQuoted
122 const bool quoted=true
126 virtual Ostream& write(const label);
128 //- Write floatScalar
129 virtual Ostream& write(const floatScalar);
131 //- Write doubleScalar
132 virtual Ostream& write(const doubleScalar);
134 //- Write binary block
135 virtual Ostream& write(const char*, std::streamsize);
137 //- Add indentation characters
138 virtual void indent();
143 //- Print description of IOstream to Ostream
144 virtual void print(Ostream&) const;
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 } // End namespace Foam
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 // ************************************************************************* //