dummyIstream.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2017-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::dummyIstream
26 
27 Description
28  Dummy stream for input. Aborts at any attempt to read from it.
29 
30 SourceFiles
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef dummyIstream_H
35 #define dummyIstream_H
36 
37 #include "Istream.H"
38 //#include <sstream>
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class dummyIstream Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class dummyIstream
50 :
51  public Istream
52 {
53 
54 public:
55 
56  // Constructors
57 
58  //- Construct null
59  dummyIstream()
60  :
61  Istream()
62  {}
63 
64 
65  //- Destructor
67  {}
68 
69 
70  // Member Functions
71 
72  // Read functions
73 
74  //- Return next token from stream
75  virtual Istream& read(token&)
76  {
78  return *this;
79  }
80 
81  //- Read a character
82  virtual Istream& read(char&)
83  {
85  return *this;
86  }
87 
88  //- Read a word
89  virtual Istream& read(word&)
90  {
92  return *this;
93  }
94 
95  // Read a string (including enclosing double-quotes)
96  virtual Istream& read(string&)
97  {
99  return *this;
100  }
101 
102  //- Read an int32_t
103  virtual Istream& read(int32_t&)
104  {
106  return *this;
107  }
108 
109  //- Read an int64_t
110  virtual Istream& read(int64_t&)
111  {
113  return *this;
114  }
115 
116  //- Read a uint32_t
117  virtual Istream& read(uint32_t&)
118  {
120  return *this;
121  }
122 
123  //- Read a uint64_t
124  virtual Istream& read(uint64_t&)
125  {
127  return *this;
128  }
129 
130  //- Read a floatScalar
131  virtual Istream& read(floatScalar&)
132  {
134  return *this;
135  }
136 
137  //- Read a doubleScalar
138  virtual Istream& read(doubleScalar&)
139  {
141  return *this;
142  }
143 
144  //- Read a longDoubleScalar
145  virtual Istream& read(longDoubleScalar&)
146  {
148  return *this;
149  }
150 
151  //- Read binary block
152  virtual Istream& read(char*, std::streamsize)
153  {
155  return *this;
156  }
157 
158  //- Rewind and return the stream so that it may be read again
159  virtual Istream& rewind()
160  {
162  return *this;
163  }
164 
165  //- Return flags of stream
166  virtual ios_base::fmtflags flags() const
167  {
169  return ios_base::fmtflags(0);
170  }
171 
172  //- Set flags of stream
173  virtual ios_base::fmtflags flags(const ios_base::fmtflags f)
174  {
176  return f;
177  }
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
Dummy stream for input. Aborts at any attempt to read from it.
Definition: dummyIstream.H:51
virtual Istream & rewind()
Rewind and return the stream so that it may be read again.
Definition: dummyIstream.H:158
virtual Istream & read(token &)
Return next token from stream.
Definition: dummyIstream.H:74
~dummyIstream()
Destructor.
Definition: dummyIstream.H:65
dummyIstream()
Construct null.
Definition: dummyIstream.H:58
virtual ios_base::fmtflags flags() const
Return flags of stream.
Definition: dummyIstream.H:165
A token holds items read from Istream.
Definition: token.H:73
A class for handling words, derived from string.
Definition: word.H:62
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:381
Namespace for OpenFOAM.
double doubleScalar
Double precision floating point scalar type.
Definition: doubleScalar.H:52
float floatScalar
Float precision floating point scalar type.
Definition: floatScalar.H:52
long double longDoubleScalar
Lang double precision floating point scalar type.
labelList f(nPoints)