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-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::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 a label
102  virtual Istream& read(label&)
103  {
105  return *this;
106  }
107 
108  //- Read a floatScalar
109  virtual Istream& read(floatScalar&)
110  {
112  return *this;
113  }
114 
115  //- Read a doubleScalar
116  virtual Istream& read(doubleScalar&)
117  {
119  return *this;
120  }
121 
122  //- Read a longDoubleScalar
123  virtual Istream& read(longDoubleScalar&)
124  {
126  return *this;
127  }
128 
129  //- Read binary block
130  virtual Istream& read(char*, std::streamsize)
131  {
133  return *this;
134  }
135 
136  //- Rewind and return the stream so that it may be read again
137  virtual Istream& rewind()
138  {
140  return *this;
141  }
142 
143  //- Return flags of stream
144  virtual ios_base::fmtflags flags() const
145  {
147  return ios_base::fmtflags(0);
148  }
149 
150  //- Set flags of stream
151  virtual ios_base::fmtflags flags(const ios_base::fmtflags f)
152  {
154  return f;
155  }
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
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
virtual Istream & rewind()
Rewind and return the stream so that it may be read again.
float floatScalar
Float precision floating point scalar type.
Definition: floatScalar.H:52
double doubleScalar
Double precision floating point scalar type.
Definition: doubleScalar.H:52
labelList f(nPoints)
virtual ~dummyISstream()
Destructor.
Definition: dummyISstream.H:64
long double longDoubleScalar
Lang double precision floating point scalar type.
dummyISstream()
Construct null.
Definition: dummyISstream.H:57
Input from memory buffer stream.
Definition: IStringStream.H:49
virtual Istream & read(token &)
Return next token from stream.
Definition: dummyISstream.H:73
virtual ios_base::fmtflags flags() const
Return flags of stream.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:353
Dummy stream for input. Aborts at any attempt to read from it.
Definition: dummyISstream.H:47
A class for handling character strings derived from std::string.
Definition: string.H:76
Namespace for OpenFOAM.