1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
28 Input from file stream.
33 \*---------------------------------------------------------------------------*/
40 #include "className.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 /*---------------------------------------------------------------------------*\
53 Class IFstreamAllocator Declaration
54 \*---------------------------------------------------------------------------*/
56 //- A std::istream with ability to handle compressed files
57 class IFstreamAllocator
59 friend class IFstream;
64 IOstream::compressionType compression_;
69 //- Construct from pathname
70 IFstreamAllocator(const fileName& pathname);
78 /*---------------------------------------------------------------------------*\
79 Class IFstream Declaration
80 \*---------------------------------------------------------------------------*/
84 public IFstreamAllocator,
93 // Declare name of the class and its debug switch
94 ClassName("IFstream");
99 //- Construct from pathname
102 const fileName& pathname,
103 streamFormat format=ASCII,
104 versionNumber version=currentVersion
116 //- Return the name of the stream
117 const fileName& name() const
122 //- Return non-const access to the name of the stream
131 //- Access to underlying std::istream
132 virtual istream& stdStream();
134 //- Const access to underlying std::istream
135 virtual const istream& stdStream() const;
140 //- Print description of IOstream to Ostream
141 virtual void print(Ostream&) const;
146 //- Return a non-const reference to const IFstream
147 // Needed for read-constructors where the stream argument is temporary:
148 // e.g. thing thisThing(IFstream("thingFileName")());
149 IFstream& operator()() const;
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 } // End namespace Foam
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 // ************************************************************************* //