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
36 \*---------------------------------------------------------------------------*/
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class ISstream Declaration
52 \*---------------------------------------------------------------------------*/
64 // Private member functions
69 // Private Member Functions
71 //- Disallow default bitwise assignment
72 void operator=(const ISstream&);
77 // Protected member functions
79 //- Return the stream reference
85 //- Return the const stream reference
86 const istream& stream() const
96 //- Construct as wrapper around istream
101 streamFormat format=ASCII,
102 versionNumber version=currentVersion,
103 compressionType compression=UNCOMPRESSED
117 //- Return the name of the stream
118 // Useful for Fstream to return the filename
119 virtual const fileName& name() const
124 //- Return non-const access to the name of the stream
125 // Useful to alter the stream name
126 virtual fileName& name()
131 //- Return flags of output stream
132 virtual ios_base::fmtflags flags() const;
137 //- Raw, low-level get character function.
138 inline ISstream& get(char&);
140 //- Raw, low-level getline into a string function.
141 inline ISstream& getLine(string&);
143 //- Raw, low-level putback character function.
144 inline ISstream& putback(const char&);
146 //- Return next token from stream
147 virtual Istream& read(token&);
150 virtual Istream& read(char&);
153 virtual Istream& read(word&);
155 //- Read a string (including enclosing double-quotes).
156 // Backslashes are retained, except when escaping double-quotes
157 // and an embedded newline character.
158 virtual Istream& read(string&);
161 virtual Istream& read(label&);
163 //- Read a floatScalar
164 virtual Istream& read(floatScalar&);
166 //- Read a doubleScalar
167 virtual Istream& read(doubleScalar&);
169 //- Read binary block
170 virtual Istream& read(char*, std::streamsize);
172 //- Rewind and return the stream so that it may be read again
173 virtual Istream& rewind();
176 // Stream state functions
178 //- Set flags of output stream
179 virtual ios_base::fmtflags flags(const ios_base::fmtflags flags);
184 //- Print description of IOstream to Ostream
185 virtual void print(Ostream&) const;
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 } // End namespace Foam
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 #include "ISstreamI.H"
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 // ************************************************************************* //