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-2019 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 a label
103  virtual Istream& read(label&)
104  {
106  return *this;
107  }
108 
109  //- Read a floatScalar
110  virtual Istream& read(floatScalar&)
111  {
113  return *this;
114  }
115 
116  //- Read a doubleScalar
117  virtual Istream& read(doubleScalar&)
118  {
120  return *this;
121  }
122 
123  //- Read a longDoubleScalar
124  virtual Istream& read(longDoubleScalar&)
125  {
127  return *this;
128  }
129 
130  //- Read binary block
131  virtual Istream& read(char*, std::streamsize)
132  {
134  return *this;
135  }
136 
137  //- Rewind and return the stream so that it may be read again
138  virtual Istream& rewind()
139  {
141  return *this;
142  }
143 
144  //- Return flags of stream
145  virtual ios_base::fmtflags flags() const
146  {
148  return ios_base::fmtflags(0);
149  }
150 
151  //- Set flags of stream
152  virtual ios_base::fmtflags flags(const ios_base::fmtflags f)
153  {
155  return f;
156  }
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
A token holds items read from Istream.
Definition: token.H:72
A class for handling words, derived from string.
Definition: word.H:59
float floatScalar
Float precision floating point scalar type.
Definition: floatScalar.H:52
virtual Istream & rewind()
Rewind and return the stream so that it may be read again.
Definition: dummyIstream.H:137
double doubleScalar
Double precision floating point scalar type.
Definition: doubleScalar.H:52
~dummyIstream()
Destructor.
Definition: dummyIstream.H:65
virtual Istream & read(token &)
Return next token from stream.
Definition: dummyIstream.H:74
labelList f(nPoints)
long double longDoubleScalar
Lang double precision floating point scalar type.
Dummy stream for input. Aborts at any attempt to read from it.
Definition: dummyIstream.H:48
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:370
virtual ios_base::fmtflags flags() const
Return flags of stream.
Definition: dummyIstream.H:144
Namespace for OpenFOAM.
dummyIstream()
Construct null.
Definition: dummyIstream.H:58