IOstreams.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9  Copyright (C) 2018-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Note
28  File included by global/global.Cver
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #include "IOstreamOption.H"
33 #include "IOstreams.H"
34 #include "OFstream.H"
35 
36 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
37 
38 // Default output precision
39 unsigned int Foam::IOstream::precision_
40 (
41  Foam::debug::infoSwitch("writePrecision", 6)
42 );
43 
44 
45 // * * * * * * * * * * * * * * Global Variables * * * * * * * * * * * * * * //
46 
47 // Global IO streams
48 
49 Foam::ISstream Foam::Sin(std::cin, "Sin");
50 Foam::OSstream Foam::Sout(std::cout, "Sout");
51 Foam::OSstream Foam::Serr(std::cerr, "Serr");
52 Foam::OFstream Foam::Snull(nullptr); // A "/dev/null" equivalent
53 
54 Foam::prefixOSstream Foam::Pout(std::cout, "Pout");
55 Foam::prefixOSstream Foam::Perr(std::cerr, "Perr");
56 
57 
58 // ************************************************************************* //
IOstreams.H
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Foam::ISstream
Generic input stream using a standard (STL) stream.
Definition: ISstream.H:55
Foam::Sin
ISstream Sin
ISstream wrapped stdin (std::cin)
Foam::Serr
OSstream Serr
OSstream wrapped stderr (std::cerr)
Foam::IOstream::precision_
static unsigned int precision_
Default precision.
Definition: IOstream.H:98
Foam::Pout
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
OFstream.H
Foam::debug::infoSwitch
int infoSwitch(const char *name, const int deflt=0)
Lookup info switch or add default value.
Definition: debug.C:231
Foam::prefixOSstream
Version of OSstream that prints a prefix on each line.
Definition: prefixOSstream.H:54
IOstreamOption.H
Foam::OSstream
Generic output stream using a standard (STL) stream.
Definition: OSstream.H:54
Foam::OFstream
Output to file stream, using an OSstream.
Definition: OFstream.H:53
Foam::Perr
prefixOSstream Perr
OSstream wrapped stderr (std::cerr) with parallel prefix.
Foam::Snull
OFstream Snull
Global predefined null output stream "/dev/null".
Foam::Sout
OSstream Sout
OSstream wrapped stdout (std::cout)