1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Input from file stream.
34 \*---------------------------------------------------------------------------*/
39 #include <OpenFOAM/ISstream.H>
40 #include <OpenFOAM/fileName.H>
41 #include <OpenFOAM/className.H>
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 /*---------------------------------------------------------------------------*\
54 Class IFstreamAllocator Declaration
55 \*---------------------------------------------------------------------------*/
57 //- A std::istream with ability to handle compressed files
58 class IFstreamAllocator
60 friend class IFstream;
65 IOstream::compressionType compression_;
70 //- Construct from pathname
71 IFstreamAllocator(const fileName& pathname);
83 //- Access to underlying std::istream (for e.g. lexer)
88 /*---------------------------------------------------------------------------*\
89 Class IFstream Declaration
90 \*---------------------------------------------------------------------------*/
94 public IFstreamAllocator,
103 // Declare name of the class and its debug switch
104 ClassName("IFstream");
109 //- Construct from pathname
112 const fileName& pathname,
113 streamFormat format=ASCII,
114 versionNumber version=currentVersion
127 //- Return the name of the stream
128 const fileName& name() const
133 //- Return non-const access to the name of the stream
141 //- Print description of IOstream to Ostream
142 virtual void print(Ostream&) const;
147 //- Return a non-const reference to const IFstream
148 // Needed for read-constructors where the stream argument is temporary:
149 // e.g. thing thisThing(IFstream("thingFileName")());
150 IFstream& operator()() const;
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 } // End namespace Foam
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 // ************************ vim: set sw=4 sts=4 et: ************************ //