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-------------------------------------------------------------------------------
11License
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
27Note
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
40(
41 Foam::debug::infoSwitch("writePrecision", 6)
42);
43
44
45// * * * * * * * * * * * * * * Global Variables * * * * * * * * * * * * * * //
46
47// Global IO streams
48
49Foam::ISstream Foam::Sin(std::cin, "Sin");
50Foam::OSstream Foam::Sout(std::cout, "Sout");
51Foam::OSstream Foam::Serr(std::cerr, "Serr");
52Foam::OFstream Foam::Snull(nullptr); // A "/dev/null" equivalent
53
54Foam::prefixOSstream Foam::Pout(std::cout, "Pout");
55Foam::prefixOSstream Foam::Perr(std::cerr, "Perr");
56
57
58// ************************************************************************* //
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
static unsigned int precision_
Default precision.
Definition: IOstream.H:98
Generic input stream using a standard (STL) stream.
Definition: ISstream.H:58
Output to file stream, using an OSstream.
Definition: OFstream.H:57
Generic output stream using a standard (STL) stream.
Definition: OSstream.H:57
Version of OSstream that prints a prefix on each line.
int infoSwitch(const char *name, const int deflt=0)
Lookup info switch or add default value.
Definition: debug.C:231
prefixOSstream Perr
OSstream wrapped stderr (std::cerr) with parallel prefix.
OFstream Snull
Global predefined null output stream "/dev/null".
OSstream Sout
OSstream wrapped stdout (std::cout)
OSstream Serr
OSstream wrapped stderr (std::cerr)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
ISstream Sin
ISstream wrapped stdin (std::cin)