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/>.
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);
82 //- Access to underlying std::istream (for e.g. lexer)
87 /*---------------------------------------------------------------------------*\
88 Class IFstream Declaration
89 \*---------------------------------------------------------------------------*/
93 public IFstreamAllocator,
102 // Declare name of the class and its debug switch
103 ClassName("IFstream");
108 //- Construct from pathname
111 const fileName& pathname,
112 streamFormat format = ASCII,
113 versionNumber version = currentVersion
126 //- Return the name of the stream
127 const fileName& name() const
132 //- Return non-const access to the name of the stream
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 // ************************************************************************* //