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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "prefixOSstream.H"
30 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
32 inline void Foam::prefixOSstream::checkWritePrefix()
34 if (printPrefix_ && prefix_.size())
36 OSstream::write(prefix_.c_str());
42 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 Foam::prefixOSstream::prefixOSstream
49 versionNumber version,
50 compressionType compression
53 OSstream(os, name, format, version, compression),
59 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
61 void Foam::prefixOSstream::print(Ostream& os) const
63 os << "prefixOSstream ";
68 Foam::Ostream& Foam::prefixOSstream::write(const token&)
74 Foam::Ostream& Foam::prefixOSstream::write(const char c)
88 Foam::Ostream& Foam::prefixOSstream::write(const char* str)
93 size_t len = strlen(str);
94 if (len && str[len-1] == token::NL)
103 Foam::Ostream& Foam::prefixOSstream::write(const word& val)
106 return OSstream::write(val);
110 Foam::Ostream& Foam::prefixOSstream::write(const string& val)
113 return OSstream::write(val);
117 Foam::Ostream& Foam::prefixOSstream::writeQuoted
119 const std::string& val,
124 return OSstream::writeQuoted(val, quoted);
128 Foam::Ostream& Foam::prefixOSstream::write(const label val)
131 return OSstream::write(val);
135 Foam::Ostream& Foam::prefixOSstream::write(const floatScalar val)
138 return OSstream::write(val);
142 Foam::Ostream& Foam::prefixOSstream::write(const doubleScalar val)
145 return OSstream::write(val);
149 Foam::Ostream& Foam::prefixOSstream::write(const longDoubleScalar val)
152 return OSstream::write(val);
156 Foam::Ostream& Foam::prefixOSstream::write
159 std::streamsize count
163 return OSstream::write(buf, count);
167 void Foam::prefixOSstream::indent()
173 // ************************************************************************* //