dummyISstream.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::dummyISstream
26 
27 Description
28  Dummy stream for input. Aborts at any attempt to read from it.
29 
30 SourceFiles
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef dummyISstream_H
35 #define dummyISstream_H
36 
37 #include "IStringStream.H"
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 /*---------------------------------------------------------------------------*\
45  Class dummyISstream Declaration
46 \*---------------------------------------------------------------------------*/
47 
48 class dummyISstream
49 :
50  public IStringStream
51 {
52 
53 public:
54 
55  // Constructors
56 
57  //- Construct null
59  :
60  IStringStream(string::null)
61  {}
62 
63 
64  //- Destructor
65  virtual ~dummyISstream()
66  {}
67 
68 
69  // Member Functions
70 
71  // Read functions
72 
73  //- Return next token from stream
74  virtual Istream& read(token&)
75  {
77  return *this;
78  }
79 
80  //- Read a character
81  virtual Istream& read(char&)
82  {
84  return *this;
85  }
86 
87  //- Read a word
88  virtual Istream& read(word&)
89  {
91  return *this;
92  }
93 
94  // Read a string (including enclosing double-quotes)
95  virtual Istream& read(string&)
96  {
98  return *this;
99  }
100 
101  //- Read an int32_t
102  virtual Istream& read(int32_t&)
103  {
105  return *this;
106  }
107 
108  //- Read an int64_t
109  virtual Istream& read(int64_t&)
110  {
112  return *this;
113  }
114 
115  //- Read a uint32_t
116  virtual Istream& read(uint32_t&)
117  {
119  return *this;
120  }
121 
122  //- Read a uint64_t
123  virtual Istream& read(uint64_t&)
124  {
126  return *this;
127  }
128 
129  //- Read a floatScalar
130  virtual Istream& read(floatScalar&)
131  {
133  return *this;
134  }
135 
136  //- Read a doubleScalar
137  virtual Istream& read(doubleScalar&)
138  {
140  return *this;
141  }
142 
143  //- Read a longDoubleScalar
144  virtual Istream& read(longDoubleScalar&)
145  {
147  return *this;
148  }
149 
150  //- Read binary block
151  virtual Istream& read(char*, std::streamsize)
152  {
154  return *this;
155  }
156 
157  //- Rewind and return the stream so that it may be read again
158  virtual Istream& rewind()
159  {
161  return *this;
162  }
163 
164  //- Return flags of stream
165  virtual ios_base::fmtflags flags() const
166  {
168  return ios_base::fmtflags(0);
169  }
170 
171  //- Set flags of stream
172  virtual ios_base::fmtflags flags(const ios_base::fmtflags f)
173  {
175  return f;
176  }
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
Input from memory buffer stream.
Definition: IStringStream.H:52
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: dummyISstream.H:50
virtual Istream & rewind()
Rewind and return the stream so that it may be read again.
virtual Istream & read(token &)
Return next token from stream.
Definition: dummyISstream.H:73
dummyISstream()
Construct null.
Definition: dummyISstream.H:57
virtual ios_base::fmtflags flags() const
Return flags of stream.
virtual ~dummyISstream()
Destructor.
Definition: dummyISstream.H:64
A class for handling character strings derived from std::string.
Definition: string.H:79
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)