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/>.
33 \*---------------------------------------------------------------------------*/
39 #include "tokenList.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class ITstream Declaration
48 \*---------------------------------------------------------------------------*/
60 //- Index of token currently being read
68 //- Construct from components
72 const tokenList& tokens,
73 streamFormat format = ASCII,
74 versionNumber version = currentVersion
77 Istream(format, version),
88 ITstream(const ITstream& its)
90 Istream(ASCII, currentVersion),
110 //- Return the name of the stream
111 const fileName& name() const
116 //- Return non-const access to the name of the stream
122 //- Return the current token index
123 label tokenIndex() const
128 //- Return non-const access to the current token index
134 //- Return the number of remaining tokens
135 label nRemainingTokens() const
137 return size() - tokenIndex_;
140 //- Return flags of output stream
141 ios_base::fmtflags flags() const
143 return ios_base::fmtflags(0);
149 //- Return next token from stream
150 virtual Istream& read(token&);
153 virtual Istream& read(char&);
156 virtual Istream& read(word&);
158 // Read a string (including enclosing double-quotes)
159 virtual Istream& read(string&);
162 virtual Istream& read(label&);
164 //- Read a floatScalar
165 virtual Istream& read(floatScalar&);
167 //- Read a doubleScalar
168 virtual Istream& read(doubleScalar&);
170 //- Read a longDoubleScalar
171 virtual Istream& read(longDoubleScalar&);
173 //- Read binary block
174 virtual Istream& read(char*, std::streamsize);
176 //- Rewind and return the stream so that it may be read again
177 virtual Istream& rewind();
182 //- Set flags of stream
183 ios_base::fmtflags flags(const ios_base::fmtflags)
185 return ios_base::fmtflags(0);
191 //- Print description of IOstream to Ostream
192 void print(Ostream&) const;
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 } // End namespace Foam
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 // ************************************************************************* //