ensightReadFile.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2016-2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::ensightReadFile
28
29Description
30 Ensight output with specialized read() for strings, integers and floats.
31 Correctly handles binary read as well.
32
33\*---------------------------------------------------------------------------*/
34
35#ifndef ensightReadFile_H
36#define ensightReadFile_H
37
38#include "IFstream.H"
39#include "IOstream.H"
40
41// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43namespace Foam
44{
45
46/*---------------------------------------------------------------------------*\
47 Class ensightReadFile Declaration
48\*---------------------------------------------------------------------------*/
51:
52 public IFstream
53{
54 // Private Member Functions
55
56 //- No copy construct
57 ensightReadFile(const ensightReadFile&) = delete;
58
59 //- No copy assignment
60 void operator=(const ensightReadFile&) = delete;
61
62
63public:
64
65 // Constructors
66
67 //- Construct from pathname. Default format is binary.
68 explicit ensightReadFile
69 (
70 const fileName& pathname,
72 );
73
74
75 //- Destructor
76 ~ensightReadFile() = default;
77
78
79 // Output
80
81 //- Inherit read from Istream
82 using Istream::read;
83
84 //- Binary read
85 virtual Istream& read(char* buf, std::streamsize count);
86
87 //- Read string as "%80s" or as binary
88 Istream& read(string& value);
89
90 //- Read integer as "%10d" or as binary
91 Istream& read(label& value);
92
93 //- Read float as "%12.5e" or as binary
94 Istream& read(scalar& value);
95
96 //- Read element keyword
97 virtual Istream& readKeyword(string& key);
98
99 //- Read "C Binary" for binary files (eg, geometry/measured)
101};
102
103
104// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105
106} // End namespace Foam
107
108// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109
110#endif
111
112// ************************************************************************* //
Input from file stream, using an ISstream.
Definition: IFstream.H:57
streamFormat
Data format (ascii | binary)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
virtual bool read()
Re-read model coefficients if they have changed.
Ensight output with specialized read() for strings, integers and floats. Correctly handles binary rea...
virtual Istream & read(char *buf, std::streamsize count)
Binary read.
~ensightReadFile()=default
Destructor.
Istream & readBinaryHeader()
Read "C Binary" for binary files (eg, geometry/measured)
virtual Istream & readKeyword(string &key)
Read element keyword.
A class for handling file names.
Definition: fileName.H:76
Namespace for OpenFOAM.